Commit 9552221d authored by graham's avatar graham
Browse files

STLYE: Making triangle and tetrahedron less verbose.

No warnings on recoverable degeneracies.
parent 916e81de
...@@ -156,10 +156,7 @@ inline Point tetrahedron<Point, PointRef>::circumCentre() const ...@@ -156,10 +156,7 @@ inline Point tetrahedron<Point, PointRef>::circumCentre() const
if (Foam::mag(denom) < ROOTVSMALL) if (Foam::mag(denom) < ROOTVSMALL)
{ {
WarningIn("Point tetrahedron<Point, PointRef>::circumCentre() const") // Degenerate tetrahedron, returning centre instead of circumCentre.
<< "Degenerate tetrahedron:" << nl << *this << nl
<<"Returning centre instead of circumCentre."
<< endl;
return centre(); return centre();
} }
...@@ -186,10 +183,7 @@ inline scalar tetrahedron<Point, PointRef>::circumRadius() const ...@@ -186,10 +183,7 @@ inline scalar tetrahedron<Point, PointRef>::circumRadius() const
if (Foam::mag(denom) < ROOTVSMALL) if (Foam::mag(denom) < ROOTVSMALL)
{ {
WarningIn("Point tetrahedron<Point, PointRef>::circumCentre() const") // Degenerate tetrahedron, returning GREAT for circumRadius.
<< "Degenerate tetrahedron:" << nl << *this << nl
<< "Returning GREAT for circumRadius."
<< endl;
return GREAT; return GREAT;
} }
...@@ -269,16 +263,7 @@ scalar tetrahedron<Point, PointRef>::barycentric ...@@ -269,16 +263,7 @@ scalar tetrahedron<Point, PointRef>::barycentric
if (Foam::mag(detT) < SMALL) if (Foam::mag(detT) < SMALL)
{ {
WarningIn // Degenerate tetrahedron, returning 1/4 barycentric coordinates.
(
"List<scalar> tetrahedron<Point, PointRef>::barycentric"
"("
"const point& pt"
") const"
)
<< "Degenerate tetrahedron:" << nl << *this << nl
<< "Returning 1/4 barycentric coordinates."
<< endl;
bary = List<scalar>(4, 0.25); bary = List<scalar>(4, 0.25);
......
...@@ -121,10 +121,7 @@ inline Point triangle<Point, PointRef>::circumCentre() const ...@@ -121,10 +121,7 @@ inline Point triangle<Point, PointRef>::circumCentre() const
if (Foam::mag(c) < ROOTVSMALL) if (Foam::mag(c) < ROOTVSMALL)
{ {
WarningIn("Point triangle<Point, PointRef>::circumCentre() const") // Degenerate triangle, returning centre instead of circumCentre.
<< "Degenerate triangle:" << nl << *this << nl
<< "Returning centre instead of circumCentre."
<< endl;
return centre(); return centre();
} }
...@@ -147,10 +144,7 @@ inline scalar triangle<Point, PointRef>::circumRadius() const ...@@ -147,10 +144,7 @@ inline scalar triangle<Point, PointRef>::circumRadius() const
if (Foam::mag(denom) < VSMALL) if (Foam::mag(denom) < VSMALL)
{ {
WarningIn("scalar triangle<Point, PointRef>::circumRadius() const") // Degenerate triangle, returning GREAT for circumRadius.
<< "Degenerate triangle:" << nl << *this << nl
<< "Returning GREAT for circumRadius."
<< endl;
return GREAT; return GREAT;
} }
...@@ -263,16 +257,7 @@ scalar triangle<Point, PointRef>::barycentric ...@@ -263,16 +257,7 @@ scalar triangle<Point, PointRef>::barycentric
if (Foam::mag(denom) < SMALL) if (Foam::mag(denom) < SMALL)
{ {
WarningIn // Degenerate triangle, returning 1/3 barycentric coordinates.
(
"List<scalar> triangle<Point, PointRef>::barycentric"
"("
"const point& pt"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "Returning 1/3 barycentric coordinates."
<< endl;
bary = List<scalar>(3, 1.0/3.0); bary = List<scalar>(3, 1.0/3.0);
...@@ -537,20 +522,7 @@ pointHit triangle<Point, PointRef>::nearestPointClassify ...@@ -537,20 +522,7 @@ pointHit triangle<Point, PointRef>::nearestPointClassify
{ {
if ((d1 - d3) < ROOTVSMALL) if ((d1 - d3) < ROOTVSMALL)
{ {
WarningIn // Degenerate triangle, for d1 = d3, a_ and b_ are likely coincident
(
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "d1, d3: " << d1 << ", " << d3 << endl;
// For d1 = d3, a_ and b_ are likely coincident.
nearType = POINT; nearType = POINT;
nearLabel = 0; nearLabel = 0;
return pointHit(false, a_, Foam::mag(a_ - p), true); return pointHit(false, a_, Foam::mag(a_ - p), true);
...@@ -586,20 +558,7 @@ pointHit triangle<Point, PointRef>::nearestPointClassify ...@@ -586,20 +558,7 @@ pointHit triangle<Point, PointRef>::nearestPointClassify
{ {
if ((d2 - d6) < ROOTVSMALL) if ((d2 - d6) < ROOTVSMALL)
{ {
WarningIn // Degenerate triangle, for d2 = d6, a_ and c_ are likely coincident
(
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "d2, d6: " << d2 << ", " << d6 << endl;
// For d2 = d6, a_ and c_ are likely coincident.
nearType = POINT; nearType = POINT;
nearLabel = 0; nearLabel = 0;
return pointHit(false, a_, Foam::mag(a_ - p), true); return pointHit(false, a_, Foam::mag(a_ - p), true);
...@@ -621,21 +580,8 @@ pointHit triangle<Point, PointRef>::nearestPointClassify ...@@ -621,21 +580,8 @@ pointHit triangle<Point, PointRef>::nearestPointClassify
{ {
if (((d4 - d3) + (d5 - d6)) < ROOTVSMALL) if (((d4 - d3) + (d5 - d6)) < ROOTVSMALL)
{ {
WarningIn // Degenerate triangle, for (d4 - d3) = (d6 - d5), b_ and c_ are
( // likely coincident
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "(d4 - d3), (d6 - d5): " << (d4 - d3) << ", " << (d6 - d5)
<< endl;
// For (d4 - d3) = (d6 - d5), b_ and c_ are likely coincident.
nearType = POINT; nearType = POINT;
nearLabel = 1; nearLabel = 1;
return pointHit(false, b_, Foam::mag(b_ - p), true); return pointHit(false, b_, Foam::mag(b_ - p), true);
...@@ -655,19 +601,8 @@ pointHit triangle<Point, PointRef>::nearestPointClassify ...@@ -655,19 +601,8 @@ pointHit triangle<Point, PointRef>::nearestPointClassify
if ((va + vb + vc) < ROOTVSMALL) if ((va + vb + vc) < ROOTVSMALL)
{ {
WarningIn // Degenerate triangle, return the centre because no edge or points are
( // closest
"pointHit triangle<Point, PointRef>::nearestPointClassify"
"("
"const point& p,"
"label& nearType,"
"label& nearLabel"
") const"
)
<< "Degenerate triangle:" << nl << *this << nl
<< "va, vb, vc: " << va << ", " << vb << ", " << vc
<< endl;
point nearPt = centre(); point nearPt = centre();
nearType = NONE, nearType = NONE,
nearLabel = -1; nearLabel = -1;
......
Markdown is supported
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