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

Commit

Permalink
Fixed bug that prevented pure hit and runs from being recorded proper…
Browse files Browse the repository at this point in the history
…ly in the collision snapshot
  • Loading branch information
daminton committed Dec 15, 2022
1 parent caf0300 commit bab38bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/Fragmentation/swiftest_fragmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
# Do the same as above for the hit and run case.
sim_hitandrun = swiftest.Simulation(simdir="hitandrun", **run_arguments)
sim_hitandrun.add_solar_system_body(["Sun"])
sim_hitandrun.add_body(name="Target", rh=[1.0, -4.2e-05, 0.0], vh=[[0.0, 6.28, 0.0]], Gmass=1e-7, radius=7e-6, rot=[0.0, 0.0, 6.0e4])
sim_hitandrun.add_body(name="Target", rh=[1.0, -4.2e-05, 0.0], vh=[0.0, 6.28, 0.0], Gmass=1e-7, radius=7e-6, rot=[0.0, 0.0, 6.0e4])
sim_hitandrun.add_body(name="Projectile", rh=[1.0, 4.2e-05, 0.0], vh=[-1.5, -6.28, 0.0], Gmass=7e-10, radius=3.25e-6, rot=[0.0, 0.0, 1.0e5])
sim_hitandrun.get_parameter()
sim_hitandrun.run()
Expand Down
1 change: 1 addition & 0 deletions src/symba/symba_collision.f90
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ module function symba_collision_casehitandrun(system, param, t) result(status)
pl%ldiscard(colliders%idx(:)) = .false.
pl%lcollision(colliders%idx(:)) = .false.
end select
allocate(system%fragments%pl, source=system%colliders%pl) ! Be sure to save the pl so that snapshots still work
else
ibiggest = colliders%idx(maxloc(system%pl%Gmass(colliders%idx(:)), dim=1))
fragments%id(1) = system%pl%id(ibiggest)
Expand Down

0 comments on commit bab38bb

Please sign in to comment.