From 7783e806d85e9feff27b4f8a1bb51b0291a00c9f Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Tue, 6 Apr 2010 16:30:08 +0100
Subject: [PATCH] BUG: Was not crossing into unnamed cellZone regions

---
 .../meshRefinement/meshRefinementBaffles.C    | 30 +++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
index 9798046ca3c..0d9cecd039d 100644
--- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
+++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
@@ -1234,7 +1234,7 @@ void Foam::meshRefinement::findCellZoneTopo
         {
             label surfI = namedSurfaceIndex[faceI];
 
-            if (surfI != -1 && surfaceToCellZone[surfI] != -1)
+            if (surfI != -1)
             {
                 // Calculate region to zone from cellRegions on either side
                 // of internal face.
@@ -1286,7 +1286,7 @@ void Foam::meshRefinement::findCellZoneTopo
 
                     label surfI = namedSurfaceIndex[faceI];
 
-                    if (surfI != -1 && surfaceToCellZone[surfI] != -1)
+                    if (surfI != -1)
                     {
                         bool changedCell = calcRegionToZone
                         (
@@ -2522,6 +2522,32 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
         mesh_.setInstance(oldInstance());
     }
 
+    // Print some stats (note: zones are synchronised)
+    if (mesh_.cellZones().size() > 0)
+    {
+        Info<< "CellZones:" << endl;
+        forAll(mesh_.cellZones(), zoneI)
+        {
+            const cellZone& cz = mesh_.cellZones()[zoneI];
+            Info<< "    " << cz.name()
+                << "\tsize:" << returnReduce(cz.size(), sumOp<label>())
+                << endl;
+        }
+        Info<< endl;
+    }
+    if (mesh_.faceZones().size() > 0)
+    {
+        Info<< "FaceZones:" << endl;
+        forAll(mesh_.faceZones(), zoneI)
+        {
+            const faceZone& fz = mesh_.faceZones()[zoneI];
+            Info<< "    " << fz.name()
+                << "\tsize:" << returnReduce(fz.size(), sumOp<label>())
+                << endl;
+        }
+        Info<< endl;
+    }
+
     // None of the faces has changed, only the zones. Still...
     updateMesh(map, labelList());
 
-- 
GitLab