STYLE: use vector::magSqr when checking size

This commit is contained in:
Mark Olesen
2023-01-24 14:40:06 +01:00
parent 2faf361354
commit 911c28f17d
2 changed files with 6 additions and 6 deletions

View File

@ -109,7 +109,7 @@ Foam::tmp<Foam::edgeScalarField> Foam::faNVDscheme<Type,NVDweight>::weights
d *= mesh.edgeInterpolation::lPN().internalField()[edge];
// Do not allow any mag(val) < SMALL
if (mag(d) < SMALL)
if (d.magSqr() < ROOTSMALL)
{
d = vector::uniform(SMALL);
}
@ -196,7 +196,7 @@ Foam::tmp<Foam::edgeScalarField> Foam::faNVDscheme<Type,NVDweight>::weights
d *= pLPN[edgeI];
// Do not allow any mag(val) < SMALL
if (mag(d) < SMALL)
if (d.magSqr() < ROOTSMALL)
{
d = vector::uniform(SMALL);
}