ENH: Don't break on the first repeated bad faceSet.

User controlled repeat limit.
This commit is contained in:
graham
2011-01-12 14:14:45 +00:00
parent 3481fa0e3d
commit c16b47c121
4 changed files with 35 additions and 2 deletions

View File

@ -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
{

View File

@ -296,6 +296,11 @@ Foam::cvControls::cvControls
filteringDict.lookup("maxCollapseIterations")
);
maxConsecutiveEqualFaceSets_ = readLabel
(
filteringDict.lookup("maxConsecutiveEqualFaceSets")
);
surfaceStepFaceAngle_ = readScalar
(
filteringDict.lookup("surfaceStepFaceAngle")

View File

@ -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;

View File

@ -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_;