From be1c16721cd2691601f1f95ab859b0f44309d355 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Sat, 16 Mar 2019 15:34:35 +0000 Subject: [PATCH] When activating the star formation task, first drift the star particles in the cell. --- src/cell.c | 7 +++++-- src/engine_marktasks.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/cell.c b/src/cell.c index 10221d48d4..c7c10bcf66 100644 --- a/src/cell.c +++ b/src/cell.c @@ -3226,9 +3226,12 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { if (c->timestep != NULL) scheduler_activate(s, c->timestep); if (c->hydro.end_force != NULL) scheduler_activate(s, c->hydro.end_force); if (c->hydro.cooling != NULL) scheduler_activate(s, c->hydro.cooling); - if (c->hydro.star_formation != NULL) - scheduler_activate(s, c->hydro.star_formation); if (c->logger != NULL) scheduler_activate(s, c->logger); + + if (c->hydro.star_formation != NULL) { + scheduler_activate(s, c->hydro.star_formation); + cell_activate_drift_spart(c, s); + } } return rebuild; diff --git a/src/engine_marktasks.c b/src/engine_marktasks.c index c02eb5d2bd..9b34b3ea95 100644 --- a/src/engine_marktasks.c +++ b/src/engine_marktasks.c @@ -642,13 +642,17 @@ void engine_marktasks_mapper(void *map_data, int num_elements, scheduler_activate(s, t); } - /* Subgrid tasks */ + /* Subgrid tasks: cooling */ else if (t_type == task_type_cooling) { - if (cell_is_active_hydro(t->ci, e) || cell_is_active_gravity(t->ci, e)) - scheduler_activate(s, t); - } else if (t_type == task_type_star_formation) { - if (cell_is_active_hydro(t->ci, e) || cell_is_active_gravity(t->ci, e)) + if (cell_is_active_hydro(t->ci, e)) scheduler_activate(s, t); + } + + /* Subgrid tasks: star formation */ + else if (t_type == task_type_star_formation) { + if (cell_is_active_hydro(t->ci, e)) { scheduler_activate(s, t); + cell_activate_drift_spart(t->ci, s); + } } } } -- GitLab