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

Commit

Permalink
Refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 8, 2022
1 parent 34a8f62 commit 36dc282
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
2 changes: 2 additions & 0 deletions src/modules/fraggle_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ module fraggle_classes
end type fraggle_storage

type, extends(encounter_snapshot) :: fraggle_encounter_snapshot
class(fraggle_colliders), allocatable :: colliders !! Colliders object at this snapshot
class(fraggle_fragments), allocatable :: fragments !! Fragments object at this snapshot
contains
procedure :: write_frame => fraggle_io_encounter_write_frame !! Writes a frame of encounter data to file
final :: fraggle_util_final_snapshot
Expand Down
24 changes: 12 additions & 12 deletions src/modules/symba_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ module symba_classes
!> SyMBA class for tracking pl-tp close encounters in a step
type, extends(symba_encounter) :: symba_pltpenc
contains
procedure :: resolve_collision => symba_collision_resolve_pltpenc !! Process the pl-tp collision list, then modifiy the massive bodies based on the outcome of the c
procedure :: resolve_collision => symba_resolve_collision_pltpenc !! Process the pl-tp collision list, then modifiy the massive bodies based on the outcome of the c
end type symba_pltpenc

!********************************************************************************************************************************
Expand All @@ -174,9 +174,9 @@ module symba_classes
type, extends(symba_encounter) :: symba_plplenc
contains
procedure :: extract_collisions => symba_collision_encounter_extract_collisions !! 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
procedure :: resolve_collision => symba_collision_resolve_plplenc !! Process the pl-pl collision list, then modifiy the massive bodies based on the outcome of the c
procedure :: resolve_fragmentations => symba_resolve_collision_fragmentations !! Process list of collisions, determine the collisional regime, and then create fragments
procedure :: resolve_mergers => symba_resolve_collision_mergers !! Process list of collisions and merge colliding bodies together
procedure :: resolve_collision => symba_resolve_collision_plplenc !! Process the pl-pl collision list, then modifiy the massive bodies based on the outcome of the c
end type symba_plplenc


Expand Down Expand Up @@ -231,39 +231,39 @@ module subroutine symba_collision_make_colliders_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_colliders_pl

module subroutine symba_collision_resolve_fragmentations(self, system, param)
module subroutine symba_resolve_collision_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(inout) :: param !! Current run configuration parameters with SyMBA additions
end subroutine symba_collision_resolve_fragmentations
end subroutine symba_resolve_collision_fragmentations

module subroutine symba_collision_resolve_mergers(self, system, param)
module subroutine symba_resolve_collision_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(inout) :: param !! Current run configuration parameters with SyMBA additions
end subroutine symba_collision_resolve_mergers
end subroutine symba_resolve_collision_mergers

module subroutine symba_collision_resolve_plplenc(self, system, param, t, dt, irec)
module subroutine symba_resolve_collision_plplenc(self, system, param, t, dt, irec)
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(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters with SyMBA additions
real(DP), intent(in) :: t !! Current simulation time
real(DP), intent(in) :: dt !! Current simulation step size
integer(I4B), intent(in) :: irec !! Current recursion level
end subroutine symba_collision_resolve_plplenc
end subroutine symba_resolve_collision_plplenc

module subroutine symba_collision_resolve_pltpenc(self, system, param, t, dt, irec)
module subroutine symba_resolve_collision_pltpenc(self, system, param, t, dt, irec)
implicit none
class(symba_pltpenc), intent(inout) :: self !! SyMBA pl-tp encounter list
class(symba_nbody_system), intent(inout) :: system !! SyMBA nbody system object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters with SyMBA additions
real(DP), intent(in) :: t !! Current simulation time
real(DP), intent(in) :: dt !! Current simulation step size
integer(I4B), intent(in) :: irec !! Current recursion level
end subroutine symba_collision_resolve_pltpenc
end subroutine symba_resolve_collision_pltpenc

module subroutine symba_discard_pl(self, system, param)
use swiftest_classes, only : swiftest_nbody_system, swiftest_parameters
Expand Down
16 changes: 8 additions & 8 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ subroutine symba_collision_mergeaddsub(system, param, colliders, frag, status)
end subroutine symba_collision_mergeaddsub


module subroutine symba_collision_resolve_fragmentations(self, system, param)
module subroutine symba_resolve_collision_fragmentations(self, system, param)
!! author: David A. Minton
!!
!! Process list of collisions, determine the collisional regime, and then create fragments.
Expand Down Expand Up @@ -918,10 +918,10 @@ module subroutine symba_collision_resolve_fragmentations(self, system, param)
end associate

return
end subroutine symba_collision_resolve_fragmentations
end subroutine symba_resolve_collision_fragmentations


module subroutine symba_collision_resolve_mergers(self, system, param)
module subroutine symba_resolve_collision_mergers(self, system, param)
!! author: David A. Minton
!!
!! Process list of collisions and merge colliding bodies together.
Expand Down Expand Up @@ -964,10 +964,10 @@ module subroutine symba_collision_resolve_mergers(self, system, param)
end associate

return
end subroutine symba_collision_resolve_mergers
end subroutine symba_resolve_collision_mergers


module subroutine symba_collision_resolve_plplenc(self, system, param, t, dt, irec)
module subroutine symba_resolve_collision_plplenc(self, system, param, t, dt, irec)
!! author: David A. Minton
!!
!! Process the pl-pl collision list, then modifiy the massive bodies based on the outcome of the collision
Expand Down Expand Up @@ -1051,10 +1051,10 @@ module subroutine symba_collision_resolve_plplenc(self, system, param, t, dt, ir
end associate

return
end subroutine symba_collision_resolve_plplenc
end subroutine symba_resolve_collision_plplenc


module subroutine symba_collision_resolve_pltpenc(self, system, param, t, dt, irec)
module subroutine symba_resolve_collision_pltpenc(self, system, param, t, dt, irec)
!! author: David A. Minton
!!
!! Process the pl-tp collision list, then modifiy the massive bodies based on the outcome of the collision
Expand All @@ -1078,6 +1078,6 @@ module subroutine symba_collision_resolve_pltpenc(self, system, param, t, dt, ir
call system%tp%discard(system, param)

return
end subroutine symba_collision_resolve_pltpenc
end subroutine symba_resolve_collision_pltpenc

end submodule s_symba_collision

0 comments on commit 36dc282

Please sign in to comment.