From 73f41cf1f6b84df00e3d50ee98b2e2dface45088 Mon Sep 17 00:00:00 2001 From: william Date: Mon, 9 Nov 2015 09:13:15 +0000 Subject: [PATCH] BUG: cyclicPeriodicAMI: Floor operation should add 0.5 to round to the nearest integer. --- .../cyclicPeriodicAMIPolyPatch/cyclicPeriodicAMIPolyPatch.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshTools/AMIInterpolation/patches/cyclicPeriodicAMI/cyclicPeriodicAMIPolyPatch/cyclicPeriodicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicPeriodicAMI/cyclicPeriodicAMIPolyPatch/cyclicPeriodicAMIPolyPatch.C index 5ac1b35015..ad7aaeea0f 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicPeriodicAMI/cyclicPeriodicAMIPolyPatch/cyclicPeriodicAMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicPeriodicAMI/cyclicPeriodicAMIPolyPatch/cyclicPeriodicAMIPolyPatch.C @@ -363,8 +363,8 @@ void Foam::cyclicPeriodicAMIPolyPatch::resetAMI // Check that both patches have replicated an integer number of times if ( - mag(srcSum - floor(srcSum + matchTolerance())) > matchTolerance() - || mag(tgtSum - floor(tgtSum + matchTolerance())) > matchTolerance() + mag(srcSum - floor(srcSum + 0.5)) > matchTolerance() + || mag(tgtSum - floor(tgtSum + 0.5)) > matchTolerance() ) { FatalErrorIn