Skip to content

Commit

Permalink
interface interaction changes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnaparker committed Apr 24, 2020
1 parent 178e731 commit b50f407
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stoked/collisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ def force(self):
F = np.zeros_like(self.position)

dz = self.position[:,2] - self.zpos
idx = np.abs(dz) < rad
F[idx,2] = np.sign(dz[idx])*self.kn*np.sqrt((dz[idx] - rad[idx])**3)
overlap = dz - rad
idx = overlap < 0
F[idx,2] = np.sign(dz[idx])*self.kn*np.sqrt(-overlap[idx])**3

return F

Expand Down
3 changes: 3 additions & 0 deletions stoked/van_der_waals.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def force(self):

F = np.zeros_like(self.position)
F[:,2] = -np.sign(dz)*factor*Q
idx = (dz - radius < 3e-9)
F[idx] = 0

return F

def torque(self):
Expand Down

0 comments on commit b50f407

Please sign in to comment.