ENH: use vector::normalise and VectorSpace::normalised for clarity

This commit is contained in:
Mark Olesen
2018-08-10 15:18:29 +02:00
parent c1964d7807
commit 4d6f0498d6
75 changed files with 302 additions and 354 deletions

View File

@ -1498,8 +1498,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles
const face& f = fcs[facei];
vector faceNormal = faceAreas[facei];
faceNormal /= mag(faceNormal) + VSMALL;
const vector faceNormal = normalised(faceAreas[facei]);
// Get edge from f[0] to f[size-1];
vector ePrev(p[f.first()] - p[f.last()]);
@ -1692,20 +1691,30 @@ bool Foam::polyMeshGeometry::checkFaceTwist
if (mesh.isInternalFace(facei))
{
nf = cellCentres[nei[facei]] - cellCentres[own[facei]];
nf /= mag(nf) + VSMALL;
nf =
normalised
(
cellCentres[nei[facei]]
- cellCentres[own[facei]]
);
}
else if (patches[patches.whichPatch(facei)].coupled())
{
nf =
neiCc[facei-mesh.nInternalFaces()]
- cellCentres[own[facei]];
nf /= mag(nf) + VSMALL;
normalised
(
neiCc[facei-mesh.nInternalFaces()]
- cellCentres[own[facei]]
);
}
else
{
nf = faceCentres[facei] - cellCentres[own[facei]];
nf /= mag(nf) + VSMALL;
nf =
normalised
(
faceCentres[facei]
- cellCentres[own[facei]]
);
}
if (nf != vector::zero)