diff --git a/src/cell.c b/src/cell.c index 2885e29fe5966a82b7ba544f7b58859302bba5d4..2e9c760b50f75d628c62985381e28e37874485ec 100644 --- a/src/cell.c +++ b/src/cell.c @@ -1106,6 +1106,7 @@ void cell_reset_task_counters(struct cell *c) { * @brief Recursively construct all the multipoles in a cell hierarchy. * * @param c The #cell. + * @param ti_current The current integer time. */ void cell_make_multipoles(struct cell *c, integertime_t ti_current) { diff --git a/src/multipole.h b/src/multipole.h index a934e66d454c1493515ad4bb003bf48c684f6417..24a526f5758db8cf11fffa0b8362c5e24e045c1b 100644 --- a/src/multipole.h +++ b/src/multipole.h @@ -2525,8 +2525,8 @@ INLINE static void gravity_L2P(const struct grav_tensor *lb, * @param ma The #multipole of the first #cell. * @param mb The #multipole of the second #cell. * @param theta_crit_inv The inverse of the critical opening angle. - * @param Are we using the current value of CoM or the ones from the last - * rebuild ? + * @param rebuild Are we using the current value of CoM or the ones from + * the last rebuild ? */ __attribute__((always_inline)) INLINE static int gravity_multipole_accept( const struct gravity_tensors *ma, const struct gravity_tensors *mb, @@ -2546,6 +2546,8 @@ __attribute__((always_inline)) INLINE static int gravity_multipole_accept( const double r2 = dx * dx + dy * dy + dz * dz; + // MATTHIEU: Make this mass-dependent ? + /* Multipole acceptance criterion (Dehnen 2002, eq.10) */ return (r2 > (r_crit_a + r_crit_b) * (r_crit_a + r_crit_b)); } diff --git a/src/runner_doiact_grav.h b/src/runner_doiact_grav.h index aeece8a32f8004c937e41bc1aa4a1f5873f2288f..13a55344d773e7fba000d680eae9866dffdd88e1 100644 --- a/src/runner_doiact_grav.h +++ b/src/runner_doiact_grav.h @@ -650,6 +650,7 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) { theta_crit_inv, 1)) { /* Alright, we have to take charge of that pair in a different way. */ + // MATTHIEU: We should actually open the tree-node here and recurse. runner_dopair_grav_mm(r, ci, cj); } } diff --git a/src/space.c b/src/space.c index 8e5c6ba15a9e4a3416f508519c85d04ca8e2a83d..5a28984a21556139cbcd4c45eb3c74fbeedcb741 100644 --- a/src/space.c +++ b/src/space.c @@ -2197,11 +2197,11 @@ void space_split_recursive(struct space *s, struct cell *c, c->multipole->CoM[2] = c->loc[2] + c->width[2] / 2.; c->multipole->r_max = 0.; } + c->multipole->r_max_rebuild = c->multipole->r_max; + c->multipole->CoM_rebuild[0] = c->multipole->CoM[0]; + c->multipole->CoM_rebuild[1] = c->multipole->CoM[1]; + c->multipole->CoM_rebuild[2] = c->multipole->CoM[2]; } - c->multipole->r_max_rebuild = c->multipole->r_max; - c->multipole->CoM_rebuild[0] = c->multipole->CoM[0]; - c->multipole->CoM_rebuild[1] = c->multipole->CoM[1]; - c->multipole->CoM_rebuild[2] = c->multipole->CoM[2]; } /* Set the values for this cell. */