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

Use the correct distance when checking whether to use the full pp in the periodic PP

parent c6f36a99
Branches
Tags
1 merge request!1077Improved multipole acceptance criterion (MAC)
...@@ -1060,8 +1060,14 @@ void runner_dopair_grav_pp(struct runner *r, struct cell *ci, struct cell *cj, ...@@ -1060,8 +1060,14 @@ void runner_dopair_grav_pp(struct runner *r, struct cell *ci, struct cell *cj,
} else { /* Periodic BC */ } else { /* Periodic BC */
/* Get the relative distance between the CoMs */ /* Get the relative distance between the CoMs */
const double dx[3] = {CoM_j[0] - CoM_i[0], CoM_j[1] - CoM_i[1], double dx[3] = {CoM_j[0] - CoM_i[0], CoM_j[1] - CoM_i[1],
CoM_j[2] - CoM_i[2]}; CoM_j[2] - CoM_i[2]};
/* Correct for periodic BCs */
dx[0] = nearestf(dx[0], dim[0]);
dx[1] = nearestf(dx[1], dim[1]);
dx[2] = nearestf(dx[2], dim[2]);
const double r2 = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2]; const double r2 = dx[0] * dx[0] + dx[1] * dx[1] + dx[2] * dx[2];
/* Get the maximal distance between any two particles */ /* Get the maximal distance between any two particles */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment