mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: triSurface.C: avoid faceFaces() since not valid for non-manifold
This commit is contained in:
@ -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,47 +234,53 @@ 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)
|
||||||
{
|
{
|
||||||
// lower numbered faces already checked
|
label neighbour = eFaces[i];
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const labelledTri& n = (*this)[neighbours[neighbourI]];
|
if (neighbour > faceI)
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
((f[0] == n[0]) || (f[0] == n[1]) || (f[0] == n[2]))
|
|
||||||
&& ((f[1] == n[0]) || (f[1] == n[1]) || (f[1] == n[2]))
|
|
||||||
&& ((f[2] == n[0]) || (f[2] == n[1]) || (f[2] == n[2]))
|
|
||||||
)
|
|
||||||
{
|
|
||||||
valid[faceI] = false;
|
|
||||||
hasInvalid = true;
|
|
||||||
|
|
||||||
if (verbose)
|
|
||||||
{
|
{
|
||||||
WarningIn
|
// lower numbered faces already checked
|
||||||
|
const labelledTri& n = (*this)[neighbour];
|
||||||
|
|
||||||
|
if
|
||||||
(
|
(
|
||||||
"triSurface::checkTriangles(bool verbose)"
|
((f[0] == n[0]) || (f[0] == n[1]) || (f[0] == n[2]))
|
||||||
) << "triangles share the same vertices:\n"
|
&& ((f[1] == n[0]) || (f[1] == n[1]) || (f[1] == n[2]))
|
||||||
<< " face 1 :" << faceI << endl;
|
&& ((f[2] == n[0]) || (f[2] == n[1]) || (f[2] == n[2]))
|
||||||
printTriangle(Warning, " ", f, points());
|
)
|
||||||
|
{
|
||||||
|
valid[faceI] = false;
|
||||||
|
hasInvalid = true;
|
||||||
|
|
||||||
Warning
|
if (verbose)
|
||||||
<< endl
|
{
|
||||||
<< " face 2 :"
|
WarningIn
|
||||||
<< neighbours[neighbourI] << endl;
|
(
|
||||||
printTriangle(Warning, " ", n, points());
|
"triSurface::checkTriangles(bool verbose)"
|
||||||
|
) << "triangles share the same vertices:\n"
|
||||||
|
<< " face 1 :" << faceI << endl;
|
||||||
|
printTriangle(Warning, " ", f, points());
|
||||||
|
|
||||||
|
Warning
|
||||||
|
<< endl
|
||||||
|
<< " face 2 :"
|
||||||
|
<< neighbour << endl;
|
||||||
|
printTriangle(Warning, " ", n, points());
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user