triIntersect: Prevent generation of partial topology for failed intersections

This commit is contained in:
Will Bainbridge
2023-12-28 12:08:31 +00:00
parent 4ec2510b59
commit 62d5798ad7
2 changed files with 17 additions and 8 deletions

View File

@ -410,8 +410,13 @@ bool Foam::patchToPatches::intersection::intersectFaces
else
{
FatalErrorInFunction
<< "Tri-intersection topology not recognised. "
<< "This is a bug." << exit(FatalError);
<< "The intersection topology " << ictPointLocations_
<< " between triangle #" << srcFaceTrii
<< " of source face #" << srcFacei
<< " and triangle #" << tgtFaceTrii
<< " of target face #" << tgtFacei
<< " was not recognised. This is a bug."
<< exit(FatalError);
}
// Store the projected edge quadrilateral for debugging

View File

@ -1759,10 +1759,8 @@ void Foam::triIntersect::intersectTris
if (l.isIntersection() || l.isSrcAndTgtPoint())
{
if (!addPointLocations(l, location(), false))
{
pointLocations.clear();
}
haveIntersection =
addPointLocations(l, location(), false);
}
}
else
@ -1774,7 +1772,13 @@ void Foam::triIntersect::intersectTris
}
}
// Step 6: The above walk was done around the target triangle, but the
// Step 6: Make sure no points are generated if the intersection has failed
if (!haveIntersection)
{
pointLocations.clear();
}
// Step 7: The above walk was done around the target triangle, but the
// result should be ordered in the direction of the source triangle, so the
// list of locations must be reversed
inplaceReverseList(pointLocations);
@ -1784,7 +1788,7 @@ void Foam::triIntersect::intersectTris
Info<< indent << "pointLocations=" << pointLocations << endl;
}
// Step 7: Generate the geometry
// Step 8: Generate the geometry
generateGeometryForLocations
(
srcPs,