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

Commit

Permalink
Added collision detection logicals to encounter list so that the coll…
Browse files Browse the repository at this point in the history
…ision stuff can get saved to the snapshot
  • Loading branch information
daminton committed Dec 8, 2022
1 parent fb2a95e commit 127e736
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
25 changes: 13 additions & 12 deletions src/modules/encounter_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ module encounter_classes
integer(I4B), parameter :: SWEEPDIM = 3

type :: encounter_list
integer(I8B) :: nenc = 0 !! Total number of encounters
real(DP) :: t !! Time of encounter
logical, dimension(:), allocatable :: lvdotr !! relative vdotr flag
integer(I4B), dimension(:), allocatable :: status !! status of the interaction
integer(I4B), dimension(:), allocatable :: index1 !! position of the first body in the encounter
integer(I4B), dimension(:), allocatable :: index2 !! position of the second body in the encounter
integer(I4B), dimension(:), allocatable :: id1 !! id of the first body in the encounter
integer(I4B), dimension(:), allocatable :: id2 !! id of the second body in the encounter
real(DP), dimension(:,:), allocatable :: x1 !! the position of body 1 in the encounter
real(DP), dimension(:,:), allocatable :: x2 !! the position of body 2 in the encounter
real(DP), dimension(:,:), allocatable :: v1 !! the velocity of body 1 in the encounter
real(DP), dimension(:,:), allocatable :: v2 !! the velocity of body 2 in the encounter
integer(I8B) :: nenc = 0 !! Total number of encounters
logical :: lcollision !! Indicates if the encounter resulted in at least one collision
real(DP) :: t !! Time of encounter
logical, dimension(:), allocatable :: lvdotr !! relative vdotr flag
integer(I4B), dimension(:), allocatable :: status !! status of the interaction
integer(I4B), dimension(:), allocatable :: index1 !! position of the first body in the encounter
integer(I4B), dimension(:), allocatable :: index2 !! position of the second body in the encounter
integer(I4B), dimension(:), allocatable :: id1 !! id of the first body in the encounter
integer(I4B), dimension(:), allocatable :: id2 !! id of the second body in the encounter
real(DP), dimension(:,:), allocatable :: x1 !! the position of body 1 in the encounter
real(DP), dimension(:,:), allocatable :: x2 !! the position of body 2 in the encounter
real(DP), dimension(:,:), allocatable :: v1 !! the velocity of body 1 in the encounter
real(DP), dimension(:,:), allocatable :: v2 !! the velocity of body 2 in the encounter
contains
procedure :: setup => encounter_setup_list !! A constructor that sets the number of encounters and allocates and initializes all arrays
procedure :: append => encounter_util_append_list !! Appends elements from one structure to another
Expand Down
5 changes: 3 additions & 2 deletions src/symba/symba_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ recursive module subroutine symba_step_recur_system(self, param, t, ireci)
! Internals
integer(I4B) :: j, irecp, nloops
real(DP) :: dtl, dth
logical :: lencounter, lplpl_collision, lpltp_collision
logical :: lencounter

associate(system => self, plplenc_list => self%plplenc_list, pltpenc_list => self%pltpenc_list)
associate(system => self, plplenc_list => self%plplenc_list, pltpenc_list => self%pltpenc_list, &
lplpl_collision => self%plplenc_list%lcollision, lpltp_collision => self%pltpenc_list%lcollision)
select type(param)
class is (symba_parameters)
select type(pl => self%pl)
Expand Down

0 comments on commit 127e736

Please sign in to comment.