Commit ea173eea authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: isoCutCell - improved robustness. Patch provided by Johan Roenby - see #582

parent bb4a5615
......@@ -361,6 +361,23 @@ Foam::label Foam::isoCutCell::calcSubCell
// Cell cut at least at one face
cellStatus_ = 0;
calcIsoFaceCentreAndArea();
// In the rare but occuring cases where a cell is only touched at a
// point or a line the isoFaceArea_ will have zero length and here the
// cell should be treated as either completely empty or full.
if (mag(isoFaceArea_) < 10*SMALL)
{
if (fullySubFaces_.empty())
{
// Cell fully above isosurface
cellStatus_ = 1;
}
else
{
// Cell fully below isosurface
cellStatus_ = -1;
}
}
}
else if (fullySubFaces_.empty())
{
......
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