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

Commit

Permalink
Moved impactor rotation calculation into the set_scale_factors instea…
Browse files Browse the repository at this point in the history
…d of the restore_scale_factors where it was by mistake
  • Loading branch information
daminton committed Jun 11, 2021
1 parent 6d7bf11 commit fc6b94a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/symba/symba_frag_pos.f90
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ subroutine set_scale_factors()
!! Scales dimenional quantities to ~O(1) with respect to the collisional system. This scaling makes it easier for the non-linear minimization
!! to converge on a solution
implicit none
integer(I4B) :: i

! Find the center of mass of the collisional system
mtot = sum(mass(:))
Expand All @@ -185,6 +186,9 @@ subroutine set_scale_factors()
x = x / rscale
v = v / vscale
L_spin = L_spin / Lscale
do i = 1, 2
rot(:,i) = L_spin(:,i) / (mass(i) * radius(i)**2 * Ip(3, i))
end do

m_frag = m_frag / mscale
rad_frag = rad_frag / rscale
Expand All @@ -208,9 +212,7 @@ subroutine restore_scale_factors()
x = x * rscale
v = v * vscale
L_spin = L_spin * Lscale
do i = 1, 2
rot(:,i) = L_spin(:,i) / (mass(i) * radius(i)**2 * Ip(3, i))
end do
rot = rot / tscale

! Avoid FP exceptions
x_frag(:,1:nfrag) = x_frag(:,1:nfrag) * rscale
Expand Down

0 comments on commit fc6b94a

Please sign in to comment.