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

Do not compute the potential normalisation when running without periodic gravity.

parent 9fd17a36
Branches
Tags
No related merge requests found
......@@ -1664,13 +1664,18 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) {
struct spart *restrict sparts = c->sparts;
const int periodic = s->periodic;
const float G_newton = e->physical_constants->const_newton_G;
const double r_s = e->mesh->r_s;
const double volume = s->dim[0] * s->dim[1] * s->dim[2];
const float potential_normalisation =
4. * M_PI * e->total_mass * r_s * r_s / volume;
TIMER_TIC;
/* Potential normalisation in the case of periodic gravity */
float potential_normalisation = 0.;
if (periodic && (e->policy & engine_policy_self_gravity)) {
const double volume = s->dim[0] * s->dim[1] * s->dim[2];
const double r_s = e->mesh->r_s;
potential_normalisation =
4. * M_PI * e->total_mass * r_s * r_s / volume;
}
/* Anything to do here? */
if (!cell_is_active_hydro(c, e) && !cell_is_active_gravity(c, e)) return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment