Skip to content
Snippets Groups Projects
Commit 3e219bf9 authored by laurence's avatar laurence
Browse files

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

parent dbcb3812
Branches
Tags
No related merge requests found
......@@ -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
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment