Switching on/off polyhedral refinement engine
This commit is contained in:
parent
fe2911f9e3
commit
6e33ee25f0
1 changed files with 15 additions and 2 deletions
|
@ -134,7 +134,8 @@ bool dynamicPolyRefinementFvMesh::update()
|
|||
polyhedralRefinement& polyRefModifier =
|
||||
refCast<polyhedralRefinement>(topoChanger_[0]);
|
||||
|
||||
// Get refinement candidates from refinement selection algorithm
|
||||
// Get refinement candidates from refinement selection algorithm. Note:
|
||||
// return type is Xfer<labelList> 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<labelList> 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<mapPolyMesh> topoChangeMap = topoChanger_.changeMesh();
|
||||
|
||||
|
|
Reference in a new issue