From 8ac38b6a22a8b80394a82ad43d345f28b9d39051 Mon Sep 17 00:00:00 2001 From: nicoa96 <nicoa96@zedat.fu-berlin.de> Date: Sun, 10 Mar 2024 10:53:20 +0000 Subject: [PATCH] Update bht_algorithm_3D.py --- jobs/src/bht_algorithm_3D.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jobs/src/bht_algorithm_3D.py b/jobs/src/bht_algorithm_3D.py index 47f2acd..d897155 100644 --- a/jobs/src/bht_algorithm_3D.py +++ b/jobs/src/bht_algorithm_3D.py @@ -22,7 +22,7 @@ class MainApp: self.rootNode.insert(particle) def ResetTree(self, particles): - """Reset the Quadtree by reinitializing the root node.""" + """Reset the Octree by reinitializing the root node.""" # Define the size of the rootNode based on the positions of the particles #min_x = min([particle.x for particle in particles]) #min_y = min([particle.y for particle in particles]) @@ -161,8 +161,8 @@ class TreeNode: mid_x = self.x + self.width / 2 mid_y = self.y + self.height / 2 mid_z = self.z + self.depth / 2 - quad_index = (particle.x >= mid_x) + 2 * (particle.y >= mid_y) + 4 * (particle.z >= mid_z) - return quad_index + oct_index = (particle.x >= mid_x) + 2 * (particle.y >= mid_y) + 4 * (particle.z >= mid_z) + return oct_index def print_tree(self, depth_=0): """Print the structure of the Octree. @@ -363,4 +363,4 @@ class TreeNode: self.mass = total_mass else: self.center_of_mass = np.array([0.0, 0.0, 0.0]) - self.mass = 0 \ No newline at end of file + self.mass = 0 -- GitLab