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

Commit

Permalink
Pulled the final momentum calc for the colliders out of the consolida…
Browse files Browse the repository at this point in the history
…tion loop where it didn't belong
  • Loading branch information
daminton committed Oct 21, 2022
1 parent b4dabe6 commit cd31bf3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -549,17 +549,17 @@ function symba_collision_consolidate_colliders(pl, cb, param, idx_parent, collid
density(j) = colliders%mass(j) / volume(j)
colliders%radius(j) = (3 * volume(j) / (4 * PI))**(1.0_DP / 3.0_DP)
if (param%lrotation) colliders%Ip(:, j) = colliders%Ip(:, j) / colliders%mass(j)

xcom(:) = (colliders%mass(1) * colliders%xb(:, 1) + colliders%mass(2) * colliders%xb(:, 2)) / sum(colliders%mass(:))
vcom(:) = (colliders%mass(1) * colliders%vb(:, 1) + colliders%mass(2) * colliders%vb(:, 2)) / sum(colliders%mass(:))
mxc(:, 1) = colliders%mass(1) * (colliders%xb(:, 1) - xcom(:))
mxc(:, 2) = colliders%mass(2) * (colliders%xb(:, 2) - xcom(:))
vcc(:, 1) = colliders%vb(:, 1) - vcom(:)
vcc(:, 2) = colliders%vb(:, 2) - vcom(:)
colliders%L_orbit(:,:) = mxc(:,:) .cross. vcc(:,:)
end do
lflag = .true.

xcom(:) = (colliders%mass(1) * colliders%xb(:, 1) + colliders%mass(2) * colliders%xb(:, 2)) / sum(colliders%mass(:))
vcom(:) = (colliders%mass(1) * colliders%vb(:, 1) + colliders%mass(2) * colliders%vb(:, 2)) / sum(colliders%mass(:))
mxc(:, 1) = colliders%mass(1) * (colliders%xb(:, 1) - xcom(:))
mxc(:, 2) = colliders%mass(2) * (colliders%xb(:, 2) - xcom(:))
vcc(:, 1) = colliders%vb(:, 1) - vcom(:)
vcc(:, 2) = colliders%vb(:, 2) - vcom(:)
colliders%L_orbit(:,:) = mxc(:,:) .cross. vcc(:,:)

! Destroy the kinship relationships for all members of this colliders%idx
call pl%reset_kinship(colliders%idx(:))

Expand Down

0 comments on commit cd31bf3

Please sign in to comment.