From 0e0476362f0398024828a9fce3e23175c75f5a82 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs@hunt.opencfd.co.uk>
Date: Wed, 10 Jun 2009 11:31:17 +0100
Subject: [PATCH] disable extended stencils on coupled patches with
 transformation since incorrect

---
 .../cellToFace/extendedCellToFaceStencil.C    | 25 ++++++++++++++++++-
 .../faceToCell/extendedFaceToCellStencil.C    | 25 ++++++++++++++++++-
 2 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C
index ac0f64d9ef7..968941177b7 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C
@@ -230,7 +230,30 @@ Foam::extendedCellToFaceStencil::calcDistributeMap
 Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh)
 :
     mesh_(mesh)
-{}
+{
+    // Check for transformation - not supported.
+    const polyBoundaryMesh& patches = mesh.boundaryMesh();
+
+    forAll(patches, patchI)
+    {
+        if (isA<coupledPolyPatch>(patches[patchI]))
+        {
+            const coupledPolyPatch& cpp =
+                refCast<const coupledPolyPatch>(patches[patchI]);
+
+            if (!cpp.parallel() || cpp.separated())
+            {
+                FatalErrorIn
+                (
+                    "extendedCellToFaceStencil::extendedCellToFaceStencil"
+                    "(const polyMesh&)"
+                )   << "Coupled patches with transformations not supported."
+                    << endl
+                    << "Problematic patch " << cpp.name() << exit(FatalError);
+            }
+        }
+    }
+}
 
 
 // ************************************************************************* //
diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C
index 0328c27dd42..4f0f5c41ad5 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C
+++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C
@@ -33,7 +33,30 @@ License
 Foam::extendedFaceToCellStencil::extendedFaceToCellStencil(const polyMesh& mesh)
 :
     mesh_(mesh)
-{}
+{
+    // Check for transformation - not supported.
+    const polyBoundaryMesh& patches = mesh.boundaryMesh();
+
+    forAll(patches, patchI)
+    {
+        if (isA<coupledPolyPatch>(patches[patchI]))
+        {
+            const coupledPolyPatch& cpp =
+                refCast<const coupledPolyPatch>(patches[patchI]);
+
+            if (!cpp.parallel() || cpp.separated())
+            {
+                FatalErrorIn
+                (
+                    "extendedFaceToCellStencil::extendedFaceToCellStencil"
+                    "(const polyMesh&)"
+                )   << "Coupled patches with transformations not supported."
+                    << endl
+                    << "Problematic patch " << cpp.name() << exit(FatalError);
+            }
+        }
+    }
+}
 
 
 // ************************************************************************* //
-- 
GitLab