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

Commit

Permalink
Made sure to sync up the coordinate systems before doing a tp discard…
Browse files Browse the repository at this point in the history
…. Otherwise the h2b call in discard.f90 uses the pre-encounter planet heliocentric position and velocity vectors to compute barycentric, instead of using the current barycentric vectors when doing a SyMBA recursion step.
  • Loading branch information
daminton committed Mar 7, 2022
1 parent 22d5f3a commit daf7296
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/orbel/orbel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,8 @@ module subroutine orbel_xv2el_vec(self, cb)
self%a(i), self%e(i), self%inc(i), &
self%capom(i), self%omega(i), self%capm(i))
end do

return
end subroutine orbel_xv2el_vec


Expand Down
12 changes: 9 additions & 3 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ module function symba_collision_check_encounter(self, system, param, t, dt, irec
end select
end select

! Extract the pl-pl or pl-tpencounter list and return the plplcollision_list
! Extract the pl-pl or pl-tp encounter list and return the pl-pl or pl-tp collision_list
if (lany_collision) then
select type(self)
class is (symba_plplenc)
Expand Down Expand Up @@ -1074,8 +1074,14 @@ module subroutine symba_collision_resolve_pltpenc(self, system, param, t, dt, ir
real(DP), intent(in) :: t !! Current simulation tim
real(DP), intent(in) :: dt !! Current simulation step size
integer(I4B), intent(in) :: irec !! Current recursion level

call system%tp%xh2xb(system%cb)

! Make sure coordinate systems are all synced up due to being inside the recursion at this point
call system%pl%vb2vh(system%cb)
call system%tp%vb2vh(system%cb%vb)
call system%pl%b2h(system%cb)
call system%tp%b2h(system%cb)

! Discard the collider
call system%tp%discard(system, param)

return
Expand Down

0 comments on commit daf7296

Please sign in to comment.