diff --git a/examples/main.c b/examples/main.c index d736d0b63ae33177f6e98ce545ab86b06497787b..2150e36abb449e9296ad0c1d6069b292414f14e3 100644 --- a/examples/main.c +++ b/examples/main.c @@ -883,6 +883,9 @@ int main(int argc, char *argv[]) { /* Write the state of the system before starting time integration. */ engine_dump_snapshot(&e); engine_print_stats(&e); + + /* Call VELOCIraptor for the first time after the first snapshot dump. */ + if (e.policy & engine_policy_structure_finding) velociraptor_invoke(&e); } diff --git a/src/engine.c b/src/engine.c index 4949534ac7bd42183bab0c37319894310c675443..62b90bf8e8d94ebd8f057f2c08ca02b3e9911f28 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4347,9 +4347,6 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs, space_init_parts(s, e->verbose); space_init_gparts(s, e->verbose); - /* Call VELOCIraptor before first step and before velocities are kicked. */ - if (e->policy & engine_policy_structure_finding) velociraptor_invoke(e); - /* Now, launch the calculation */ TIMER_TIC; engine_launch(e); @@ -4648,7 +4645,7 @@ void engine_step(struct engine *e) { /* Drift everybody (i.e. what has not yet been drifted) */ /* to the current time */ int drifted_all = - (e->dump_snapshot || e->forcerebuild || e->forcerepart || e->save_stats); + (e->dump_snapshot || e->forcerebuild || e->forcerepart || e->save_stats || e->run_stf); if (drifted_all) engine_drift_all(e); /* Write a snapshot ? */