From 4807448bb1f6db3a84d4a3df4a0fec9528b84c51 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Fri, 17 Jun 2016 11:50:56 +0100
Subject: [PATCH] cyclicACMIPolyPatch: Clear geometry when resetting Patch
 contributed by Mattijs Janssens

---
 .../cyclicACMIPolyPatch/cyclicACMIPolyPatch.C | 29 ++++++++++++-------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C
index 05dc64449d0..50ec5c1b0ad 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C
@@ -60,16 +60,25 @@ void Foam::cyclicACMIPolyPatch::resetAMI
 
         if (boundaryMesh().mesh().hasCellCentres())
         {
-            WarningInFunction
-                << "The mesh already has cellCentres calculated when"
-                << " resetting ACMI " << name() << "." << endl
-                << "This is a problem since ACMI adapts the face areas"
-                << " (to close cells) so this has" << endl
-                << "to be done before cell centre calculation." << endl
-                << "This can happen if e.g. the cyclicACMI is after"
-                << " any processor patches in the boundary." << endl
-                << "Continuing with potential for incorrect geometry"
-                << " calculation and mass loss" << endl;
+            if (debug)
+            {
+                Pout<< "cyclicACMIPolyPatch::resetAMI : clearing cellCentres"
+                    << " for " << name() << " and " << nonOverlapPatch.name()
+                    << endl;
+            }
+
+            //WarningInFunction
+            //    << "The mesh already has cellCentres calculated when"
+            //    << " resetting ACMI " << name() << "." << endl
+            //    << "This is a problem since ACMI adapts the face areas"
+            //    << " (to close cells) so this has" << endl
+            //    << "to be done before cell centre calculation." << endl
+            //    << "This can happen if e.g. the cyclicACMI is after"
+            //    << " any processor patches in the boundary." << endl;
+            const_cast<polyMesh&>
+            (
+                boundaryMesh().mesh()
+            ).primitiveMesh::clearGeom();
         }
 
 
-- 
GitLab