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

Commit

Permalink
Fixed several issues involved in calculating oblateness acceleration …
Browse files Browse the repository at this point in the history
…terms for test particles undergoing encounters
  • Loading branch information
daminton committed Jun 16, 2021
1 parent 42575ee commit a6c54ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/obl/obl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
aobl(:, i) = fac1 * xh(:, i)
aobl(3, i) = fac2 * xh(3, i) + aobl(3, i)
end do
aoblcb(:) = 0.0_DP
select type(self)
class is (swiftest_pl)
associate(Mpl => self%Gmass)
Expand Down
5 changes: 5 additions & 0 deletions src/rmvs/rmvs_setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ module subroutine rmvs_setup_pl(self,n)
do i = 0, NTENC
allocate(pl%outer(i)%x(NDIM, n))
allocate(pl%outer(i)%v(NDIM, n))
pl%outer(i)%x(:,:) = 0.0_DP
pl%outer(i)%v(:,:) = 0.0_DP
end do
do i = 0, NTPHENC
allocate(pl%inner(i)%x(NDIM, n))
allocate(pl%inner(i)%v(NDIM, n))
allocate(pl%inner(i)%aobl(NDIM, n))
pl%inner(i)%x(:,:) = 0.0_DP
pl%inner(i)%v(:,:) = 0.0_DP
pl%inner(i)%aobl(:,:) = 0.0_DP
end do
end if
end associate
Expand Down
10 changes: 8 additions & 2 deletions src/rmvs/rmvs_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,14 @@ subroutine rmvs_interp_in(pl, cb, dt, outer_index, config)
pl%inner(inner_index)%aobl(:, :) = pl%aobl(:, :)
end if
end do
! Put the planet positions back into place
if (config%loblatecb) call move_alloc(xh_original, pl%xh)
if (config%loblatecb) then
! Calculate the final value of oblateness accelerations at the final inner substep
pl%xh(:,:) = pl%inner(NTPHENC)%x(:, :)
call pl%obl_acc(cb)
pl%inner(NTPHENC)%aobl(:, :) = pl%aobl(:, :)
! Put the planet positions back into place
call move_alloc(xh_original, pl%xh)
end if
end associate
return

Expand Down

0 comments on commit a6c54ae

Please sign in to comment.