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

Commit

Permalink
Rearranged snapshot taking for collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 10, 2022
1 parent 4d2fb37 commit f1387ba
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/symba/symba_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1299,16 +1299,14 @@ module subroutine symba_util_take_collision_snapshot(self, param, t, stage)
real(DP), intent(in) :: t !! current time
character(*), intent(in) :: stage !! Either before or after
! Arguments
class(fraggle_collision_snapshot), allocatable :: snapshot
class(fraggle_collision_snapshot), allocatable:: snapshot
integer(I4B) :: i,j

select case(stage)
case("before")
associate (idx => self%colliders%idx, ncoll => self%colliders%ncoll)
allocate(fraggle_collision_snapshot :: snapshot)
allocate(snapshot%colliders, source=self%colliders)
allocate(symba_pl :: snapshot%colliders%pl)
select type(pl => snapshot%colliders%pl)
allocate(symba_pl :: self%colliders%pl)
select type(pl => self%colliders%pl)
class is (symba_pl)
call pl%setup(ncoll, param)
pl%id(:) = self%pl%id(idx(:))
Expand All @@ -1321,14 +1319,14 @@ module subroutine symba_util_take_collision_snapshot(self, param, t, stage)
pl%info(:) = self%pl%info(idx(:))
end select
end associate

case("after")
allocate(snapshot%fragments, source=self%fragments)
allocate(fraggle_collision_snapshot :: snapshot)
allocate(snapshot%colliders, source=self%colliders)
allocate(snapshot%fragments, source=self%fragments)
!call symba_util_save_storage(self,snapshot,t)
deallocate(snapshot)
end select


! Save the snapshot
!call symba_util_save_storage(self,snapshot,t)
return
end subroutine symba_util_take_collision_snapshot

Expand Down

0 comments on commit f1387ba

Please sign in to comment.