Commit 5adecd4f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Correctly ignore the time-step of inhibited particles.

parent 2b85a22b
......@@ -3058,7 +3058,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
}
int updated = 0, g_updated = 0, s_updated = 0, b_updated = 0;
int inhibited = 0, g_inhibited = 0, s_inhibited = 0, b_inhibited = 0;
integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_end_max = 0,
ti_hydro_beg_max = 0;
integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_end_max = 0,
......@@ -3128,8 +3127,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
else { /* part is inactive */
/* Count the number of inhibited particles */
if (part_is_inhibited(p, e)) inhibited++;
if (!part_is_inhibited(p, e)) {
const integertime_t ti_end =
get_integer_time_end(ti_current, p->time_bin);
......@@ -3153,6 +3151,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
/* What is the next starting point for this cell ? */
ti_gravity_beg_max = max(ti_beg, ti_gravity_beg_max);
}
}
}
}
......@@ -3197,10 +3196,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
} else { /* gpart is inactive */
/* Count the number of inhibited particles */
if (gpart_is_inhibited(gp, e)) {
g_inhibited++;
} else {
if (!gpart_is_inhibited(gp, e)) {
const integertime_t ti_end =
get_integer_time_end(ti_current, gp->time_bin);
......@@ -3259,8 +3255,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
/* star particle is inactive but not inhibited */
} else {
/* Count the number of inhibited particles */
if (spart_is_inhibited(sp, e)) ++s_inhibited;
if (!spart_is_inhibited(sp, e)) {
const integertime_t ti_end =
get_integer_time_end(ti_current, sp->time_bin);
......@@ -3277,6 +3272,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
ti_stars_beg_max = max(ti_beg, ti_stars_beg_max);
ti_gravity_beg_max = max(ti_beg, ti_gravity_beg_max);
}
}
}
/* Loop over the star particles in this cell. */
......@@ -3321,11 +3317,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
/* star particle is inactive but not inhibited */
} else {
/* Count the number of inhibited particles */
if (bpart_is_inhibited(bp, e)) {
message("BH inhibited!");
++b_inhibited;
} else {
if (!bpart_is_inhibited(bp, e)) {
const integertime_t ti_end =
get_integer_time_end(ti_current, bp->time_bin);
......
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