ENH: distinguish between face areaNormal/unitNormal in the code

This commit is contained in:
Mark Olesen
2018-08-10 15:43:06 +02:00
parent b81a2f2fa6
commit c1964d7807
52 changed files with 200 additions and 256 deletions

View File

@ -92,9 +92,9 @@ Foam::label Foam::oldCyclicPolyPatch::findMaxArea
forAll(faces, facei)
{
scalar areaSqr = magSqr(faces[facei].normal(points));
scalar areaSqr = magSqr(faces[facei].areaNormal(points));
if (areaSqr > maxAreaSqr)
if (maxAreaSqr < areaSqr)
{
maxAreaSqr = areaSqr;
maxI = facei;
@ -359,12 +359,10 @@ void Foam::oldCyclicPolyPatch::getCentresAndAnchors
// Determine the face with max area on both halves. These
// two faces are used to determine the transformation tensors
label max0I = findMaxArea(pp.points(), half0Faces);
vector n0 = half0Faces[max0I].normal(pp.points());
n0 /= mag(n0) + VSMALL;
const vector n0 = half0Faces[max0I].unitNormal(pp.points());
label max1I = findMaxArea(pp.points(), half1Faces);
vector n1 = half1Faces[max1I].normal(pp.points());
n1 /= mag(n1) + VSMALL;
const vector n1 = half1Faces[max1I].unitNormal(pp.points());
if (mag(n0 & n1) < 1-matchTolerance())
{