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

Commit

Permalink
Added a check in the system mass calcualtion to cover the case where …
Browse files Browse the repository at this point in the history
…there are no massive bodies other than the central body.
  • Loading branch information
daminton committed Nov 29, 2023
1 parent 56cc5cb commit c94c828
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/swiftest/swiftest_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,9 @@ module subroutine swiftest_util_set_msys(self)
! Arguments
class(swiftest_nbody_system), intent(inout) :: self !! Swiftest nobdy nbody_system object

self%Gmtot = self%cb%Gmass + sum(self%pl%Gmass(1:self%pl%nbody), self%pl%status(1:self%pl%nbody) /= INACTIVE)
self%Gmtot = self%cb%Gmass
if (self%pl%nbody > 0) self%Gmtot = self%Gmtot + sum(self%pl%Gmass(1:self%pl%nbody), &
self%pl%status(1:self%pl%nbody) /= INACTIVE)

return
end subroutine swiftest_util_set_msys
Expand Down

0 comments on commit c94c828

Please sign in to comment.