From e2269663aa007ae70bb7668e3a5fe0f6e3dec1ce Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Tue, 13 Aug 2019 16:09:52 +0200
Subject: [PATCH] BUG: edge sync fails with cyclic baffles (fixes #1397)

- synchronization, reduction only makes sense on processor-coupled
  patches. Since cyclic baffles are within a single processor domain,
  they are not reduced. So need to skip the sanity test for these.
---
 .../meshes/polyMesh/globalMeshData/globalMeshData.C       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
index 2976c35530e..962c4d63637 100644
--- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
+++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
@@ -1185,6 +1185,12 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const
 
         forAll(coupledPatch().edges(), edgeI)
         {
+            if (masterEdgeVerts[edgeI] == labelPair(labelMax, labelMax))
+            {
+                // Skip single edge on cyclic baffle
+                continue;
+            }
+
             const edge& e = coupledPatch().edges()[edgeI];
             const labelPair masterE
             (
@@ -1192,7 +1198,7 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const
                 masterPoint[e[1]]
             );
 
-            label stat = labelPair::compare
+            const int stat = labelPair::compare
             (
                 masterE,
                 masterEdgeVerts[edgeI]
-- 
GitLab