1
0
Fork 0
mirror of https://github.com/Findus23/rebound-collisions.git synced 2024-09-19 15:53:48 +02:00

don't repeat last step of save

This commit is contained in:
Lukas Winkler 2021-02-11 14:39:56 +01:00
parent 409a5128b0
commit 5e77a1d061
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -141,8 +141,8 @@ def main(fn: Path, testrun=False):
extradata = ExtraData.load(fn)
tmax = extradata.meta.tmax
per_savestep = extradata.meta.per_savestep
t = extradata.meta.current_time - per_savestep
sim = sa.getSimulation(t=t)
t = extradata.meta.current_time
sim = sa.getSimulation(t=t - per_savestep)
sim.move_to_com()
sim.ri_mercurius.recalculate_coordinates_this_timestep = 1
sim.integrator_synchronize()
@ -200,6 +200,9 @@ def main(fn: Path, testrun=False):
print("N", sim.N)
print("N_active", sim.N_active)
print("fraction", innermost_period(sim) / MIN_TIMESTEP_PER_ORBIT)
assert sim.dt < innermost_period(sim) / MIN_TIMESTEP_PER_ORBIT
escape: hb_event
sun_collision: hb_event
for escape in hb_event_list.in_dll(clibheartbeat, "hb_escapes"):
@ -230,9 +233,8 @@ def main(fn: Path, testrun=False):
N_active=sim.N_active
)
extradata.save(fn)
print("fraction", innermost_period(sim) / MIN_TIMESTEP_PER_ORBIT)
assert sim.dt < innermost_period(sim) / MIN_TIMESTEP_PER_ORBIT
if abort:
print("aborted")
exit(1)
print("finished")
fn.with_suffix(".lock").unlink()