ENH: triSurface.C: avoid faceFaces() since not valid for non-manifold

This commit is contained in:
mattijs
2011-03-08 12:01:32 +00:00
parent 1b5de71f7a
commit 0008052e5b

View File

@ -211,8 +211,6 @@ void Foam::triSurface::checkTriangles(const bool verbose)
boolList valid(size(), true); boolList valid(size(), true);
bool hasInvalid = false; bool hasInvalid = false;
const labelListList& fFaces = faceFaces();
forAll(*this, faceI) forAll(*this, faceI)
{ {
const labelledTri& f = (*this)[faceI]; const labelledTri& f = (*this)[faceI];
@ -236,19 +234,23 @@ void Foam::triSurface::checkTriangles(const bool verbose)
else else
{ {
// duplicate triangle check // duplicate triangle check
const labelList& neighbours = fFaces[faceI]; const labelList& fEdges = faceEdges()[faceI];
// Check if faceNeighbours use same points as this face. // Check if faceNeighbours use same points as this face.
// Note: discards normal information - sides of baffle are merged. // Note: discards normal information - sides of baffle are merged.
forAll(neighbours, neighbourI)
forAll(fEdges, fp)
{ {
if (neighbours[neighbourI] <= faceI) const labelList& eFaces = edgeFaces()[fEdges[fp]];
forAll(eFaces, i)
{
label neighbour = eFaces[i];
if (neighbour > faceI)
{ {
// lower numbered faces already checked // lower numbered faces already checked
continue; const labelledTri& n = (*this)[neighbour];
}
const labelledTri& n = (*this)[neighbours[neighbourI]];
if if
( (
@ -272,7 +274,7 @@ void Foam::triSurface::checkTriangles(const bool verbose)
Warning Warning
<< endl << endl
<< " face 2 :" << " face 2 :"
<< neighbours[neighbourI] << endl; << neighbour << endl;
printTriangle(Warning, " ", n, points()); printTriangle(Warning, " ", n, points());
} }
@ -281,6 +283,8 @@ void Foam::triSurface::checkTriangles(const bool verbose)
} }
} }
} }
}
}
if (hasInvalid) if (hasInvalid)
{ {