diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C index a04890d59b..17651c1784 100644 --- a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C +++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C @@ -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 labelList pointErrorCount(mesh_.nPoints(), 0); + PackedBoolList newErrorPoint(mesh_.nPoints()); + nBadFaces = edgeCollapser::checkMeshQuality + ( + mesh_, + meshQualityCoeffDict_, + newErrorPoint + ); + + bool newBadFaces = false; + // Main loop // ~~~~~~~~~ // 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_ && nBadFaces > nOriginalBadFaces + && !newBadFaces ) { Info<< nl << "Outer Iteration = " << nOuterIterations++ << nl @@ -902,6 +913,19 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces) isErrorPoint, pointErrorCount ); + + newBadFaces = false; + forAll(mesh_.points(), pI) + { + if (isErrorPoint[origToCurrentPointMap[pI]]) + { + if (newErrorPoint[pI] == false) + { + newBadFaces = true; + break; + } + } + } } else {