ENH: triSurfaceTools: restore cvm changes

This commit is contained in:
mattijs
2011-07-21 14:03:54 +01:00
parent 7ca505ce1b
commit a846b2203f

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -2212,31 +2212,26 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
// Nearest to face interior. Use faceNormal to determine side // Nearest to face interior. Use faceNormal to determine side
scalar c = sampleNearestVec & surf.faceNormals()[nearestFaceI]; scalar c = sampleNearestVec & surf.faceNormals()[nearestFaceI];
// If the sample is essentially on the face, do not check for // // If the sample is essentially on the face, do not check for
// it being perpendicular. // // it being perpendicular.
// if (debug)
// {
// scalar magSampleNearestVec = mag(sampleNearestVec); // scalar magSampleNearestVec = mag(sampleNearestVec);
// if (magSampleNearestVec > SMALL) // if (magSampleNearestVec > SMALL)
// { // {
// c /= // c /= magSampleNearestVec*mag(surf.faceNormals()[nearestFaceI]);
// magSampleNearestVec
// *mag(surf.faceNormals()[nearestFaceI]);
// if (mag(c) < 0.99) // if (mag(c) < 0.99)
// { // {
// WarningIn("triSurfaceTools::surfaceSide") // FatalErrorIn("triSurfaceTools::surfaceSide")
// << "nearestPoint identified as being on triangle " // << "nearestPoint identified as being on triangle face "
// << "face but vector from nearestPoint to sample is " // << "but vector from nearestPoint to sample is not "
// << "not perpendicular to the normal." << nl // << "perpendicular to the normal." << nl
// << "sample: " << sample << nl // << "sample: " << sample << nl
// << "nearestPoint: " << nearestPoint << nl // << "nearestPoint: " << nearestPoint << nl
// << "sample - nearestPoint: " // << "sample - nearestPoint: "
// << sample - nearestPoint << nl // << sample - nearestPoint << nl
// << "normal: " // << "normal: " << surf.faceNormals()[nearestFaceI] << nl
// << surf.faceNormals()[nearestFaceI] << nl
// << "mag(sample - nearestPoint): " // << "mag(sample - nearestPoint): "
// << mag(sample - nearestPoint) << nl // << mag(sample - nearestPoint) << nl
// << "normalised dot product: " << c << nl // << "normalised dot product: " << c << nl
@ -2244,8 +2239,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
// << " " << points[f[0]] << nl // << " " << points[f[0]] << nl
// << " " << points[f[1]] << nl // << " " << points[f[1]] << nl
// << " " << points[f[2]] << nl // << " " << points[f[2]] << nl
// << endl;; // << abort(FatalError);
// }
// } // }
// } // }
@ -2267,26 +2261,26 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
label edgeI = surf.faceEdges()[nearestFaceI][nearLabel]; label edgeI = surf.faceEdges()[nearestFaceI][nearLabel];
// if (debug) // if (debug)
{ // {
// Check order of faceEdges same as face vertices. // // Check order of faceEdges same as face vertices.
const edge& e = surf.edges()[edgeI]; // const edge& e = surf.edges()[edgeI];
const labelList& meshPoints = surf.meshPoints(); // const labelList& meshPoints = surf.meshPoints();
const edge meshEdge(meshPoints[e[0]], meshPoints[e[1]]); // const edge meshEdge(meshPoints[e[0]], meshPoints[e[1]]);
if // if
( // (
meshEdge // meshEdge
!= edge(f[nearLabel], f[f.fcIndex(nearLabel)]) // != edge(f[nearLabel], f[f.fcIndex(nearLabel)])
) // )
{ // {
FatalErrorIn("triSurfaceTools::surfaceSide") // FatalErrorIn("triSurfaceTools::surfaceSide")
<< "Edge:" << edgeI << " local vertices:" << e // << "Edge:" << edgeI << " local vertices:" << e
<< " mesh vertices:" << meshEdge // << " mesh vertices:" << meshEdge
<< " not at position " << nearLabel // << " not at position " << nearLabel
<< " in face " << f // << " in face " << f
<< abort(FatalError); // << abort(FatalError);
} // }
} // }
return edgeSide(surf, sample, nearestPoint, edgeI); return edgeSide(surf, sample, nearestPoint, edgeI);
} }