From fdd2cf9ec24c4860f597152705135594007d3c0b Mon Sep 17 00:00:00 2001 From: David A Minton Date: Wed, 4 Aug 2021 12:33:10 -0400 Subject: [PATCH] Added in template methods for resolving fragmentations and mergers --- src/modules/symba_classes.f90 | 18 +++++++++++++++++- src/symba/symba_collision.f90 | 32 ++++++++++++++++++++++++++++++++ src/symba/symba_discard.f90 | 15 +++++++++++++-- 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index d682020ae..88c973aee 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -142,7 +142,9 @@ module symba_classes !> SyMBA class for tracking pl-pl close encounters in a step type, extends(symba_pltpenc) :: symba_plplenc contains - procedure :: scrub_non_collision => symba_collision_encounter_scrub !! Processes the pl-pl encounter list remove only those encounters that led to a collisio + procedure :: scrub_non_collision => symba_collision_encounter_scrub !! Processes the pl-pl encounter list remove only those encounters that led to a collision + procedure :: resolve_fragmentations => symba_collision_resolve_fragmentations !! Process list of collisions, determine the collisional regime, and then create fragments + procedure :: resolve_mergers => symba_collision_resolve_mergers !! Process list of collisions and merge colliding bodies together end type symba_plplenc !******************************************************************************************************************************** @@ -189,6 +191,20 @@ module subroutine symba_collision_make_family_pl(self,idx) integer(I4B), dimension(2), intent(in) :: idx !! Array holding the indices of the two bodies involved in the collision end subroutine symba_collision_make_family_pl + module subroutine symba_collision_resolve_fragmentations(self, system, param) + implicit none + class(symba_plplenc), intent(inout) :: self !! SyMBA pl-pl encounter list + class(symba_nbody_system), intent(inout) :: system !! SyMBA nbody system object + class(symba_parameters), intent(in) :: param !! Current run configuration parameters with SyMBA additions + end subroutine symba_collision_resolve_fragmentations + + module subroutine symba_collision_resolve_mergers(self, system, param) + implicit none + class(symba_plplenc), intent(inout) :: self !! SyMBA pl-pl encounter list + class(symba_nbody_system), intent(inout) :: system !! SyMBA nbody system object + class(symba_parameters), intent(in) :: param !! Current run configuration parameters with SyMBA additions + end subroutine symba_collision_resolve_mergers + module subroutine symba_discard_pl(self, system, param) use swiftest_classes, only : swiftest_nbody_system, swiftest_parameters implicit none diff --git a/src/symba/symba_collision.f90 b/src/symba/symba_collision.f90 index 739ca9778..11175fe3a 100644 --- a/src/symba/symba_collision.f90 +++ b/src/symba/symba_collision.f90 @@ -272,4 +272,36 @@ module subroutine symba_collision_make_family_pl(self, idx) return end subroutine symba_collision_make_family_pl + + module subroutine symba_collision_resolve_fragmentations(self, system, param) + !! author: David A. Minton + !! + !! Process list of collisions, determine the collisional regime, and then create fragments. + !! + implicit none + ! Arguments + class(symba_plplenc), intent(inout) :: self !! SyMBA pl-pl encounter list + class(symba_nbody_system), intent(inout) :: system !! SyMBA nbody system object + class(symba_parameters), intent(in) :: param !! Current run configuration parameters with SyMBA additions + ! Internals + + return + end subroutine symba_collision_resolve_fragmentations + + + module subroutine symba_collision_resolve_mergers(self, system, param) + !! author: David A. Minton + !! + !! Process list of collisions and merge colliding bodies together. + !! + implicit none + ! Arguments + class(symba_plplenc), intent(inout) :: self !! SyMBA pl-pl encounter list + class(symba_nbody_system), intent(inout) :: system !! SyMBA nbody system object + class(symba_parameters), intent(in) :: param !! Current run configuration parameters with SyMBA additions + ! Internals + + return + end subroutine symba_collision_resolve_mergers + end submodule s_symba_collision \ No newline at end of file diff --git a/src/symba/symba_discard.f90 b/src/symba/symba_discard.f90 index f5e397548..57b26e8ea 100644 --- a/src/symba/symba_discard.f90 +++ b/src/symba/symba_discard.f90 @@ -147,8 +147,19 @@ module subroutine symba_discard_pl(self, system, param) select type(system) class is (symba_nbody_system) - call symba_discard_nonplpl(self, system, param) - call system%plplenc_list%scrub_non_collision(system, param) + select type(param) + class is (symba_parameters) + associate(pl => self, plplenc_list => system%plplenc_list) + call symba_discard_nonplpl(self, system, param) + call plplenc_list%scrub_non_collision(system, param) + call pl%h2b(system%cb) + if (param%lfragmentation) then + call plplenc_list%resolve_fragmentations(system, param) + else + call plplenc_list%resolve_mergers(system, param) + end if + end associate + end select end select return