Commit 1b46e051 authored by mattijs's avatar mattijs
Browse files

BUG: allowed sliver triangle to be collapsed down to illegal 2 vertex face.

Added simple check to disable collapsing faces to <3 vertices.
parent 0b1fc8e0
......@@ -203,12 +203,45 @@ Foam::label Foam::removePoints::countPointUsage
pointCanBeDeleted[pointI] = true;
nDeleted++;
}
}
edge0.clear();
edge1.clear();
// Protect any points on faces that would collapse down to nothing
// No particular intelligence so might protect too many points
forAll(mesh_.faces(), faceI)
{
const face& f = mesh_.faces()[faceI];
label nCollapse = 0;
forAll(f, fp)
{
if (pointCanBeDeleted[f[fp]])
{
nCollapse++;
}
}
if ((f.size() - nCollapse) < 3)
{
// Just unmark enough points
forAll(f, fp)
{
if (pointCanBeDeleted[f[fp]])
{
pointCanBeDeleted[f[fp]] = false;
--nCollapse;
if (nCollapse == 0)
{
break;
}
}
}
}
}
// Point can be deleted only if all processors want to delete it
syncTools::syncPointList
(
......
Supports Markdown
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