Skip to content
Snippets Groups Projects
Commit 7ef09863 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

On start-up, pass the cosmology model to the engine.

parent 7cd98af2
No related branches found
No related tags found
1 merge request!509Cosmological time integration
......@@ -771,9 +771,9 @@ int main(int argc, char *argv[]) {
/* Initialize the engine with the space and policies. */
if (myrank == 0) clocks_gettime(&tic);
engine_init(&e, &s, params, N_total[0], N_total[1], engine_policies,
talking, &reparttype, &us, &prog_const, &hydro_properties,
&gravity_properties, &potential, &cooling_func, &chemistry,
&sourceterms);
talking, &reparttype, &us, &prog_const, &cosmo,
&hydro_properties, &gravity_properties, &potential,
&cooling_func, &chemistry, &sourceterms);
engine_config(0, &e, params, nr_nodes, myrank, nr_threads, with_aff,
talking, restart_file);
if (myrank == 0) {
......@@ -869,8 +869,7 @@ int main(int argc, char *argv[]) {
if (with_verbose_timers) timers_print(e.step);
/* Every so often allow the user to stop the application and dump the
* restart
* files. */
* restart files. */
if (j % restart_stop_steps == 0) {
force_stop = restart_stop_now(restart_dir, 0);
if (myrank == 0 && force_stop)
......@@ -878,8 +877,7 @@ int main(int argc, char *argv[]) {
}
/* Also if using nsteps to exit, will not have saved any restarts on exit,
* make
* sure we do that (useful in testing only). */
* make sure we do that (useful in testing only). */
if (force_stop || (e.restart_onexit && e.step - 1 == nsteps))
engine_dump_restarts(&e, 0, 1);
......
......@@ -5173,7 +5173,7 @@ void engine_init(
struct engine *e, struct space *s, const struct swift_params *params,
long long Ngas, long long Ndm, int policy, int verbose,
struct repartition *reparttype, const struct unit_system *internal_units,
const struct phys_const *physical_constants,
const struct phys_const *physical_constants, struct cosmology *cosmo,
const struct hydro_props *hydro, const struct gravity_props *gravity,
const struct external_potential *potential,
const struct cooling_function_data *cooling_func,
......@@ -5222,6 +5222,7 @@ void engine_init(
e->count_step = 0;
e->wallclock_time = 0.f;
e->physical_constants = physical_constants;
e->cosmology = cosmo;
e->hydro_properties = hydro;
e->gravity_properties = gravity;
e->external_potential = potential;
......
......@@ -328,7 +328,7 @@ void engine_init(
struct engine *e, struct space *s, const struct swift_params *params,
long long Ngas, long long Ndm, int policy, int verbose,
struct repartition *reparttype, const struct unit_system *internal_units,
const struct phys_const *physical_constants,
const struct phys_const *physical_constants, struct cosmology *cosmo,
const struct hydro_props *hydro, const struct gravity_props *gravity,
const struct external_potential *potential,
const struct cooling_function_data *cooling_func,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment