ENH: polyMeshFilter: Do not allow new bad faces to be created

This commit is contained in:
laurence
2013-06-06 10:38:25 +01:00
parent dbcb3812d6
commit 3e219bf9fc

View File

@ -550,6 +550,16 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
// Maintain the number of times a point has been part of a bad face // Maintain the number of times a point has been part of a bad face
labelList pointErrorCount(mesh_.nPoints(), 0); labelList pointErrorCount(mesh_.nPoints(), 0);
PackedBoolList newErrorPoint(mesh_.nPoints());
nBadFaces = edgeCollapser::checkMeshQuality
(
mesh_,
meshQualityCoeffDict_,
newErrorPoint
);
bool newBadFaces = false;
// Main loop // Main loop
// ~~~~~~~~~ // ~~~~~~~~~
// It tries and do some collapses, checks the resulting mesh and // It tries and do some collapses, checks the resulting mesh and
@ -560,6 +570,7 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
( (
nOuterIterations < maxIterations_ nOuterIterations < maxIterations_
&& nBadFaces > nOriginalBadFaces && nBadFaces > nOriginalBadFaces
&& !newBadFaces
) )
{ {
Info<< nl << "Outer Iteration = " << nOuterIterations++ << nl Info<< nl << "Outer Iteration = " << nOuterIterations++ << nl
@ -902,6 +913,19 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
isErrorPoint, isErrorPoint,
pointErrorCount pointErrorCount
); );
newBadFaces = false;
forAll(mesh_.points(), pI)
{
if (isErrorPoint[origToCurrentPointMap[pI]])
{
if (newErrorPoint[pI] == false)
{
newBadFaces = true;
break;
}
}
}
} }
else else
{ {