Skip to content
Snippets Groups Projects
Commit 7c7ac4d8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added function to drift the multipole of a given cell without updating its progenies.

Added function to drift the multipole of a given cell without updating its progenies.
parent 58430327
Branches
Tags
No related merge requests found
......@@ -1457,7 +1457,7 @@ void cell_drift_particles(struct cell *c, const struct engine *e) {
* @param c The #cell.
* @param e The #engine (to get ti_current).
*/
void cell_drift_multipole(struct cell *c, const struct engine *e) {
void cell_drift_all_multipoles(struct cell *c, const struct engine *e) {
const double timeBase = e->timeBase;
const integertime_t ti_old_multipole = c->ti_old_multipole;
......@@ -1486,6 +1486,17 @@ void cell_drift_multipole(struct cell *c, const struct engine *e) {
c->ti_old_multipole = ti_current;
}
/**
* @brief Drifts the multipole of a cell to the current time.
*
* Only drifts the multipole at this level. Multipoles deeper in the
* tree are not updated.
*
* @param c The #cell.
* @param e The #engine (to get ti_current).
*/
void cell_drift_multipole(struct cell *c, const struct engine *e);
/**
* @brief Recursively checks that all particles in a cell have a time-step
*/
......
......@@ -356,6 +356,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s);
void cell_set_super(struct cell *c, struct cell *super);
void cell_drift_particles(struct cell *c, const struct engine *e);
void cell_drift_multipole(struct cell *c, const struct engine *e);
void cell_drift_all_multipoles(struct cell *c, const struct engine *e);
void cell_check_timesteps(struct cell *c);
#endif /* SWIFT_CELL_H */
......@@ -3028,14 +3028,8 @@ void engine_step(struct engine *e) {
if (e->step % 100 == 2) e->forcerepart = 1;
#endif
/* Are we drifting everything ? */
if (e->policy & engine_policy_drift_all) {
engine_drift_all(e);
#ifdef SWIFT_DEBUG_CHECKS
space_check_drift_point(e->s, e->ti_current);
#endif
}
/* Are we drifting everything (a la Gadget/GIZMO) ? */
if (e->policy & engine_policy_drift_all) engine_drift_all(e);
/* Print the number of active tasks ? */
if (e->verbose) engine_print_task_counts(e);
......@@ -3143,7 +3137,8 @@ void engine_do_drift_all_mapper(void *map_data, int num_elements,
cell_drift_particles(c, e);
/* Drift the multipole */
if (e->policy & engine_policy_self_gravity) cell_drift_multipole(c, e);
if (e->policy & engine_policy_self_gravity)
cell_drift_all_multipoles(c, e);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment