mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user