BUG: triSurfaceTools::surfaceSide. When the sample is essentially on

the surface and not on an edge or point, do not check that the line
between the sample and the nearest point is parallel to the normal.
This commit is contained in:
graham 2010-02-23 17:23:06 +00:00
parent c0ba0228e3
commit bf877c0e56

View File

@ -2220,14 +2220,19 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
if (nearType == triPointRef::NONE)
{
// Nearest to face interior. Use faceNormal to determine side
scalar c = (sample - nearestPoint) & surf.faceNormals()[nearestFaceI];
vector sampleNearestVec = (sample - nearestPoint);
c /= max
(
VSMALL,
mag(sample - nearestPoint)*mag(surf.faceNormals()[nearestFaceI])
);
scalar magSampleNearestVec = mag(sampleNearestVec);
// Nearest to face interior. Use faceNormal to determine side
scalar c = sampleNearestVec & surf.faceNormals()[nearestFaceI];
// If the sample is essentially on the face, do not check for
// it being perpendicular.
if (magSampleNearestVec > SMALL)
{
c /= magSampleNearestVec*mag(surf.faceNormals()[nearestFaceI]);
if (mag(c) < 0.9)
{
@ -2248,6 +2253,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
<< " " << points[f[2]] << nl
<< abort(FatalError);
}
}
if (c > 0)
{