99 - t.
xx() - t.
yy() - t.
zz();
113 scalar P = (a*a - 3*
b)/9;
116 scalar Q = (2*a*a*a - 9*a*b + 27*
c)/54;
120 if (
mag(P) < SMALL &&
mag(Q) < SMALL)
122 return vector(- aBy3, - aBy3, - aBy3);
126 else if (
mag(PPP/QQ - 1) < SMALL)
128 scalar sqrtP =
sqrt(P);
129 scalar signQ =
sign(Q);
131 i = ii = signQ*sqrtP - aBy3;
132 iii = - 2*signQ*sqrtP - aBy3;
138 scalar sqrtP =
sqrt(P);
142 i = - 2*sqrtP*value - aBy3;
143 ii = sqrtP*(value +
delta) - aBy3;
144 iii = sqrtP*(value -
delta) - aBy3;
152 <<
"complex eigenvalues detected for tensor: " << t
161 scalar w =
cbrt(- Q -
sqrt(QQ - PPP));
165 return vector(-VGREAT, i, VGREAT);
185 return vector(i, ii, iii);
198 vector oldDirection(direction);
199 scalar temp = direction[2];
200 direction[2] = direction[1];
201 direction[1] = direction[0];
208 scalar sd0, sd1, sd2;
209 scalar magSd0, magSd1, magSd2;
212 sd0 = A.
yy()*A.
zz() - A.
yz()*A.
zy();
213 sd1 = A.
zz()*A.
xx() - A.
zx()*A.
xz();
214 sd2 = A.
xx()*A.
yy() - A.
xy()*A.
yx();
220 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > SMALL)
225 (A.
yz()*A.
zx() - A.
zz()*A.
yx())/sd0,
231 else if (magSd1 >= magSd2 && magSd1 > SMALL)
235 (A.
xz()*A.
zy() - A.
zz()*A.
xy())/sd1,
242 else if (magSd2 > SMALL)
246 (A.
xy()*A.
yz() - A.
yy()*A.
xz())/sd2,
247 (A.
yx()*A.
xz() - A.
xx()*A.
yz())/sd2,
255 sd0 = A.
yy()*direction.
z() - A.
yz()*direction.
y();
256 sd1 = A.
zz()*direction.
x() - A.
zx()*direction.
z();
257 sd2 = A.
xx()*direction.
y() - A.
xy()*direction.
x();
263 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > SMALL)
268 (A.
yz()*direction.
x() - direction.
z()*A.
yx())/sd0,
269 (direction.
y()*A.
yx() - A.
yy()*direction.
x())/sd0
274 else if (magSd1 >= magSd2 && magSd1 > SMALL)
278 (direction.
z()*A.
zy() - A.
zz()*direction.
y())/sd1,
280 (A.
zx()*direction.
y() - direction.
x()*A.
zy())/sd1
285 else if (magSd2 > SMALL)
289 (A.
xy()*direction.
z() - direction.
y()*A.
xz())/sd2,
290 (direction.
x()*A.
xz() - A.
xx()*direction.
z())/sd2,
dimensionedScalar sign(const dimensionedScalar &ds)
static const char *const typeName
dimensionedScalar acos(const dimensionedScalar &ds)
static const char *const componentNames[]
dimensionedVector eigenValues(const dimensionedTensor &dt)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const Form rootMax
Vector< scalar > vector
A scalar version of the templated Vector.
static const Form rootMin
dimensionedScalar cos(const dimensionedScalar &ds)
static const Identity< scalar > I
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
dimensionedScalar cbrt(const dimensionedScalar &ds)
dimensionedTensor eigenVectors(const dimensionedTensor &dt)
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
static Tensor< scalar > uniform(const scalar &s)
Return a VectorSpace with all elements = s.
dimensioned< scalar > mag(const dimensioned< Type > &)
vector eigenVector(const tensor &, const scalar lambda)
Tensor< scalar > tensor
Tensor of scalars.