tensor::eigenValues: Test the magnitude of 'QQ' before dividing by it.

Resolves bug-report http://bugs.openfoam.org/view.php?id=2351
This commit is contained in:
Henry Weller
2016-11-26 20:49:54 +00:00
parent e402e5d4b2
commit 4eaa06a60f

View File

@ -123,7 +123,7 @@ Foam::vector Foam::eigenValues(const tensor& t)
}
// Two identical roots and one distinct root
else if (mag(PPP/QQ - 1) < SMALL)
else if (mag(QQ) > SMALL && mag(PPP/QQ - 1) < SMALL)
{
scalar sqrtP = sqrt(P);
scalar signQ = sign(Q);