Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -203,12 +203,45 @@ Foam::label Foam::removePoints::countPointUsage ...@@ -203,12 +203,45 @@ Foam::label Foam::removePoints::countPointUsage
pointCanBeDeleted[pointI] = true; pointCanBeDeleted[pointI] = true;
nDeleted++; nDeleted++;
} }
} }
edge0.clear(); edge0.clear();
edge1.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 // Point can be deleted only if all processors want to delete it
syncTools::syncPointList syncTools::syncPointList
( (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment