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

Commit

Permalink
Browse files Browse the repository at this point in the history
Use unit vector instead of radius vector
  • Loading branch information
daminton committed May 12, 2021
1 parent ed89188 commit 2027b43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/symba/symba_frag_pos.f90
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function symba_frag_pos_fragment_velocity(nfrag, m_frag, x_frag, v_r_unit, Lambd
v_r_mag_01(:) = v_r_mag(1:4)
! The secant method requires two guesses, so we will use a small random variate to update the initial guesses
call random_number(v_r_mag_02(:))
v_r_mag_02(:) = v_r_mag_01 * (1._DP + 2e-2_DP * (v_r_mag_02 - 0.5_DP))
v_r_mag_02(:) = v_r_mag_01 * (1._DP + 2e-1_DP * (v_r_mag_02 - 0.5_DP))

! Set up the constant values (those invovling i>4 fragments)
Gam = 0.0_DP
Expand All @@ -429,10 +429,10 @@ function symba_frag_pos_fragment_velocity(nfrag, m_frag, x_frag, v_r_unit, Lambd
f_vec_02(:) = f_vec_const(:)
do i = 1, 4
if (j == 1) then
f_vec_01(1:3) = f_vec_01(1:3) + m_frag(i) * v_r_mag_01(i) * x_frag(:,i)
f_vec_01(1:3) = f_vec_01(1:3) + m_frag(i) * v_r_mag_01(i) * v_r_unit(:, i)
f_vec_01(4) = f_vec_01(4) + m_frag(i) * v_r_mag_01(i)**2
end if
f_vec_02(1:3) = f_vec_02(1:3) + m_frag(i) * v_r_mag_02(i) * x_frag(:,i)
f_vec_02(1:3) = f_vec_02(1:3) + m_frag(i) * v_r_mag_02(i) * v_r_unit(:,i)
f_vec_02(4) = f_vec_02(4) + m_frag(i) * v_r_mag_02(i)**2
end do

Expand Down

0 comments on commit 2027b43

Please sign in to comment.