diff --git a/src/meshTools/regionSplit/regionSplit.C b/src/meshTools/regionSplit/regionSplit.C index 8e5f5e42ac..d826a25d15 100644 --- a/src/meshTools/regionSplit/regionSplit.C +++ b/src/meshTools/regionSplit/regionSplit.C @@ -35,9 +35,7 @@ License namespace Foam { - -defineTypeNameAndDebug(regionSplit, 0); - + defineTypeNameAndDebug(regionSplit, 0); } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -66,21 +64,20 @@ void Foam::regionSplit::calcNonCompactRegionSplit } } - // Seed all faces on (real) boundaries and faces on cells next to blockFace - // (since regions can only occur because of boundaries (or blocked faces)) + // Seed all faces on (real) boundaries and cell faces next to blockFace, + // since regions can only occur because of boundaries (or blocked faces) PackedBoolList isSeed(mesh().nFaces()); // Get internal or coupled faces PackedBoolList isConnection(syncTools::getInternalOrCoupledFaces(mesh())); - // 1. Seed (real) boundaries for ( label facei = mesh().nInternalFaces(); facei < mesh().nFaces(); - facei++ + ++facei ) { if (!isConnection[facei]) @@ -94,6 +91,10 @@ void Foam::regionSplit::calcNonCompactRegionSplit if (blockedFace.size()) { + label nBlockedCells = 0; + + label celli = 0; + for (const cell& cFaces : mesh().cells()) { bool blockedCell = false; @@ -113,8 +114,34 @@ void Foam::regionSplit::calcNonCompactRegionSplit if (blockedCell) { - isSeed.set(connectedFacei); // silently ignores -1 + if (connectedFacei < 0) + { + ++nBlockedCells; + + if (debug && nBlockedCells <= 10) + { + // Report a few, but not all + WarningInFunction + << "Cell " << celli << " has all faces blocked." + << endl; + } + } + else + { + isSeed.set(connectedFacei); + } } + + ++celli; + } + + reduce(nBlockedCells, sumOp