Skip to content
Snippets Groups Projects
Commit bdb86030 authored by nguyed99's avatar nguyed99
Browse files

Revert "Merge branch 'nicoa96-main-patch-47348' into 'main'"

This reverts merge request !9
parent adeaff5e
No related branches found
No related tags found
1 merge request!11Revert "Merge branch 'nicoa96-main-patch-47348' into 'main'"
Pipeline #59654 passed
...@@ -22,7 +22,7 @@ class MainApp: ...@@ -22,7 +22,7 @@ class MainApp:
self.rootNode.insert(particle) self.rootNode.insert(particle)
def ResetTree(self, particles): def ResetTree(self, particles):
"""Reset the Octree by reinitializing the root node.""" """Reset the Quadtree by reinitializing the root node."""
# Define the size of the rootNode based on the positions of the particles # Define the size of the rootNode based on the positions of the particles
#min_x = min([particle.x for particle in particles]) #min_x = min([particle.x for particle in particles])
#min_y = min([particle.y for particle in particles]) #min_y = min([particle.y for particle in particles])
...@@ -161,8 +161,8 @@ class TreeNode: ...@@ -161,8 +161,8 @@ class TreeNode:
mid_x = self.x + self.width / 2 mid_x = self.x + self.width / 2
mid_y = self.y + self.height / 2 mid_y = self.y + self.height / 2
mid_z = self.z + self.depth / 2 mid_z = self.z + self.depth / 2
oct_index = (particle.x >= mid_x) + 2 * (particle.y >= mid_y) + 4 * (particle.z >= mid_z) quad_index = (particle.x >= mid_x) + 2 * (particle.y >= mid_y) + 4 * (particle.z >= mid_z)
return oct_index return quad_index
def print_tree(self, depth_=0): def print_tree(self, depth_=0):
"""Print the structure of the Octree. """Print the structure of the Octree.
...@@ -363,4 +363,4 @@ class TreeNode: ...@@ -363,4 +363,4 @@ class TreeNode:
self.mass = total_mass self.mass = total_mass
else: else:
self.center_of_mass = np.array([0.0, 0.0, 0.0]) self.center_of_mass = np.array([0.0, 0.0, 0.0])
self.mass = 0 self.mass = 0
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment