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

Corrected a mistake in the drifting of the multipoles that did not recurse correctly.

parent 707ef041
......@@ -1077,8 +1077,8 @@ void cell_check_multipole_drift_point(struct cell *c, void *data) {
if (c->ti_old_multipole != ti_drift)
error(
"Cell multipole in an incorrect time-zone! c->ti_old_multipole=%lld "
"ti_drift=%lld",
c->ti_old_multipole, ti_drift);
"ti_drift=%lld (depth=%d)",
c->ti_old_multipole, ti_drift, c->depth);
#else
error("Calling debugging code without debugging flag activated.");
......@@ -1504,18 +1504,17 @@ void cell_drift_all_multipoles(struct cell *c, const struct engine *e) {
/* Check that we are actually going to move forward. */
if (ti_current < ti_old_multipole) error("Attempt to drift to the past");
/* Drift the multipole */
if (ti_current > ti_old_multipole)
gravity_drift(c->multipole, dt);
/* Are we not in a leaf ? */
if (c->split) {
/* Loop over the progeny and drift the multipoles. */
/* Loop over the progeny and recurse. */
for (int k = 0; k < 8; k++)
if (c->progeny[k] != NULL) cell_drift_particles(c->progeny[k], e);
} else if (ti_current > ti_old_multipole) {
/* Drift the multipole */
gravity_drift(c->multipole, dt);
if (c->progeny[k] != NULL) cell_drift_all_multipoles(c->progeny[k], e);
}
/* Update the time of the last drift */
......
......@@ -3312,7 +3312,7 @@ void engine_do_drift_all_mapper(void *map_data, int num_elements,
/* Drift all the particles */
cell_drift_particles(c, e);
/* Drift the multipole */
/* Drift the multipoles */
if (e->policy & engine_policy_self_gravity)
cell_drift_all_multipoles(c, e);
}
......
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