From f25c2a1155ea649ecbd17a747515d08213de14d2 Mon Sep 17 00:00:00 2001
From: laurence <laurence>
Date: Thu, 9 Feb 2012 15:58:47 +0000
Subject: [PATCH] ENH: processorPolyPatch::updateMesh outputs FatalError if
 size of data on neighbour does not match size of data on the current
 processor

---
 .../constraint/processor/processorPolyPatch.C  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
index ac8e28a81cb..7ee72d6142b 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
@@ -369,6 +369,24 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
                 >> nbrPointIndex
                 >> nbrEdgeFace
                 >> nbrEdgeIndex;
+
+            if
+            (
+                nbrPointIndex.size() != nPoints()
+             || nbrEdgeIndex.size() != nEdges()
+            )
+            {
+                FatalErrorIn
+                (
+                    "processorPolyPatch::updateMesh(PstreamBuffers&)"
+                )   << "Size of data from processor " << neighbProcNo()
+                    << " does not match size of data on processor "
+                    << Pstream::myProcNo() << "." << nl
+                    << "    Neighbour has " << nbrPointFace.size()
+                    << " points and " << nbrEdgeFace.size() << " edges." << nl
+                    << "    This proc has " << nPoints() << " points and "
+                    << nEdges() << " edges." << exit(FatalError);
+            }
         }
 
         // Convert neighbour faces and indices into face back into
-- 
GitLab