This repository was archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'OOPSymba' into OOPTides
- Loading branch information
Showing
25 changed files
with
1,558 additions
and
594 deletions.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
examples/rmvs_swifter_comparison/9pl_18tp_encounters/swiftest_rmvs_vs_swifter_rmvs.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
536 changes: 533 additions & 3 deletions
536
examples/symba_swifter_comparison/1pl_1tp_encounter/swiftest_vs_swifter.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,141 @@ | ||
| submodule(helio_classes) s_helio_kick | ||
| use swiftest | ||
| contains | ||
| module subroutine helio_kickvb_pl(self, dt) | ||
| module subroutine helio_kick_getacch_pl(self, system, param, t, lbeg) | ||
| !! author: David A. Minton | ||
| !! | ||
| !! Compute heliocentric accelerations of massive bodies | ||
| !! | ||
| !! Adapted from David E. Kaufmann's Swifter routine helio_kick_getacch.f90 | ||
| !! Adapted from Hal Levison's Swift routine helio_kick_getacch.f | ||
| implicit none | ||
| ! Arguments | ||
| class(helio_pl), intent(inout) :: self !! Helio massive body particle data structure | ||
| class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object | ||
| class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters | ||
| real(DP), intent(in) :: t !! Current simulation time | ||
| logical, intent(in) :: lbeg !! Logical flag that determines whether or not this is the beginning or end of the step | ||
|
|
||
| associate(cb => system%cb, pl => self, npl => self%nbody) | ||
| call pl%accel_int() | ||
| if (param%loblatecb) then | ||
| call pl%accel_obl(system) | ||
| if (lbeg) then | ||
| cb%aoblbeg = cb%aobl | ||
| else | ||
| cb%aoblend = cb%aobl | ||
| end if | ||
| if (param%ltides) then | ||
| call pl%accel_tides(system) | ||
| if (lbeg) then | ||
| cb%atidebeg = cb%atide | ||
| else | ||
| cb%atideend = cb%atide | ||
| end if | ||
| end if | ||
| end if | ||
| if (param%lextra_force) call pl%accel_user(system, param, t, lbeg) | ||
| !if (param%lgr) call pl%gr_accel(param) | ||
| end associate | ||
|
|
||
| return | ||
| end subroutine helio_kick_getacch_pl | ||
|
|
||
| module subroutine helio_kick_getacch_tp(self, system, param, t, lbeg) | ||
| !! author: David A. Minton | ||
| !! | ||
| !! Compute heliocentric accelerations of test particles | ||
| !! | ||
| !! Adapted from David E. Kaufmann's Swifter routine helio_kick_getacch_tp.f90 | ||
| !! Adapted from Hal Levison's Swift routine helio_kick_getacch_tp.f | ||
| implicit none | ||
| ! Arguments | ||
| class(helio_tp), intent(inout) :: self !! Helio test particle data structure | ||
| class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object | ||
| class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters | ||
| real(DP), intent(in) :: t !! Current time | ||
| logical, intent(in) :: lbeg !! Logical flag that determines whether or not this is the beginning or end of the step | ||
|
|
||
| associate(tp => self, cb => system%cb, pl => system%pl, npl => system%pl%nbody) | ||
| system%lbeg = lbeg | ||
| if (system%lbeg) then | ||
| call tp%accel_int(pl%Gmass(:), pl%xbeg(:,:), npl) | ||
| else | ||
| call tp%accel_int(pl%Gmass(:), pl%xend(:,:), npl) | ||
| end if | ||
| if (param%loblatecb) call tp%accel_obl(system) | ||
| if (param%lextra_force) call tp%accel_user(system, param, t, lbeg) | ||
| !if (param%lgr) call tp%gr_accel(param) | ||
| end associate | ||
| return | ||
| end subroutine helio_kick_getacch_tp | ||
|
|
||
| module subroutine helio_kick_vb_pl(self, system, param, t, dt, mask, lbeg) | ||
| !! author: David A. Minton | ||
| !! | ||
| !! Kick barycentric velocities of bodies | ||
| !! | ||
| !! Adapted from Martin Duncan and Hal Levison's Swift routine kickvh.f | ||
| !! Adapted from David E. Kaufmann's Swifter routine helio_kickvb.f90 | ||
| !! Adapted from David E. Kaufmann's Swifter routine helio_kick_vb.f90 | ||
| implicit none | ||
| ! Arguments | ||
| class(helio_pl), intent(inout) :: self !! Swiftest generic body object | ||
| real(DP), intent(in) :: dt !! Stepsize | ||
| class(helio_pl), intent(inout) :: self !! Swiftest generic body object | ||
| class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object | ||
| class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters | ||
| real(DP), intent(in) :: t !! Current time | ||
| real(DP), intent(in) :: dt !! Stepsize | ||
| logical, dimension(:), intent(in) :: mask !! Mask that determines which bodies to kick | ||
| logical, intent(in) :: lbeg !! Logical flag indicating whether this is the beginning of the half step or not. | ||
| ! Internals | ||
| integer(I4B) :: i | ||
|
|
||
| associate(pl => self, npl => self%nbody) | ||
| if (npl ==0) return | ||
| do concurrent(i = 1:npl, pl%status(i) == ACTIVE) | ||
| pl%ah(:,:) = 0.0_DP | ||
| call pl%accel(system, param, t, lbeg) | ||
| if (lbeg) then | ||
| call pl%set_beg_end(xbeg = pl%xh) | ||
| else | ||
| call pl%set_beg_end(xend = pl%xh) | ||
| end if | ||
| do concurrent(i = 1:npl, mask(i)) | ||
| pl%vb(:, i) = pl%vb(:, i) + pl%ah(:, i) * dt | ||
| end do | ||
| end associate | ||
|
|
||
| return | ||
|
|
||
| end subroutine helio_kickvb_pl | ||
| end subroutine helio_kick_vb_pl | ||
|
|
||
| module subroutine helio_kickvb_tp(self, dt) | ||
| module subroutine helio_kick_vb_tp(self, system, param, t, dt, mask, lbeg) | ||
| !! author: David A. Minton | ||
| !! | ||
| !! Kick barycentric velocities of bodies | ||
| !! | ||
| !! Adapted from Martin Duncan and Hal Levison's Swift routine kickvh_tp.f | ||
| !! Adapted from David E. Kaufmann's Swifter routine helio_kickvb_tp.f90 | ||
| !! Adapted from David E. Kaufmann's Swifter routine helio_kick_vb_tp.f90 | ||
| implicit none | ||
| ! Arguments | ||
| class(helio_tp), intent(inout) :: self !! Swiftest generic body object | ||
| real(DP), intent(in) :: dt !! Stepsize | ||
| class(helio_tp), intent(inout) :: self !! Swiftest generic body object | ||
| class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object | ||
| class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters | ||
| real(DP), intent(in) :: t !! Current time | ||
| real(DP), intent(in) :: dt !! Stepsize | ||
| logical, dimension(:), intent(in) :: mask !! Mask that determines which bodies to kick | ||
| logical, intent(in) :: lbeg !! Logical flag indicating whether this is the beginning of the half step or not. | ||
| ! Internals | ||
| integer(I4B) :: i | ||
|
|
||
| associate(tp => self, ntp => self%nbody) | ||
| if (ntp ==0) return | ||
| do concurrent(i = 1:ntp, tp%status(i) == ACTIVE) | ||
| tp%ah(:,:) = 0.0_DP | ||
| call tp%accel(system, param, t, lbeg) | ||
| do concurrent(i = 1:ntp, mask(i)) | ||
| tp%vb(:, i) = tp%vb(:, i) + tp%ah(:, i) * dt | ||
| end do | ||
| end associate | ||
|
|
||
| return | ||
|
|
||
| end subroutine helio_kickvb_tp | ||
| end subroutine helio_kick_vb_tp | ||
| end submodule s_helio_kick |
Oops, something went wrong.