Skip to content

Commit

Permalink
bug fix: NaNs in pairwise forces
Browse files Browse the repository at this point in the history
  • Loading branch information
johnaparker committed Feb 5, 2020
1 parent f11c3c2 commit b2d7f66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stoked/forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def force(self):

r_ij = self.position[:,np.newaxis] - self.position[np.newaxis] # N x N x 3
F_ij = self.force_func(r_ij) # N x N x 3
np.einsum('iix->x', F_ij)[...] = 0
np.einsum('iix->ix', F_ij)[...] = 0
F_i = np.sum(F_ij, axis=1)

return F_i
Expand Down

0 comments on commit b2d7f66

Please sign in to comment.