From 127e73609141830997735c874f1bbca571ed6287 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 8 Dec 2022 18:18:20 -0500 Subject: [PATCH] Added collision detection logicals to encounter list so that the collision stuff can get saved to the snapshot --- src/modules/encounter_classes.f90 | 25 +++++++++++++------------ src/symba/symba_step.f90 | 5 +++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/modules/encounter_classes.f90 b/src/modules/encounter_classes.f90 index 3329fde02..8bc1e00b7 100644 --- a/src/modules/encounter_classes.f90 +++ b/src/modules/encounter_classes.f90 @@ -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 diff --git a/src/symba/symba_step.f90 b/src/symba/symba_step.f90 index 0b8879464..cf2b819e7 100644 --- a/src/symba/symba_step.f90 +++ b/src/symba/symba_step.f90 @@ -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)