diff --git a/examples/CoolingBox/run.sh b/examples/CoolingBox/run.sh index 18ece8fd3ece480ce8e4a9159b184175c04c6ff4..c78eec9da6c486bc31a60ab7a8521ce6a6a63165 100755 --- a/examples/CoolingBox/run.sh +++ b/examples/CoolingBox/run.sh @@ -5,6 +5,6 @@ echo "Generating initial conditions for the cooling box example..." python makeIC.py 10 -../swift -s -t 1 coolingBox.yml -C +../swift -s -t 1 coolingBox.yml -C 2>&1 | tee output.log python energy_plot.py 0 diff --git a/examples/main.c b/examples/main.c index 5bbb6ad616e1422da70ded9d4bb2dc057b198eb8..14c95dd3ec1b00680e3d39152bffe364e829d253 100644 --- a/examples/main.c +++ b/examples/main.c @@ -330,17 +330,6 @@ int main(int argc, char *argv[]) { struct hydro_props hydro_properties; hydro_props_init(&hydro_properties, params); - /* Initialise the external potential properties */ - struct external_potential potential; - if (with_external_gravity) - potential_init(params, &prog_const, &us, &potential); - if (with_external_gravity && myrank == 0) potential_print(&potential); - - /* Initialise the cooling function properties */ - struct cooling_data cooling; - if (with_cooling) cooling_init(params, &us, &prog_const, &cooling); - if (with_cooling && myrank == 0) cooling_print(&cooling); - /* Read particles and space information from (GADGET) ICs */ char ICfileName[200] = ""; parser_get_param_string(params, "InitialConditions:file_name", ICfileName); @@ -443,6 +432,17 @@ int main(int argc, char *argv[]) { message("nr of cells at depth %i is %i.", data[0], data[1]); } + /* Initialise the external potential properties */ + struct external_potential potential; + if (with_external_gravity) + potential_init(params, &prog_const, &us, &potential); + if (with_external_gravity && myrank == 0) potential_print(&potential); + + /* Initialise the cooling function properties */ + struct cooling_data cooling; + if (with_cooling) cooling_init(params, &us, &prog_const, &cooling); + if (with_cooling && myrank == 0) cooling_print(&cooling); + /* Construct the engine policy */ int engine_policies = ENGINE_POLICY | engine_policy_steal; if (with_drift_all) engine_policies |= engine_policy_drift_all;