diff --git a/src/cell.c b/src/cell.c index 3b0570f2abe9283032f32356812f4936a4f0b828..11ecce083f7b2c82f3997fce349ddd33ff9441ce 100644 --- a/src/cell.c +++ b/src/cell.c @@ -177,6 +177,7 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc) { pc->ti_end_max = c->ti_end_max; pc->ti_old_part = c->ti_old_part; pc->ti_old_gpart = c->ti_old_gpart; + pc->ti_old_multipole = c->ti_old_multipole; pc->count = c->count; pc->gcount = c->gcount; pc->scount = c->scount; @@ -221,6 +222,7 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c, c->ti_end_max = pc->ti_end_max; c->ti_old_part = pc->ti_old_part; c->ti_old_gpart = pc->ti_old_gpart; + c->ti_old_multipole = pc->ti_old_multipole; c->count = pc->count; c->gcount = pc->gcount; c->scount = pc->scount; diff --git a/src/cell.h b/src/cell.h index d6b11cc81476275ebfc39f541541ec01f70b825d..b0b04bc9f795e8a27dcc2766de3c81576b23e133 100644 --- a/src/cell.h +++ b/src/cell.h @@ -95,6 +95,9 @@ struct pcell { /*! Integer time of the last drift of the #gpart in this cell */ integertime_t ti_old_gpart; + /*! Integer time of the last drift of the #multipole in this cell */ + integertime_t ti_old_multipole; + /*! Number of #part in this cell. */ int count; diff --git a/src/engine.c b/src/engine.c index 1c4f53c86ae6a7e7fc25df75b9da1edde64fb768..2d133193d891427dc284e25ad827898088d85cfe 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4344,10 +4344,11 @@ void engine_do_drift_all_mapper(void *map_data, int num_elements, /* Drift all the g-particles */ cell_drift_gpart(c, e, 1); - - /* Drift the multipoles */ - if (e->policy & engine_policy_self_gravity) - cell_drift_all_multipoles(c, e); + } + + /* Drift the multipoles */ + if (e->policy & engine_policy_self_gravity) { + cell_drift_all_multipoles(c, e); } } }