Commit 19dae51a authored by Peter W. Draper's avatar Peter W. Draper
Browse files

When not drifting because the cell has already drifted this step, keep the...

When not drifting because the cell has already drifted this step, keep the h_max and dx_max, don't reset to zero
parent f3f08986
......@@ -799,7 +799,7 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) {
if (!c->split) {
/* Check that we are actually going to move forward. */
if (ti_current >= ti_old) {
if (ti_current > ti_old) {
/* Loop over all the g-particles in the cell */
const size_t nr_gparts = c->gcount;
......@@ -843,6 +843,12 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) {
dx_max = sqrtf(dx2_max);
} /* Check that we are actually going to move forward. */
else {
/* ti_old == ti_current, just keep the current cell values. */
h_max = c->h_max;
dx_max = c->dx_max;
}
}
/* Otherwise, aggregate data from children. */
......
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