Commit fff77f8e authored by Olaf's avatar Olaf

rename function to avoid confusion

parent cf236ee3
......@@ -199,23 +199,23 @@ def force_node(pos, node, theta, nbody, Mshape):
if len(node) == 3:
if nbody.shape[0] == 1 and node[-1] != nbody:
force[nbody] = force_calc(pos, node[0], node[1])
force[nbody] = force_cal(pos, node[0], node[1])
elif nbody.shape[0] != 1:
if nbody[nbody == node[-1]].shape[0] == 0:
force[nbody] = force_calc(pos, node[0], node[1])
force[nbody] = force_cal(pos, node[0], node[1])
else:
nbody_for = np.delete(nbody, np.array(range(pos.shape[0]))[nbody == node[-1]])
pos_for = np.delete(pos, np.array(range(pos.shape[0]))[nbody == node[-1]], 0)
force[nbody_for] = force_calc(pos_for, node[0], node[1])
force[nbody_for] = force_cal(pos_for, node[0], node[1])
elif len(node) == 8:
d = np.linalg.norm(pos - np.asarray(node[4]), axis = 1)
nbody_calc = nbody[node[-1]/d < theta]
if nbody_calc.shape[0] != 0:
force[nbody_calc] = force_calc(pos[node[-1]/d < theta], node[4], node[5])
force[nbody_calc] = force_cal(pos[node[-1]/d < theta], node[4], node[5])
pos_cont = pos[node[-1]/d >= theta]
nbody_cont = nbody[node[-1]/d >= theta]
......@@ -227,7 +227,7 @@ def force_node(pos, node, theta, nbody, Mshape):
return force
def force_calc(pos1 , pos2, m):
def force_cal(pos1 , pos2, m):
"""
Calculates force on the body at pos1 by the node at pos2.
......
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