Commit 0bda8d2e authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Only trigger an emergency sort of the stars after star formation if we are...

Only trigger an emergency sort of the stars after star formation if we are running with feedback (and hence need sorted stars).
parent 04165f18
......@@ -573,6 +573,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
struct part *restrict parts = c->hydro.parts;
struct xpart *restrict xparts = c->hydro.xparts;
const int with_cosmology = (e->policy & engine_policy_cosmology);
const int with_feedback = (e->policy & engine_policy_feedback);
const struct hydro_props *restrict hydro_props = e->hydro_properties;
const struct unit_system *restrict us = e->internal_units;
struct cooling_function_data *restrict cooling = e->cooling_func;
......@@ -648,7 +649,8 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* If we formed any stars, the star sorts are now invalid. We need to
* re-compute them. */
if ((c == c->hydro.super) && (current_stars_count != c->stars.count)) {
if (with_feedback && (c == c->hydro.super) &&
(current_stars_count != c->stars.count)) {
cell_clear_stars_sort_flags(c, /*is_super=*/1);
runner_do_stars_sort(r, c, 0x1FFF, /*cleanup=*/0, /*timer=*/0);
}
......
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