Commit 18ebebb1 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Initialise the FOF structure in the main()

parent b3d15f19
......@@ -99,6 +99,7 @@ int main(int argc, char *argv[]) {
struct feedback_props feedback_properties;
struct entropy_floor_properties entropy_floor;
struct black_holes_props black_holes_properties;
struct fof_props fof_properties;
struct part *parts = NULL;
struct phys_const prog_const;
struct space s;
......@@ -828,6 +829,10 @@ int main(int argc, char *argv[]) {
chemistry_init(params, &us, &prog_const, &chemistry);
if (myrank == 0) chemistry_print(&chemistry);
/* Initialise the FOF properties */
bzero(&fof_properties, sizeof(struct fof_props));
if (with_fof) fof_init(&fof_properties, params);
/* Be verbose about what happens next */
if (myrank == 0) message("Reading ICs from file '%s'", ICfileName);
if (myrank == 0 && cleanup_h)
......@@ -1038,7 +1043,7 @@ int main(int argc, char *argv[]) {
&hydro_properties, &entropy_floor, &gravity_properties,
&stars_properties, &black_holes_properties,
&feedback_properties, &mesh, &potential, &cooling_func,
&starform, &chemistry);
&starform, &chemistry, &fof_properties);
engine_config(0, &e, params, nr_nodes, myrank, nr_threads, with_aff,
talking, restart_file);
......
......@@ -99,6 +99,7 @@ int main(int argc, char *argv[]) {
struct feedback_props feedback_properties;
struct entropy_floor_properties entropy_floor;
struct black_holes_props black_holes_properties;
struct fof_props fof_properties;
struct part *parts = NULL;
struct phys_const prog_const;
struct space s;
......@@ -913,6 +914,10 @@ int main(int argc, char *argv[]) {
chemistry_init(params, &us, &prog_const, &chemistry);
if (myrank == 0) chemistry_print(&chemistry);
/* Initialise the FOF properties */
bzero(&fof_properties, sizeof(struct fof_props));
if (with_fof) fof_init(&fof_properties, params);
/* Construct the engine policy */
int engine_policies = ENGINE_POLICY | engine_policy_steal;
if (with_drift_all) engine_policies |= engine_policy_drift_all;
......@@ -939,7 +944,7 @@ int main(int argc, char *argv[]) {
&hydro_properties, &entropy_floor, &gravity_properties,
&stars_properties, &black_holes_properties,
&feedback_properties, &mesh, &potential, &cooling_func,
&starform, &chemistry);
&starform, &chemistry, &fof_properties);
engine_config(0, &e, params, nr_nodes, myrank, nr_threads, with_aff,
talking, restart_file);
......@@ -1001,10 +1006,6 @@ int main(int argc, char *argv[]) {
e.tic_step = getticks();
#endif
/* Initialise the FOF parameters. */
// MATTHIEU
// fof_init(&s);
/* Initialise the particles */
engine_init_particles(&e, flag_entropy_ICs, clean_smoothing_length_values,
0);
......
......@@ -4906,7 +4906,8 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
const struct external_potential *potential,
struct cooling_function_data *cooling_func,
const struct star_formation *starform,
const struct chemistry_global_data *chemistry) {
const struct chemistry_global_data *chemistry,
struct fof_props *fof_properties) {
/* Clean-up everything */
bzero(e, sizeof(struct engine));
......@@ -4977,6 +4978,7 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
e->star_formation = starform;
e->feedback_props = feedback;
e->chemistry = chemistry;
e->fof_properties = fof_properties;
e->parameter_file = params;
#ifdef WITH_MPI
e->cputime_last_step = 0;
......
......@@ -490,7 +490,8 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
const struct external_potential *potential,
struct cooling_function_data *cooling_func,
const struct star_formation *starform,
const struct chemistry_global_data *chemistry);
const struct chemistry_global_data *chemistry,
struct fof_props *fof_properties);
void engine_config(int restart, struct engine *e, struct swift_params *params,
int nr_nodes, int nodeID, int nr_threads, int with_aff,
int verbose, const char *restart_file);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment