Commit f0126fe9 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Do not run the gravity exact calculation checks if we are not running with self gravity

parent 055253a9
......@@ -3143,7 +3143,8 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
/* Run the brute-force gravity calculation for some gparts */
gravity_exact_force_compute(e->s, e);
if (e->policy & engine_policy_self_gravity)
gravity_exact_force_compute(e->s, e);
#endif
/* Run the 0th time-step */
......@@ -3151,7 +3152,8 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
/* Check the accuracy of the gravity calculation */
gravity_exact_force_check(e->s, e, 1e-1);
if (e->policy & engine_policy_self_gravity)
gravity_exact_force_check(e->s, e, 1e-1);
#endif
/* Recover the (integer) end of the next time-step */
......@@ -3242,7 +3244,8 @@ void engine_step(struct engine *e) {
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
/* Run the brute-force gravity calculation for some gparts */
gravity_exact_force_compute(e->s, e);
if (e->policy & engine_policy_self_gravity)
gravity_exact_force_compute(e->s, e);
#endif
/* Do we need to drift the top-level multipoles ? */
......@@ -3255,7 +3258,8 @@ void engine_step(struct engine *e) {
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
/* Check the accuracy of the gravity calculation */
gravity_exact_force_check(e->s, e, 1e-1);
if (e->policy & engine_policy_self_gravity)
gravity_exact_force_check(e->s, e, 1e-1);
#endif
/* Let's trigger a rebuild every-so-often for good measure */ // MATTHIEU
......
......@@ -466,7 +466,7 @@ void runner_do_init_grav(struct runner *r, struct cell *c, int timer) {
/* Drift the multipole */
cell_drift_multipole(c, e);
/* Reset the gravity acceleration tensors */
gravity_field_tensors_init(&c->multipole->pot);
......
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