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

Commit

Permalink
Added param to the argument list of the interaction acceleration meth…
Browse files Browse the repository at this point in the history
…ods so that the choice of whether to use the flattened matrix or not is availble
  • Loading branch information
daminton committed Sep 16, 2021
1 parent b2401e0 commit 7b784f6
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 5,377 deletions.
6 changes: 0 additions & 6 deletions examples/symba_mars_disk/Untitled.ipynb

This file was deleted.

13 changes: 7 additions & 6 deletions examples/symba_mars_disk/param.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
!Parameter file for the SyMBA-RINGMOONS test
T0 0.0
TSTOP 60000.0
TSTOP 12000.0
DT 600.0
CB_IN cb.in
PL_IN mars.in
TP_IN tp.in
IN_TYPE ASCII
ISTEP_OUT 100
ISTEP_DUMP 100
BIN_OUT bin.nc
ISTEP_OUT 1
ISTEP_DUMP 1
BIN_OUT bin.nc
PARTICLE_OUT particle.dat
OUT_TYPE REAL8
OUT_FORM XV
OUT_TYPE NETCDF_DOUBLE
OUT_FORM XVEL
OUT_STAT REPLACE
CHK_CLOSE yes
CHK_RMIN 3389500.0
Expand All @@ -31,3 +31,4 @@ MU2KG 1.0
DU2M 1.0
TU2S 1.0
SEED 2 3080983 2220830
FLATTEN_INTERACTIONS yes
33 changes: 33 additions & 0 deletions examples/symba_mars_disk/param.real8.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
!Parameter file for the SyMBA-RINGMOONS test
T0 0.0
TSTOP 6000.0
DT 600.0
CB_IN cb.in
PL_IN mars.in
TP_IN tp.in
IN_TYPE ASCII
ISTEP_OUT 1
ISTEP_DUMP 1
BIN_OUT bin.dat
PARTICLE_OUT particle.dat
OUT_TYPE REAL8
OUT_FORM EL
OUT_STAT REPLACE
CHK_CLOSE yes
CHK_RMIN 3389500.0
CHK_RMAX 3389500000.0
CHK_EJECT 3389500000.0
CHK_QMIN 3389500.0
CHK_QMIN_COORD HELIO
CHK_QMIN_RANGE 3389500.0 338950000000.0
EXTRA_FORCE no
RHILL_PRESENT yes
GMTINY 10000.0
MIN_GMFRAG 1000.0
ENERGY yes
FRAGMENTATION yes
ROTATION yes
MU2KG 1.0
DU2M 1.0
TU2S 1.0
SEED 2 3080983 2220830
5,414 changes: 73 additions & 5,341 deletions examples/symba_mars_disk/testnetcdf.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/helio/helio_kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module subroutine helio_kick_getacch_pl(self, system, param, t, lbeg)
if (self%nbody == 0) return

associate(cb => system%cb, pl => self, npl => self%nbody)
call pl%accel_int()
call pl%accel_int(param)
if (param%loblatecb) then
call pl%accel_obl(system)
if (lbeg) then
Expand Down Expand Up @@ -65,9 +65,9 @@ module subroutine helio_kick_getacch_tp(self, system, param, t, lbeg)
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(1:npl), pl%xbeg(:,1:npl), npl)
call tp%accel_int(param, pl%Gmass(1:npl), pl%xbeg(:,1:npl), npl)
else
call tp%accel_int(pl%Gmass(1:npl), pl%xend(:,1:npl), npl)
call tp%accel_int(param, pl%Gmass(1:npl), pl%xend(:,1:npl), npl)
end if
if (param%loblatecb) call tp%accel_obl(system)
if (param%lextra_force) call tp%accel_user(system, param, t, lbeg)
Expand Down
16 changes: 9 additions & 7 deletions src/kick/kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use swiftest
contains

module subroutine kick_getacch_int_pl(self)
module subroutine kick_getacch_int_pl(self, param)
!! author: David A. Minton
!!
!! Compute direct cross (third) term heliocentric accelerations of massive bodies
Expand All @@ -11,15 +11,16 @@ module subroutine kick_getacch_int_pl(self)
!! Adapted from David E. Kaufmann's Swifter routine whm_kick_getacch_ah3.f90 and helio_kick_getacch_int.f90
implicit none
! Arguments
class(swiftest_pl), intent(inout) :: self !! Swiftest massive body object
class(swiftest_pl), intent(inout) :: self !! Swiftest massive body object
class(swiftest_parameters), intent(in) :: param !! Current swiftest run configuration parameters

call kick_getacch_int_all_flat_pl(self%nbody, self%nplpl, self%k_plpl, self%xh, self%Gmass, self%radius, self%ah)

return
end subroutine kick_getacch_int_pl


module subroutine kick_getacch_int_tp(self, GMpl, xhp, npl)
module subroutine kick_getacch_int_tp(self, param, GMpl, xhp, npl)
!! author: David A. Minton
!!
!! Compute direct cross (third) term heliocentric accelerations of test particles by massive bodies
Expand All @@ -28,10 +29,11 @@ module subroutine kick_getacch_int_tp(self, GMpl, xhp, npl)
!! Adapted from David E. Kaufmann's Swifter routine whm_kick_getacch_ah3.f90 and helio_kick_getacch_int_tp.f90
implicit none
! Arguments
class(swiftest_tp), intent(inout) :: self !! Swiftest test particle object
real(DP), dimension(:), intent(in) :: GMpl !! Massive body masses
real(DP), dimension(:,:), intent(in) :: xhp !! Massive body position vectors
integer(I4B), intent(in) :: npl !! Number of active massive bodies
class(swiftest_tp), intent(inout) :: self !! Swiftest test particle object
class(swiftest_parameters), intent(in) :: param !! Current swiftest run configuration parameters
real(DP), dimension(:), intent(in) :: GMpl !! Massive body masses
real(DP), dimension(:,:), intent(in) :: xhp !! Massive body position vectors
integer(I4B), intent(in) :: npl !! Number of active massive bodies

if ((self%nbody == 0) .or. (npl == 0)) return

Expand Down
16 changes: 9 additions & 7 deletions src/modules/swiftest_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -841,17 +841,19 @@ module subroutine io_write_hdr_system(self, iu, param)
class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters
end subroutine io_write_hdr_system

module subroutine kick_getacch_int_pl(self)
module subroutine kick_getacch_int_pl(self, param)
implicit none
class(swiftest_pl), intent(inout) :: self !! Swiftest massive body object
class(swiftest_pl), intent(inout) :: self !! Swiftest massive body object
class(swiftest_parameters), intent(in) :: param !! Current swiftest run configuration parameters
end subroutine kick_getacch_int_pl

module subroutine kick_getacch_int_tp(self, GMpl, xhp, npl)
module subroutine kick_getacch_int_tp(self, param, GMpl, xhp, npl)
implicit none
class(swiftest_tp), intent(inout) :: self !! Swiftest test particle
real(DP), dimension(:), intent(in) :: GMpl !! Massive body masses
real(DP), dimension(:,:), intent(in) :: xhp !! Massive body position vectors
integer(I4B), intent(in) :: npl !! Number of active massive bodies
class(swiftest_tp), intent(inout) :: self !! Swiftest test particle object
class(swiftest_parameters), intent(in) :: param !! Current swiftest run configuration parameters
real(DP), dimension(:), intent(in) :: GMpl !! Massive body masses
real(DP), dimension(:,:), intent(in) :: xhp !! Massive body position vectors
integer(I4B), intent(in) :: npl !! Number of active massive bodies
end subroutine kick_getacch_int_tp

module subroutine kick_getacch_int_all_flat_pl(npl, nplpl, k_plpl, x, Gmass, radius, acc)
Expand Down
5 changes: 3 additions & 2 deletions src/modules/symba_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,10 @@ module subroutine symba_io_write_discard(self, param)
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine symba_io_write_discard

module subroutine symba_kick_getacch_int_pl(self)
module subroutine symba_kick_getacch_int_pl(self, param)
implicit none
class(symba_pl), intent(inout) :: self
class(symba_pl), intent(inout) :: self !! SyMBA massive body object
class(swiftest_parameters), intent(in) :: param !! Current swiftest run configuration parameters
end subroutine symba_kick_getacch_int_pl

module subroutine symba_kick_getacch_pl(self, system, param, t, lbeg)
Expand Down
5 changes: 3 additions & 2 deletions src/symba/symba_kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use swiftest
contains

module subroutine symba_kick_getacch_int_pl(self)
module subroutine symba_kick_getacch_int_pl(self, param)
!! author: David A. Minton
!!
!! Compute direct cross (third) term heliocentric accelerations of massive bodies, with no mutual interactions between bodies below GMTINY
Expand All @@ -11,7 +11,8 @@ module subroutine symba_kick_getacch_int_pl(self)
!! Adapted from David E. Kaufmann's Swifter routine helio_kick_getacch_int.f90
implicit none
! Arguments
class(symba_pl), intent(inout) :: self
class(symba_pl), intent(inout) :: self !! SyMBA massive body object
class(swiftest_parameters), intent(in) :: param !! Current swiftest run configuration parameter

call kick_getacch_int_all_flat_pl(self%nbody, self%nplplm, self%k_plpl, self%xh, self%Gmass, self%radius, self%ah)

Expand Down
6 changes: 3 additions & 3 deletions src/whm/whm_kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module subroutine whm_kick_getacch_pl(self, system, param, t, lbeg)

call whm_kick_getacch_ah1(cb, pl)
call whm_kick_getacch_ah2(cb, pl)
call pl%accel_int()
call pl%accel_int(param)

if (param%loblatecb) then
call pl%accel_obl(system)
Expand Down Expand Up @@ -84,13 +84,13 @@ module subroutine whm_kick_getacch_tp(self, system, param, t, lbeg)
do concurrent(i = 1:ntp, tp%lmask(i))
tp%ah(:, i) = tp%ah(:, i) + ah0(:)
end do
call tp%accel_int(pl%Gmass(1:npl), pl%xbeg(:, 1:npl), npl)
call tp%accel_int(param, pl%Gmass(1:npl), pl%xbeg(:, 1:npl), npl)
else
ah0(:) = whm_kick_getacch_ah0(pl%Gmass(1:npl), pl%xend(:, 1:npl), npl)
do concurrent(i = 1:ntp, tp%lmask(i))
tp%ah(:, i) = tp%ah(:, i) + ah0(:)
end do
call tp%accel_int(pl%Gmass(1:npl), pl%xend(:, 1:npl), npl)
call tp%accel_int(param, pl%Gmass(1:npl), pl%xend(:, 1:npl), npl)
end if

if (param%loblatecb) call tp%accel_obl(system)
Expand Down

0 comments on commit 7b784f6

Please sign in to comment.