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

Commit

Permalink
Fixed problem where encounter checks were using heliocentric instead …
Browse files Browse the repository at this point in the history
…of barycentric velocities
  • Loading branch information
daminton committed Dec 2, 2022
1 parent eb7bf33 commit 3742cc8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/symba/symba_encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ module function symba_encounter_check_pl(self, param, system, dt, irec) result(l
call pl%set_renc(irec)

if (nplt == 0) then
call encounter_check_all_plpl(param, npl, pl%xh, pl%vh, pl%renc, dt, nenc, index1, index2, lvdotr)
call encounter_check_all_plpl(param, npl, pl%xh, pl%vb, pl%renc, dt, nenc, index1, index2, lvdotr)
else
call encounter_check_all_plplm(param, nplm, nplt, pl%xh(:,1:nplm), pl%vh(:,1:nplm), pl%xh(:,nplm+1:npl), &
pl%vh(:,nplm+1:npl), pl%renc(1:nplm), pl%renc(nplm+1:npl), dt, nenc, index1, index2, lvdotr)
call encounter_check_all_plplm(param, nplm, nplt, pl%xh(:,1:nplm), pl%vb(:,1:nplm), pl%xh(:,nplm+1:npl), &
pl%vb(:,nplm+1:npl), pl%renc(1:nplm), pl%renc(nplm+1:npl), dt, nenc, index1, index2, lvdotr)
end if

lany_encounter = nenc > 0_I8B
Expand Down Expand Up @@ -136,7 +136,7 @@ module function symba_encounter_check(self, param, system, dt, irec) result(lany
i = self%index1(k)
j = self%index2(k)
xr(:) = pl%xh(:,j) - pl%xh(:,i)
vr(:) = pl%vh(:,j) - pl%vh(:,i)
vr(:) = pl%vb(:,j) - pl%vb(:,i)
rcrit12 = pl%renc(i) + pl%renc(j)
call encounter_check_one(xr(1), xr(2), xr(3), vr(1), vr(2), vr(3), rcrit12, dt, lencounter(lidx), self%lvdotr(k))
if (lencounter(lidx)) then
Expand All @@ -151,7 +151,7 @@ module function symba_encounter_check(self, param, system, dt, irec) result(lany
i = self%index1(k)
j = self%index2(k)
xr(:) = tp%xh(:,j) - pl%xh(:,i)
vr(:) = tp%vh(:,j) - pl%vh(:,i)
vr(:) = tp%vb(:,j) - pl%vb(:,i)
call encounter_check_one(xr(1), xr(2), xr(3), vr(1), vr(2), vr(3), pl%renc(i), dt, &
lencounter(lidx), self%lvdotr(k))
if (lencounter(lidx)) then
Expand Down Expand Up @@ -213,7 +213,7 @@ module function symba_encounter_check_tp(self, param, system, dt, irec) result(l

associate(tp => self, ntp => self%nbody, pl => system%pl, npl => system%pl%nbody)
call pl%set_renc(irec)
call encounter_check_all_pltp(param, npl, ntp, pl%xh, pl%vh, tp%xh, tp%vh, pl%renc, dt, nenc, index1, index2, lvdotr)
call encounter_check_all_pltp(param, npl, ntp, pl%xh, pl%vb, tp%xh, tp%vb, pl%renc, dt, nenc, index1, index2, lvdotr)

lany_encounter = nenc > 0
if (lany_encounter) then
Expand Down

0 comments on commit 3742cc8

Please sign in to comment.