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

Commit

Permalink
Added in template methods for resolving fragmentations and mergers
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 4, 2021
1 parent 15c1d9c commit fdd2cf9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 3 deletions.
18 changes: 17 additions & 1 deletion src/modules/symba_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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

!********************************************************************************************************************************
Expand Down Expand Up @@ -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
Expand Down
32 changes: 32 additions & 0 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 13 additions & 2 deletions src/symba/symba_discard.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fdd2cf9

Please sign in to comment.