From fa66e42407335508c3f8dbd66fc93e366ca4f48e Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Fri, 18 Nov 2011 11:38:47 +0000
Subject: [PATCH] ENH: AMI demand-driven update for cyclicAMIPolyPatch

---
 .../cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C   |  2 --
 .../cyclicAMIPolyPatch/cyclicAMIPolyPatchTemplates.C | 12 ++++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
index d281afc21f8..f3dbc36d801 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
@@ -745,8 +745,6 @@ void Foam::cyclicAMIPolyPatch::calcGeometry
         nbrCtrs,
         nbrAreas
     );
-
-    resetAMI();
 }
 
 
diff --git a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatchTemplates.C b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatchTemplates.C
index 4bf59fba416..e4457dffade 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatchTemplates.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatchTemplates.C
@@ -33,11 +33,11 @@ Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIPolyPatch::interpolate
 {
     if (owner())
     {
-        return AMIPtr_->interpolateToSource(fld);
+        return AMI().interpolateToSource(fld);
     }
     else
     {
-        return neighbPatch().AMIPtr_->interpolateToTarget(fld);
+        return neighbPatch().AMI().interpolateToTarget(fld);
     }
 }
 
@@ -50,11 +50,11 @@ Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIPolyPatch::interpolate
 {
     if (owner())
     {
-        return AMIPtr_->interpolateToSource(tFld);
+        return AMI().interpolateToSource(tFld);
     }
     else
     {
-        return neighbPatch().AMIPtr_->interpolateToTarget(tFld);
+        return neighbPatch().AMI().interpolateToTarget(tFld);
     }
 }
 
@@ -69,11 +69,11 @@ void Foam::cyclicAMIPolyPatch::interpolate
 {
     if (owner())
     {
-        AMIPtr_->interpolateToSource(fld, bop, result);
+        AMI().interpolateToSource(fld, bop, result);
     }
     else
     {
-        neighbPatch().AMIPtr_->interpolateToTarget(fld, bop, result);
+        neighbPatch().AMI().interpolateToTarget(fld, bop, result);
     }
 }
 
-- 
GitLab