diff --git a/src/cell.c b/src/cell.c index 7d72019da6df4672d088bdec77793c98496bc7bf..4d9f25a4e286355c58710271ad0f938857873154 100644 --- a/src/cell.c +++ b/src/cell.c @@ -6389,7 +6389,9 @@ void cell_reorder_extra_gparts(struct cell *c, struct part *parts, */ int cell_can_use_pair_mm(const struct cell *ci, const struct cell *cj, const struct engine *e, const struct space *s) { - const double theta_crit2 = e->gravity_properties->theta_crit2; + + const double theta_crit = e->gravity_properties->theta_crit; + const double theta_crit2 = theta_crit * theta_crit; const int periodic = s->periodic; const double dim[3] = {s->dim[0], s->dim[1], s->dim[2]}; @@ -6431,7 +6433,8 @@ int cell_can_use_pair_mm(const struct cell *ci, const struct cell *cj, int cell_can_use_pair_mm_rebuild(const struct cell *ci, const struct cell *cj, const struct engine *e, const struct space *s) { - const double theta_crit2 = e->gravity_properties->theta_crit2; + const double theta_crit = e->gravity_properties->theta_crit; + const double theta_crit2 = theta_crit * theta_crit; const int periodic = s->periodic; const double dim[3] = {s->dim[0], s->dim[1], s->dim[2]}; diff --git a/src/engine.c b/src/engine.c index 23222740ec54457a5f43b52e7688ffcbd25f1559..d1760d0b3fe52d30c0f8b8c9aa38eced5ec09d89 100644 --- a/src/engine.c +++ b/src/engine.c @@ -3099,8 +3099,9 @@ void engine_makeproxies(struct engine *e) { /* Get some info about the physics */ const int with_hydro = (e->policy & engine_policy_hydro); const int with_gravity = (e->policy & engine_policy_self_gravity); - const double theta_crit_inv = e->gravity_properties->theta_crit_inv; - const double theta_crit2 = e->gravity_properties->theta_crit2; + const double theta_crit_inv = 1. / e->gravity_properties->theta_crit; + const double theta_crit2 = + e->gravity_properties->theta_crit * e->gravity_properties->theta_crit; const double max_mesh_dist = e->mesh->r_cut_max; const double max_mesh_dist2 = max_mesh_dist * max_mesh_dist; diff --git a/src/runner_doiact_grav.c b/src/runner_doiact_grav.c index 81c091a8946f22a1557d29f09cb9ce1fb8c23d15..b36bedd09042f0c6df07a89e92e30113c2cdb014 100644 --- a/src/runner_doiact_grav.c +++ b/src/runner_doiact_grav.c @@ -541,7 +541,8 @@ static INLINE void runner_dopair_grav_pm_full( #ifdef SWIFT_DEBUG_CHECKS const float r_max_j = cj->grav.multipole->r_max; const float r_max2 = r_max_j * r_max_j; - const float theta_crit2 = e->gravity_properties->theta_crit2; + const double theta_crit = e->gravity_properties->theta_crit; + const double theta_crit2 = theta_crit * theta_crit; /* Note: 0.99 and 1.1 to avoid FP rounding false-positives */ if (!gravity_M2P_accept(r_max2, theta_crit2 * 1.1, r2, 0.99 * h_i)) @@ -684,7 +685,8 @@ static INLINE void runner_dopair_grav_pm_truncated( #ifdef SWIFT_DEBUG_CHECKS const float r_max_j = cj->grav.multipole->r_max; const float r_max2 = r_max_j * r_max_j; - const float theta_crit2 = e->gravity_properties->theta_crit2; + const double theta_crit = e->gravity_properties->theta_crit; + const double theta_crit2 = theta_crit * theta_crit; /* 0.99 and 1.1 to avoid FP rounding false-positives */ if (!gravity_M2P_accept(r_max2, theta_crit2 * 1.1, r2, 0.99 * h_i)) @@ -1623,7 +1625,8 @@ void runner_dopair_recursive_grav(struct runner *r, struct cell *ci, const int nodeID = e->nodeID; const int periodic = e->mesh->periodic; const double dim[3] = {e->mesh->dim[0], e->mesh->dim[1], e->mesh->dim[2]}; - const double theta_crit2 = e->gravity_properties->theta_crit2; + const double theta_crit = e->gravity_properties->theta_crit; + const double theta_crit2 = theta_crit * theta_crit; const double max_distance = e->mesh->r_cut_max; /* Anything to do here? */ @@ -1840,7 +1843,8 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) { const struct engine *e = r->e; const int periodic = e->mesh->periodic; const double dim[3] = {e->mesh->dim[0], e->mesh->dim[1], e->mesh->dim[2]}; - const double theta_crit2 = e->gravity_properties->theta_crit2; + const double theta_crit = e->gravity_properties->theta_crit; + const double theta_crit2 = theta_crit * theta_crit; const double max_distance2 = e->mesh->r_cut_max * e->mesh->r_cut_max; TIMER_TIC;