mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: Don't break on the first repeated bad faceSet.
User controlled repeat limit.
This commit is contained in:
@ -140,6 +140,8 @@ void Foam::conformalVoronoiMesh::calcDualMesh
|
||||
|
||||
labelHashSet lastWrongFaces;
|
||||
|
||||
label nConsecutiveEqualFaceSets = 0;
|
||||
|
||||
do
|
||||
{
|
||||
// Reindexing the Delaunay cells and regenerating the
|
||||
@ -177,9 +179,21 @@ void Foam::conformalVoronoiMesh::calcDualMesh
|
||||
if (lastWrongFaces == wrongFaces)
|
||||
{
|
||||
Info<< nl << "Consecutive iterations found the same set "
|
||||
<< "of bad quality faces, stopping filtering" << endl;
|
||||
<< "of bad quality faces." << endl;
|
||||
|
||||
break;
|
||||
if
|
||||
(
|
||||
++nConsecutiveEqualFaceSets
|
||||
>= cvMeshControls().maxConsecutiveEqualFaceSets()
|
||||
)
|
||||
{
|
||||
Info<< nl << nConsecutiveEqualFaceSets
|
||||
<< " consecutive iterations produced the same "
|
||||
<< " bad quality faceSet, stopping filtering"
|
||||
<< endl;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -296,6 +296,11 @@ Foam::cvControls::cvControls
|
||||
filteringDict.lookup("maxCollapseIterations")
|
||||
);
|
||||
|
||||
maxConsecutiveEqualFaceSets_ = readLabel
|
||||
(
|
||||
filteringDict.lookup("maxConsecutiveEqualFaceSets")
|
||||
);
|
||||
|
||||
surfaceStepFaceAngle_ = readScalar
|
||||
(
|
||||
filteringDict.lookup("surfaceStepFaceAngle")
|
||||
|
||||
@ -242,6 +242,11 @@ class cvControls
|
||||
// around it need to be collapsed.
|
||||
label maxCollapseIterations_;
|
||||
|
||||
//- Maximum number of times an to allow an equal faceSet to be
|
||||
// returned from the face quality assessment before stopping iterations
|
||||
// to break an infinitie loop.
|
||||
label maxConsecutiveEqualFaceSets_;
|
||||
|
||||
//- The maximum allowed angle between a boundary face normal and the
|
||||
// local surface normal before face will be aggressively collapsed
|
||||
scalar surfaceStepFaceAngle_;
|
||||
@ -387,6 +392,9 @@ public:
|
||||
//- Return the maxCollapseIterations
|
||||
inline label maxCollapseIterations() const;
|
||||
|
||||
//- Return the maxConsecutiveEqualFaceSets
|
||||
inline label maxConsecutiveEqualFaceSets() const;
|
||||
|
||||
//- Return the filterCountSkipThreshold
|
||||
inline label filterCountSkipThreshold() const;
|
||||
|
||||
|
||||
@ -170,6 +170,12 @@ inline Foam::label Foam::cvControls::maxCollapseIterations() const
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::cvControls::maxConsecutiveEqualFaceSets() const
|
||||
{
|
||||
return maxConsecutiveEqualFaceSets_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::cvControls::surfaceStepFaceAngle() const
|
||||
{
|
||||
return surfaceStepFaceAngle_;
|
||||
|
||||
Reference in New Issue
Block a user