From d3ccd23b42b76fc7945d6e410be83196a2eecaf7 Mon Sep 17 00:00:00 2001
From: mattijs <m.janssens@opencfd.co.uk>
Date: Mon, 28 Jul 2008 16:27:17 +0100
Subject: [PATCH] boundary face handling

---
 .../manipulation/mergeMeshes/mergePolyMesh.C  | 20 +++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C
index ce858a51b7c..0335cf3abc6 100644
--- a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C
+++ b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C
@@ -315,12 +315,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
             }
         }
 
-        newOwn = own[faceI];
-        if (newOwn > -1) newOwn = renumberCells[newOwn];
-
-        newNei = nei[faceI];
-        if (newNei > -1) newNei = renumberCells[newNei];
-
         if (faceI < m.nInternalFaces() || faceI >= m.nFaces())
         {
             newPatch = -1;
@@ -330,6 +324,20 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
             newPatch = patchIndices[bm.whichPatch(faceI)];
         }
 
+        newOwn = own[faceI];
+        if (newOwn > -1) newOwn = renumberCells[newOwn];
+
+        if (newPatch > -1) 
+        {
+            newNei = -1;
+        } 
+        else 
+        {
+            newNei = nei[faceI];
+            newNei = renumberCells[newNei];
+        }
+
+
         newZone = fz.whichZone(faceI);
         newZoneFlip = false;
 
-- 
GitLab