Commit 0199eaa8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Changed the particle shift diff to 1e-4 instead of 1e-6 to avoid rounding-up error.

parent 90728e66
...@@ -918,7 +918,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid, ...@@ -918,7 +918,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
p->x[1] * runner_shift[sid][1] + p->x[1] * runner_shift[sid][1] +
p->x[2] * runner_shift[sid][2]; p->x[2] * runner_shift[sid][2];
if (fabsf(d - sort_i[pid].d) - ci->dx_max_sort > if (fabsf(d - sort_i[pid].d) - ci->dx_max_sort >
1.0e-6 * max(fabsf(d), ci->dx_max_sort_old)) 1.0e-4 * max(fabsf(d), ci->dx_max_sort_old))
error( error(
"particle shift diff exceeds dx_max_sort in cell ci. ci->nodeID=%d " "particle shift diff exceeds dx_max_sort in cell ci. ci->nodeID=%d "
"cj->nodeID=%d d=%e sort_i[pid].d=%e ci->dx_max_sort=%e " "cj->nodeID=%d d=%e sort_i[pid].d=%e ci->dx_max_sort=%e "
...@@ -932,7 +932,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid, ...@@ -932,7 +932,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
p->x[1] * runner_shift[sid][1] + p->x[1] * runner_shift[sid][1] +
p->x[2] * runner_shift[sid][2]; p->x[2] * runner_shift[sid][2];
if (fabsf(d - sort_j[pjd].d) - cj->dx_max_sort > if (fabsf(d - sort_j[pjd].d) - cj->dx_max_sort >
1.0e-6 * max(fabsf(d), cj->dx_max_sort_old)) 1.0e-4 * max(fabsf(d), cj->dx_max_sort_old))
error( error(
"particle shift diff exceeds dx_max_sort in cell cj. cj->nodeID=%d " "particle shift diff exceeds dx_max_sort in cell cj. cj->nodeID=%d "
"ci->nodeID=%d d=%e sort_j[pjd].d=%e cj->dx_max_sort=%e " "ci->nodeID=%d d=%e sort_j[pjd].d=%e cj->dx_max_sort=%e "
...@@ -1217,8 +1217,13 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { ...@@ -1217,8 +1217,13 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
p->x[1] * runner_shift[sid][1] + p->x[1] * runner_shift[sid][1] +
p->x[2] * runner_shift[sid][2]; p->x[2] * runner_shift[sid][2];
if (fabsf(d - sort_i[pid].d) - ci->dx_max_sort > if (fabsf(d - sort_i[pid].d) - ci->dx_max_sort >
1.0e-6 * max(fabsf(d), ci->dx_max_sort)) 1.0e-4 * max(fabsf(d), ci->dx_max_sort_old))
error("particle shift diff exceeds dx_max_sort."); error(
"particle shift diff exceeds dx_max_sort in cell ci. ci->nodeID=%d "
"cj->nodeID=%d d=%e sort_i[pid].d=%e ci->dx_max_sort=%e "
"ci->dx_max_sort_old=%e",
ci->nodeID, cj->nodeID, d, sort_i[pid].d, ci->dx_max_sort,
ci->dx_max_sort_old);
} }
for (int pjd = 0; pjd < cj->count; pjd++) { for (int pjd = 0; pjd < cj->count; pjd++) {
const struct part *p = &cj->parts[sort_j[pjd].i]; const struct part *p = &cj->parts[sort_j[pjd].i];
...@@ -1226,8 +1231,13 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { ...@@ -1226,8 +1231,13 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) {
p->x[1] * runner_shift[sid][1] + p->x[1] * runner_shift[sid][1] +
p->x[2] * runner_shift[sid][2]; p->x[2] * runner_shift[sid][2];
if (fabsf(d - sort_j[pjd].d) - cj->dx_max_sort > if (fabsf(d - sort_j[pjd].d) - cj->dx_max_sort >
1.0e-6 * max(fabsf(d), cj->dx_max_sort)) 1.0e-4 * max(fabsf(d), cj->dx_max_sort_old))
error("particle shift diff exceeds dx_max_sort."); error(
"particle shift diff exceeds dx_max_sort in cell cj. cj->nodeID=%d "
"ci->nodeID=%d d=%e sort_j[pjd].d=%e cj->dx_max_sort=%e "
"cj->dx_max_sort_old=%e",
cj->nodeID, ci->nodeID, d, sort_j[pjd].d, cj->dx_max_sort,
cj->dx_max_sort_old);
} }
#endif /* SWIFT_DEBUG_CHECKS */ #endif /* SWIFT_DEBUG_CHECKS */
......
...@@ -642,7 +642,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, ...@@ -642,7 +642,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
p->x[1] * runner_shift[sid][1] + p->x[1] * runner_shift[sid][1] +
p->x[2] * runner_shift[sid][2]; p->x[2] * runner_shift[sid][2];
if (fabsf(d - sort_i[pid].d) - ci->dx_max_sort > if (fabsf(d - sort_i[pid].d) - ci->dx_max_sort >
1.0e-6 * max(fabsf(d), ci->dx_max_sort_old)) 1.0e-4 * max(fabsf(d), ci->dx_max_sort_old))
error( error(
"particle shift diff exceeds dx_max_sort in cell ci. ci->nodeID=%d " "particle shift diff exceeds dx_max_sort in cell ci. ci->nodeID=%d "
"cj->nodeID=%d d=%e sort_i[pid].d=%e ci->dx_max_sort=%e " "cj->nodeID=%d d=%e sort_i[pid].d=%e ci->dx_max_sort=%e "
...@@ -656,7 +656,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, ...@@ -656,7 +656,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
p->x[1] * runner_shift[sid][1] + p->x[1] * runner_shift[sid][1] +
p->x[2] * runner_shift[sid][2]; p->x[2] * runner_shift[sid][2];
if (fabsf(d - sort_j[pjd].d) - cj->dx_max_sort > if (fabsf(d - sort_j[pjd].d) - cj->dx_max_sort >
1.0e-6 * max(fabsf(d), cj->dx_max_sort_old)) 1.0e-4 * max(fabsf(d), cj->dx_max_sort_old))
error( error(
"particle shift diff exceeds dx_max_sort in cell cj. cj->nodeID=%d " "particle shift diff exceeds dx_max_sort in cell cj. cj->nodeID=%d "
"ci->nodeID=%d d=%e sort_j[pjd].d=%e cj->dx_max_sort=%e " "ci->nodeID=%d d=%e sort_j[pjd].d=%e cj->dx_max_sort=%e "
......
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