Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Put back overlap check in acceleration calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 17, 2021
1 parent 4e951ab commit a0fc17c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/symba/symba_kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ module subroutine symba_kick_getacch_pl(self, system, param, t, lbeg)
associate(i => plplenc_list%index1(k), j => plplenc_list%index2(k))
dx(:) = pl%xh(:, j) - pl%xh(:, i)
rji2 = dot_product(dx(:), dx(:))
irij3 = 1.0_DP / (rji2 * sqrt(rji2))
faci = pl%Gmass(i) * irij3
facj = pl%Gmass(j) * irij3
pl%ah(:, i) = pl%ah(:, i) - facj * dx(:)
pl%ah(:, j) = pl%ah(:, j) + faci * dx(:)
rlim2 = (pl%radius(i) + pl%radius(j))**2
if (rji2 > rlim2) then
irij3 = 1.0_DP / (rji2 * sqrt(rji2))
faci = pl%Gmass(i) * irij3
facj = pl%Gmass(j) * irij3
pl%ah(:, i) = pl%ah(:, i) - facj * dx(:)
pl%ah(:, j) = pl%ah(:, j) + faci * dx(:)
end if
end associate
end do
end associate
Expand Down

0 comments on commit a0fc17c

Please sign in to comment.