mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: polyMeshFilter: Do not allow new bad faces to be created
This commit is contained in:
@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user