From 1beb9b7acb1ced1f0cd276afcf6155909e8b2ad0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 17 Dec 2015 12:16:34 +0000 Subject: [PATCH] BUG: autoHexMesh: allocation of zones. Base on cell zoning, not on surface --- .../meshRefinement/meshRefinementBaffles.C | 251 +++++++++++------- 1 file changed, 156 insertions(+), 95 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index 7d350c4e68..d369f739ca 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -279,7 +279,6 @@ void Foam::meshRefinement::getIntersections } -// Determine patches for baffles on all intersected unnamed faces void Foam::meshRefinement::getBafflePatches ( const labelList& globalToMasterPatch, @@ -293,9 +292,16 @@ void Foam::meshRefinement::getBafflePatches labelList& neiPatch ) const { + // This determines the patches for the intersected faces to + // - remove the outside of the mesh + // - introduce baffles for (non-faceZone) intersections + // Any baffles for faceZones (faceType 'baffle'/'boundary') get introduced + // later + + // 1. Determine cell zones // ~~~~~~~~~~~~~~~~~~~~~~~ - // Note that this does not determine the surface that was intersected + // Note that this does not determine the surface+region that was intersected // so that is done in step 2 below. labelList cellToZone; @@ -312,50 +318,50 @@ void Foam::meshRefinement::getBafflePatches namedSurfaceIndex, posOrientation ); - - - // Some stats - if (debug) - { - label nZones = gMax(cellToZone)+1; - - label nUnvisited = 0; - label nBackgroundCells = 0; - labelList nZoneCells(nZones, 0); - forAll(cellToZone, cellI) - { - label zoneI = cellToZone[cellI]; - if (zoneI >= 0) - { - nZoneCells[zoneI]++; - } - else if (zoneI == -1) - { - nBackgroundCells++; - } - else if (zoneI == -2) - { - nUnvisited++; - } - else - { - FatalErrorIn("meshRefinement::getBafflePatches()") - << "problem" << exit(FatalError); - } - } - reduce(nUnvisited, sumOp