From 6e33ee25f0c151fef467ecf3287c9cc3c11cce26 Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Fri, 12 Jan 2018 15:59:06 +0100 Subject: [PATCH] Switching on/off polyhedral refinement engine --- .../dynamicPolyRefinementFvMesh.C | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C index d6c319c2d..9eee3187e 100644 --- a/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/dynamicPolyRefinementFvMesh/dynamicPolyRefinementFvMesh.C @@ -134,7 +134,8 @@ bool dynamicPolyRefinementFvMesh::update() polyhedralRefinement& polyRefModifier = refCast(topoChanger_[0]); - // Get refinement candidates from refinement selection algorithm + // Get refinement candidates from refinement selection algorithm. Note: + // return type is Xfer so there's no copying const labelList refCandidates ( refinementSelectionPtr_->refinementCellCandidates() @@ -144,7 +145,8 @@ bool dynamicPolyRefinementFvMesh::update() // point consistent refinement is performed polyRefModifier.setCellsToRefine(refCandidates); - // Get unrefinement point candidates from refinement selection algorithm + // Get unrefinement point candidates from refinement selection + // algorithm. Note: return type is Xfer so there's no copying const labelList unrefCandidates ( refinementSelectionPtr_->unrefinementPointCandidates() @@ -155,6 +157,17 @@ bool dynamicPolyRefinementFvMesh::update() // unrefinement polyRefModifier.setSplitPointsToUnrefine(unrefCandidates); + // Activate the polyhedral refinement engine if there are some cells to + // refine or there are some split points to unrefine around + if (!refCandidates.empty() || !unrefCandidates.empty()) + { + polyRefModifier.enable(); + } + else + { + polyRefModifier.disable(); + } + // Perform refinement and unrefinement in one go autoPtr topoChangeMap = topoChanger_.changeMesh();