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

Commit

Permalink
Moved the fragment total mass and barycenter calculations outside of …
Browse files Browse the repository at this point in the history
…the regime determination, as that does not get run when fragmentation is turned off
  • Loading branch information
daminton committed Sep 3, 2021
1 parent c0a21aa commit e5ee63d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/fraggle/fraggle_regime.f90
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ module subroutine fraggle_regime_colliders(self, frag, system, param)
! Convert quantities back to the system units and save them into the fragment system
frag%mass_dist(:) = (frag%mass_dist(:) / param%MU2KG)
frag%Qloss = frag%Qloss * (param%TU2S / param%DU2M)**2 / param%MU2KG
frag%mtot = sum(colliders%mass(:))
frag%xbcom(:) = (colliders%mass(1) * colliders%xb(:,1) + colliders%mass(2) * colliders%xb(:,2)) / frag%mtot
frag%vbcom(:) = (colliders%mass(1) * colliders%vb(:,1) + colliders%mass(2) * colliders%vb(:,2)) / frag%mtot

call fraggle_io_log_regime(colliders, frag)
end associate
Expand Down
6 changes: 6 additions & 0 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,9 @@ module subroutine symba_collision_resolve_fragmentations(self, system, param)
if ((.not. lgoodcollision) .or. any(pl%status(idx_parent(:)) /= COLLISION)) cycle

call colliders%regime(frag, system, param)
frag%mtot = sum(colliders%mass(:))
frag%xbcom(:) = (colliders%mass(1) * colliders%xb(:,1) + colliders%mass(2) * colliders%xb(:,2)) / frag%mtot
frag%vbcom(:) = (colliders%mass(1) * colliders%vb(:,1) + colliders%mass(2) * colliders%vb(:,2)) / frag%mtot

select case (frag%regime)
case (COLLRESOLVE_REGIME_DISRUPTION, COLLRESOLVE_REGIME_SUPERCATASTROPHIC)
Expand Down Expand Up @@ -941,6 +944,9 @@ module subroutine symba_collision_resolve_mergers(self, system, param)
if (any(pl%status(idx_parent(:)) /= COLLISION)) cycle ! One of these two bodies has already been resolved

frag%regime = COLLRESOLVE_REGIME_MERGE
frag%mtot = sum(colliders%mass(:))
frag%xbcom(:) = (colliders%mass(1) * colliders%xb(:,1) + colliders%mass(2) * colliders%xb(:,2)) / frag%mtot
frag%vbcom(:) = (colliders%mass(1) * colliders%vb(:,1) + colliders%mass(2) * colliders%vb(:,2)) / frag%mtot
plplcollision_list%status(i) = symba_collision_casemerge(system, param, colliders, frag)
end do
end select
Expand Down

0 comments on commit e5ee63d

Please sign in to comment.