diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C index d7daba5486..a3f38112c8 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C @@ -860,16 +860,62 @@ Foam::labelList Foam::dynamicRefineFvMesh::selectUnrefinePoints // All points that can be unrefined const labelList splitPoints(meshCutter_.getSplitPoints()); + + const labelListList& pointCells = this->pointCells(); + + // If we have any protected cells make sure they also are not being + // unrefined + + PackedBoolList protectedPoint(nPoints()); + + if (protectedCell_.size()) + { + // Get all points on a protected cell + forAll(pointCells, pointI) + { + const labelList& pCells = pointCells[pointI]; + + forAll(pCells, pCellI) + { + label cellI = pCells[pCellI]; + + if (protectedCell_[cellI]) + { + protectedPoint[pointI] = true; + break; + } + } + } + + syncTools::syncPointList + ( + *this, + protectedPoint, + orEqOp(), + 0U + ); + + if (debug) + { + Info<< "From " + << returnReduce(protectedCell_.count(), sumOp