diff --git a/Makefile b/Makefile index c1945c17a..a49f80756 100644 --- a/Makefile +++ b/Makefile @@ -152,6 +152,11 @@ lib: ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \ ln -s $(SWIFTEST_HOME)/Makefile .; \ make libdir + cd $(SWIFTEST_HOME)/src/symba; \ + rm -f Makefile.Defines Makefile; \ + ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \ + ln -s $(SWIFTEST_HOME)/Makefile .; \ + make libdir cd $(SWIFTEST_HOME)/src/user; \ rm -f Makefile.Defines Makefile; \ ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \ @@ -197,6 +202,7 @@ clean: cd $(SWIFTEST_HOME)/src/orbel; rm -f Makefile.Defines Makefile *.gc* cd $(SWIFTEST_HOME)/src/rmvs; rm -f Makefile.Defines Makefile *.gc* cd $(SWIFTEST_HOME)/src/setup; rm -f Makefile.Defines Makefile *.gc* + cd $(SWIFTEST_HOME)/src/symba; rm -f Makefile.Defines Makefile *.gc* cd $(SWIFTEST_HOME)/src/user; rm -f Makefile.Defines Makefile *.gc* cd $(SWIFTEST_HOME)/src/util; rm -f Makefile.Defines Makefile *.gc* cd $(SWIFTEST_HOME)/src/whm; rm -f Makefile.Defines Makefile *.gc* diff --git a/src/modules/rmvs_classes.f90 b/src/modules/rmvs_classes.f90 index 2baad04eb..5e1d69437 100644 --- a/src/modules/rmvs_classes.f90 +++ b/src/modules/rmvs_classes.f90 @@ -66,6 +66,7 @@ module rmvs_classes integer(I4B) :: ipleP !! index value of encountering planet logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations contains + private procedure, public :: discard => rmvs_discard_tp !! Check to see if test particles should be discarded based on pericenter passage distances with respect to planets encountered procedure, public :: encounter_check => rmvs_encounter_check_tp !! Checks if any test particles are undergoing a close encounter with a massive body procedure, public :: fill => rmvs_fill_tp !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) @@ -89,6 +90,7 @@ module rmvs_classes class(rmvs_nbody_system), dimension(:), allocatable :: planetocentric logical :: lplanetocentric = .false. !! Flag that indicates that the object is a planetocentric set of masive bodies used for close encounter calculations contains + private procedure, public :: fill => rmvs_fill_pl !! "Fills" bodies from one object into another depending on the results of a mask (uses the MERGE intrinsic) procedure, public :: setup => rmvs_setup_pl !! Constructor method - Allocates space for number of particles procedure, public :: spill => rmvs_spill_pl !! "Spills" bodies from one object to another depending on the results of a mask (uses the PACK intrinsic) diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index 2aadd86e0..14cf7c7b2 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -24,6 +24,7 @@ module symba_classes !> Helio central body particle class type, public, extends(helio_cb) :: symba_cb contains + private end type symba_cb !******************************************************************************************************************************** @@ -33,6 +34,9 @@ module symba_classes !! Helio massive body particle class type, public, extends(helio_pl) :: symba_pl contains + private + procedure, public :: discard => symba_discard_pl !! Process massive body discards + procedure, public :: encounter_check => symba_encounter_check_pl !! Checks if massive bodies are going through close encounters with each other end type symba_pl !******************************************************************************************************************************** @@ -42,9 +46,44 @@ module symba_classes !! Helio test particle class type, public, extends(helio_tp) :: symba_tp contains + private + procedure, public :: discard => symba_discard_tp !! process test particle discards + procedure, public :: encounter_check => symba_encounter_check_tp !! Checks if any test particles are undergoing a close encounter with a massive body end type symba_tp interface + module subroutine symba_discard_pl(self, system, param) + use swiftest_classes, only : swiftest_nbody_system, swiftest_parameters + implicit none + class(symba_pl), intent(inout) :: self !! RMVS test particle object + class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object + class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters + end subroutine symba_discard_pl + + module subroutine symba_discard_tp(self, system, param) + use swiftest_classes, only : swiftest_nbody_system, swiftest_parameters + implicit none + class(symba_tp), intent(inout) :: self !! RMVS test particle object + class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object + class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters + end subroutine symba_discard_tp + + module function symba_encounter_check_pl(self, system, dt) result(lencounter) + implicit none + class(symba_pl), intent(inout) :: self !! RMVS test particle object + class(symba_nbody_system), intent(inout) :: system !! RMVS nbody system object + real(DP), intent(in) :: dt !! step size + logical :: lencounter !! Returns true if there is at least one close encounter + end function symba_encounter_check_pl + + module function symba_encounter_check_tp(self, system, dt) result(lencounter) + implicit none + class(symba_tp), intent(inout) :: self !! RMVS test particle object + class(symba_nbody_system), intent(inout) :: system !! RMVS nbody system object + real(DP), intent(in) :: dt !! step size + logical :: lencounter !! Returns true if there is at least one close encounter + end function symba_encounter_check_tp + module subroutine symba_step_system(self, param, t, dt) use swiftest_classes, only : swiftest_parameters implicit none diff --git a/src/symba/symba_step.f90 b/src/symba/symba_step.f90 index d3b189bfa..10e8938db 100644 --- a/src/symba/symba_step.f90 +++ b/src/symba/symba_step.f90 @@ -22,9 +22,7 @@ module subroutine symba_step_system(self, param, t, dt) class is (symba_pl) select type(tp => self%tp) class is (symba_tp) - lencounter_pl = pl%encounter_check(system, dt) - lencounter_tp = tp%encounter_check(system, dt) - lencounter = lencounter_pl .or. lencounter_tp + lencounter = pl%encounter_check(self, dt) .or. tp%encounter_check(self, dt) if (lencounter) then call self%interp(param, t, dt) else