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:
parent
409a5128b0
commit
5e77a1d061
1 changed files with 6 additions and 4 deletions
10
water_sim.py
10
water_sim.py
|
@ -141,8 +141,8 @@ def main(fn: Path, testrun=False):
|
||||||
extradata = ExtraData.load(fn)
|
extradata = ExtraData.load(fn)
|
||||||
tmax = extradata.meta.tmax
|
tmax = extradata.meta.tmax
|
||||||
per_savestep = extradata.meta.per_savestep
|
per_savestep = extradata.meta.per_savestep
|
||||||
t = extradata.meta.current_time - per_savestep
|
t = extradata.meta.current_time
|
||||||
sim = sa.getSimulation(t=t)
|
sim = sa.getSimulation(t=t - per_savestep)
|
||||||
sim.move_to_com()
|
sim.move_to_com()
|
||||||
sim.ri_mercurius.recalculate_coordinates_this_timestep = 1
|
sim.ri_mercurius.recalculate_coordinates_this_timestep = 1
|
||||||
sim.integrator_synchronize()
|
sim.integrator_synchronize()
|
||||||
|
@ -200,6 +200,9 @@ def main(fn: Path, testrun=False):
|
||||||
print("N", sim.N)
|
print("N", sim.N)
|
||||||
print("N_active", sim.N_active)
|
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
|
escape: hb_event
|
||||||
sun_collision: hb_event
|
sun_collision: hb_event
|
||||||
for escape in hb_event_list.in_dll(clibheartbeat, "hb_escapes"):
|
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
|
N_active=sim.N_active
|
||||||
)
|
)
|
||||||
extradata.save(fn)
|
extradata.save(fn)
|
||||||
print("fraction", innermost_period(sim) / MIN_TIMESTEP_PER_ORBIT)
|
|
||||||
assert sim.dt < innermost_period(sim) / MIN_TIMESTEP_PER_ORBIT
|
|
||||||
if abort:
|
if abort:
|
||||||
|
print("aborted")
|
||||||
exit(1)
|
exit(1)
|
||||||
print("finished")
|
print("finished")
|
||||||
fn.with_suffix(".lock").unlink()
|
fn.with_suffix(".lock").unlink()
|
||||||
|
|
Loading…
Reference in a new issue