Commit a827854f authored by henry's avatar henry
Browse files

Minor change to the tolerances in the eigenvalue calculation

parent e0d3735b
......@@ -97,17 +97,17 @@ vector eigenValues(const tensor& t)
+ t.xy()*t.yx()*t.zz() + t.xx()*t.yz()*t.zy();
// If there is a zero root
if (mag(c) < SMALL)
if (mag(c) < 1.0e-100)
{
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;
ii = q;
iii = b/q;
ii = -0.5*a + q;
iii = -0.5*a - q;
}
else
{
......@@ -185,7 +185,7 @@ vector eigenValues(const tensor& t)
vector eigenVector(const tensor& t, const scalar lambda)
{
if (mag(lambda) < SMALL)
if (lambda < SMALL)
{
return vector::zero;
}
......@@ -380,7 +380,7 @@ vector eigenValues(const symmTensor& t)
vector eigenVector(const symmTensor& t, const scalar lambda)
{
if (mag(lambda) < SMALL)
if (lambda < SMALL)
{
return vector::zero;
}
......
Markdown is supported
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