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

Commit

Permalink
Got rid of unnecessary variable for keeping track of lost body energy
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed May 21, 2021
1 parent 88610dc commit 14fd184
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/symba/symba_discard_conserve_mtm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ subroutine symba_discard_conserve_mtm(param, swiftest_plA, ipl, lescape)
! Add the potential and kinetic energy of the lost body to the records
pe = -mass(1) * mass(ipl) / norm2(xb(:, ipl) - xb(:, 1))
ke = 0.5_DP * mass(ipl) * dot_product(vb(:, ipl), vb(:, ipl))
swiftest_plA%Elost_bodies = swiftest_plA%Elost_bodies + pe + ke
swiftest_plA%Mescape = swiftest_plA%Mescape + mass(ipl)
else
! Add the potential energy of the lost body to the records
pe = -mass(1) * mass(ipl) / norm2(xb(:, ipl) - xb(:, 1))
ke = 0.0_DP
swiftest_plA%Elost_bodies = swiftest_plA%Elost_bodies + pe
swiftest_plA%dMcb = swiftest_plA%dMcb + mass(ipl)
swiftest_plA%dRcb = swiftest_plA%dRcb + 1.0_DP / 3.0_DP * (radius(ipl) / radius(1))**3 - 2.0_DP / 9.0_DP * (radius(ipl) / radius(1))**6
! Update mass of central body to be consistent with its total mass
Expand Down

0 comments on commit 14fd184

Please sign in to comment.