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

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 21, 2022
1 parent 530b1bd commit 55f499f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/collision/collision_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ module subroutine collision_check_pltp(self, system, param, t, dt, irec, lany_co
integer(I4B), intent(in) :: irec !! Current recursion level
logical, intent(out) :: lany_collision !! Returns true if any pair of encounters resulted in a collision
end subroutine collision_check_pltp

module subroutine collision_resolve_collider_message(pl, collidx, collider_message)
implicit none
class(base_object), intent(in) :: pl !! Swiftest massive body object
integer(I4B), dimension(:), intent(in) :: collidx !! Index of collisional impactors%id members
character(*), intent(inout) :: collider_message !! The message to print to the screen.
end subroutine collision_resolve_collider_message

module subroutine collision_resolve_extract_plpl(self, system, param)
implicit none
Expand Down Expand Up @@ -277,6 +284,8 @@ module function collision_resolve_merge(system, param, t) result(status)
end function collision_resolve_merge




module subroutine collision_resolve_plpl(self, system, param, t, dt, irec)
implicit none
class(collision_list_plpl), intent(inout) :: self !! pl-pl encounter list
Expand Down
19 changes: 11 additions & 8 deletions src/collision/collision_resolve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ module function collision_resolve_merge(system, param, t) result(status)
end function collision_resolve_merge


subroutine collision_resolve_collider_message(pl, collidx, collider_message)
module subroutine collision_resolve_collider_message(pl, collidx, collider_message)
!! author: David A. Minton
!!
!! Prints a nicely formatted message about which bodies collided, including their names and ids.
!! This subroutine appends the body names and ids to an input message.
implicit none
! Arguments
class(swiftest_pl), intent(in) :: pl !! Swiftest massive body object
class(base_object), intent(in) :: pl !! Swiftest massive body object
integer(I4B), dimension(:), intent(in) :: collidx !! Index of collisional impactors%id members
character(*), intent(inout) :: collider_message !! The message to print to the screen.
! Internals
Expand All @@ -115,12 +115,15 @@ subroutine collision_resolve_collider_message(pl, collidx, collider_message)
n = size(collidx)
if (n == 0) return

do i = 1, n
if (i > 1) collider_message = trim(adjustl(collider_message)) // " and "
collider_message = " " // trim(adjustl(collider_message)) // " " // trim(adjustl(pl%info(collidx(i))%name))
write(idstr, '(I10)') pl%id(collidx(i))
collider_message = trim(adjustl(collider_message)) // " (" // trim(adjustl(idstr)) // ") "
end do
select type(pl)
class is (swiftest_pl)
do i = 1, n
if (i > 1) collider_message = trim(adjustl(collider_message)) // " and "
collider_message = " " // trim(adjustl(collider_message)) // " " // trim(adjustl(pl%info(collidx(i))%name))
write(idstr, '(I10)') pl%id(collidx(i))
collider_message = trim(adjustl(collider_message)) // " (" // trim(adjustl(idstr)) // ") "
end do
end select

return
end subroutine collision_resolve_collider_message
Expand Down

0 comments on commit 55f499f

Please sign in to comment.