diff --git a/examples/main_fof.c b/examples/main_fof.c index 5d9b42bb4e32a221cd36d32bc1ccf2482676771f..3aa3c432eefda7f5d3c00a86645f2ff768ee0c3d 100644 --- a/examples/main_fof.c +++ b/examples/main_fof.c @@ -91,6 +91,7 @@ int main(int argc, char *argv[]) { struct gpart *gparts = NULL; struct gravity_props gravity_properties; struct fof_props fof_properties; + struct neutrino_props neutrino_properties; struct part *parts = NULL; struct phys_const prog_const; struct space s; @@ -554,6 +555,9 @@ int main(int argc, char *argv[]) { /* Do we have neutrino DM particles? */ const int with_neutrinos = N_total[swift_type_neutrino] > 0; + /* Zero out neutrino properties to avoid running neutrino tasks */ + bzero(&neutrino_properties, sizeof(struct neutrino_props)); + /* Initialize the space with these data. */ if (myrank == 0) clocks_gettime(&tic); space_init(&s, params, &cosmo, dim, /*hydro_props=*/NULL, parts, gparts, @@ -645,7 +649,7 @@ int main(int argc, char *argv[]) { engine_policies, talking, &reparttype, &us, &prog_const, &cosmo, /*hydro_properties=*/NULL, /*entropy_floor=*/NULL, &gravity_properties, /*stars_properties=*/NULL, /*black_holes_properties=*/NULL, - /*sink_properties=*/NULL, /*neutrino_properties=*/NULL, + /*sink_properties=*/NULL, &neutrino_properties, /*feedback_properties=*/NULL, /*rt_properties=*/NULL, &mesh, /*potential=*/NULL, /*cooling_func=*/NULL, /*starform=*/NULL, /*chemistry=*/NULL, diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c index a75f64f44f269ba2b9ae9c22bbe2323660e470ca..8338e0554ef73fb881befd9a5a9ce3be60b2359a 100644 --- a/src/engine_maketasks.c +++ b/src/engine_maketasks.c @@ -1022,7 +1022,7 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) { c, NULL); /* Weighting task for neutrinos after the last kick */ - if (e->neutrino_properties && e->neutrino_properties->use_delta_f) { + if (e->neutrino_properties->use_delta_f) { c->grav.neutrino_weight = scheduler_addtask( s, task_type_neutrino_weight, task_subtype_none, 0, 0, c, NULL); scheduler_addunlock(s, c->kick1, c->grav.neutrino_weight);