Commit 0a5003bb authored by Olaf's avatar Olaf

final modifications barnes hut

parent 33e84220
......@@ -22,10 +22,8 @@ def create_node(root):
r = root[4]/2 # 2r = width of square
dim = origin.shape[0]
node = (2**dim + 3)*[[]]
node[-1] = 2*r
node[-2] = np.sum(mass)
node[-3] = (np.sum(pos.T*mass, axis = 1)/np.sum(mass)).tolist()
node = 2**dim*[[]]
node.extend([(np.sum(pos.T*mass, axis = 1)/np.sum(mass)).tolist(), np.sum(mass), 2*r])
direction = (np.dot(pos - origin, np.eye(dim))>0)[:,np.newaxis]
new_origin = np.array([range(2**dim)]).T & 2**np.arange(dim) > 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment