diff --git a/examples/EAGLE_25/eagle_25.yml b/examples/EAGLE_25/eagle_25.yml index 01b58cf115bd3423aaecff80a05422cae64517d0..30567bd25b133d19b70a052fe12612aace394c12 100644 --- a/examples/EAGLE_25/eagle_25.yml +++ b/examples/EAGLE_25/eagle_25.yml @@ -14,7 +14,7 @@ StructureFinding: scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. - delta_time: 1e-4 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. + delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters Cosmology: diff --git a/examples/EAGLE_6/eagle_6.yml b/examples/EAGLE_6/eagle_6.yml index bd456d083404a7ff78da6543ed26fe9e15e06677..aae25e360ade00bab6613f0809b47cf7b8043717 100644 --- a/examples/EAGLE_6/eagle_6.yml +++ b/examples/EAGLE_6/eagle_6.yml @@ -14,7 +14,7 @@ StructureFinding: scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. - delta_time: 1e-4 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. + delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters Cosmology: diff --git a/examples/SmallCosmoVolume/small_cosmo_volume.yml b/examples/SmallCosmoVolume/small_cosmo_volume.yml index db00e6c2e5310e5761677eda99131aa91e31b904..fad6d122a7fed544825684d8d9111c104d25f058 100644 --- a/examples/SmallCosmoVolume/small_cosmo_volume.yml +++ b/examples/SmallCosmoVolume/small_cosmo_volume.yml @@ -14,7 +14,7 @@ StructureFinding: scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. - delta_time: 1e-4 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. + delta_time: 1.02 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # WMAP9 cosmology Cosmology: diff --git a/src/engine.c b/src/engine.c index 62cbcb51a2963f932b0906230c01b5ee23b56913..32157c0564f0411daa09f27cf77300d3060fac15 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4780,7 +4780,7 @@ void engine_step(struct engine *e) { /* Do we want to perform structure finding? */ if ((e->policy & engine_policy_structure_finding)) { - if(e->stf_output_freq_format == STEPS && e->step%(int)e->deltaTimeSTF == 0) + if(e->stf_output_freq_format == STEPS && e->step%e->deltaStepSTF == 0) e->run_stf = 1; else if(e->stf_output_freq_format == TIME && e->ti_end_min >= e->ti_nextSTF && e->ti_nextSTF > 0) e->run_stf = 1; @@ -5791,6 +5791,7 @@ void engine_config(int restart, struct engine *e, struct swift_params *params, e->restart_dt = 0; e->timeFirstSTFOutput = 0; e->deltaTimeSTF = 0; + e->deltaStepSTF = 0; e->stf_output_freq_format = 0; e->ti_nextSTF = 0; e->run_stf = 0; @@ -5804,7 +5805,7 @@ void engine_config(int restart, struct engine *e, struct swift_params *params, //velociraptor_init(e); e->stf_output_freq_format = parser_get_param_int(params, "StructureFinding:output_time_format"); if(e->stf_output_freq_format == STEPS) { - e->deltaTimeSTF = parser_get_param_int(params, "StructureFinding:delta_step"); + e->deltaStepSTF = parser_get_param_int(params, "StructureFinding:delta_step"); } else if(e->stf_output_freq_format == TIME) { e->deltaTimeSTF = parser_get_param_double(params, "StructureFinding:delta_time"); @@ -6089,9 +6090,10 @@ void engine_config(int restart, struct engine *e, struct swift_params *params, "simulation start a=%e.", e->a_first_statistics, e->cosmology->a_begin); - if (e->policy & engine_policy_structure_finding) { + if ((e->policy & engine_policy_structure_finding) && (e->stf_output_freq_format == TIME)) { + if (e->deltaTimeSTF <= 1.) - error("Time between snapshots (%e) must be > 1.", e->deltaTimeSTF); + error("Time between STF (%e) must be > 1.", e->deltaTimeSTF); if (e->a_first_stf < e->cosmology->a_begin) error( @@ -6122,7 +6124,7 @@ void engine_config(int restart, struct engine *e, struct swift_params *params, "t=%e.", e->time_first_statistics, e->time_begin); - if (e->policy & engine_policy_structure_finding) { + if ((e->policy & engine_policy_structure_finding) && (e->stf_output_freq_format == TIME)) { if (e->deltaTimeSTF <= 0.) error("Time between STF (%e) must be positive.", diff --git a/src/engine.h b/src/engine.h index 1b8b223b49674c6b451e4e278157af74af2df579..38e8fe61909655f66c5ba56bcfca05880c2f7c59 100644 --- a/src/engine.h +++ b/src/engine.h @@ -227,6 +227,7 @@ struct engine { double a_first_stf; double timeFirstSTFOutput; double deltaTimeSTF; + int deltaStepSTF; /* Integer time of the next stf output */ integertime_t ti_nextSTF;