Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!279Improve readability of active/inactive condition
...@@ -799,7 +799,7 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) { ...@@ -799,7 +799,7 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) {
if (!c->split) { if (!c->split) {
/* Check that we are actually going to move forward. */ /* 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 */ /* Loop over all the g-particles in the cell */
const size_t nr_gparts = c->gcount; const size_t nr_gparts = c->gcount;
...@@ -843,6 +843,12 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) { ...@@ -843,6 +843,12 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) {
dx_max = sqrtf(dx2_max); dx_max = sqrtf(dx2_max);
} /* Check that we are actually going to move forward. */ } /* 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. */ /* Otherwise, aggregate data from children. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment