Skip to content
Snippets Groups Projects
Commit 79475c87 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev

parents 727d16e9 a827854f
Branches
Tags
No related merge requests found
...@@ -97,17 +97,17 @@ vector eigenValues(const tensor& t) ...@@ -97,17 +97,17 @@ vector eigenValues(const tensor& t)
+ t.xy()*t.yx()*t.zz() + t.xx()*t.yz()*t.zy(); + t.xy()*t.yx()*t.zz() + t.xx()*t.yz()*t.zy();
// If there is a zero root // If there is a zero root
if (mag(c) < SMALL) if (mag(c) < 1.0e-100)
{ {
scalar disc = sqr(a) - 4*b; scalar disc = sqr(a) - 4*b;
if (disc > 0) if (disc >= -SMALL)
{ {
scalar q = -0.5*(a + sign(a)*sqrt(disc)); scalar q = -0.5*sqrt(max(0.0, disc));
i = 0; i = 0;
ii = q; ii = -0.5*a + q;
iii = b/q; iii = -0.5*a - q;
} }
else else
{ {
...@@ -185,7 +185,7 @@ vector eigenValues(const tensor& t) ...@@ -185,7 +185,7 @@ vector eigenValues(const tensor& t)
vector eigenVector(const tensor& t, const scalar lambda) vector eigenVector(const tensor& t, const scalar lambda)
{ {
if (mag(lambda) < SMALL) if (lambda < SMALL)
{ {
return vector::zero; return vector::zero;
} }
...@@ -380,7 +380,7 @@ vector eigenValues(const symmTensor& t) ...@@ -380,7 +380,7 @@ vector eigenValues(const symmTensor& t)
vector eigenVector(const symmTensor& t, const scalar lambda) vector eigenVector(const symmTensor& t, const scalar lambda)
{ {
if (mag(lambda) < SMALL) if (lambda < SMALL)
{ {
return vector::zero; return vector::zero;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment