need to use fabs() when computing deltas when checking image flags for consistency

This commit is contained in:
Axel Kohlmeyer
2019-03-27 15:47:14 -04:00
parent c4fd658e9d
commit b685a0a7b8

View File

@ -763,9 +763,9 @@ void Domain::image_check()
continue; continue;
} }
delx = unwrap[i][0] - unwrap[k][0]; delx = fabs(unwrap[i][0] - unwrap[k][0]);
dely = unwrap[i][1] - unwrap[k][1]; dely = fabs(unwrap[i][1] - unwrap[k][1]);
delz = unwrap[i][2] - unwrap[k][2]; delz = fabs(unwrap[i][2] - unwrap[k][2]);
if (xperiodic && delx > xprd_half) flag = 1; if (xperiodic && delx > xprd_half) flag = 1;
if (yperiodic && dely > yprd_half) flag = 1; if (yperiodic && dely > yprd_half) flag = 1;