78 - t.
xx() - t.
yy() - t.
zz();
94 switch (roots.
type(i))
101 <<
"Complex eigenvalues detected for tensor: " << t
109 lambda[i] = - vGreat;
113 <<
"Eigenvalue calculation failed for tensor: " << t
119 if (lambda.
x() > lambda.
y())
121 Swap(lambda.
x(), lambda.
y());
123 if (lambda.
y() > lambda.
z())
125 Swap(lambda.
y(), lambda.
z());
127 if (lambda.
x() > lambda.
y())
129 Swap(lambda.
x(), lambda.
y());
148 scalar sd0, sd1, sd2;
149 scalar magSd0, magSd1, magSd2;
152 sd0 = A.
yy()*A.
zz() - A.
yz()*A.
zy();
153 sd1 = A.
zz()*A.
xx() - A.
zx()*A.
xz();
154 sd2 = A.
xx()*A.
yy() - A.
xy()*A.
yx();
160 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
165 (A.
yz()*A.
zx() - A.
zz()*A.
yx())/sd0,
171 else if (magSd1 >= magSd2 && magSd1 > small)
175 (A.
xz()*A.
zy() - A.
zz()*A.
xy())/sd1,
182 else if (magSd2 > small)
186 (A.
xy()*A.
yz() - A.
yy()*A.
xz())/sd2,
187 (A.
yx()*A.
xz() - A.
xx()*A.
yz())/sd2,
195 sd0 = A.
yy()*direction1.
z() - A.
yz()*direction1.
y();
196 sd1 = A.
zz()*direction1.
x() - A.
zx()*direction1.
z();
197 sd2 = A.
xx()*direction1.
y() - A.
xy()*direction1.
x();
203 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
208 (A.
yz()*direction1.
x() - direction1.
z()*A.
yx())/sd0,
209 (direction1.
y()*A.
yx() - A.
yy()*direction1.
x())/sd0
214 else if (magSd1 >= magSd2 && magSd1 > small)
218 (direction1.
z()*A.
zy() - A.
zz()*direction1.
y())/sd1,
220 (A.
zx()*direction1.
y() - direction1.
x()*A.
zy())/sd1
225 else if (magSd2 > small)
229 (A.
xy()*direction1.
z() - direction1.
y()*A.
xz())/sd2,
230 (direction1.
x()*A.
xz() - A.
xx()*direction1.
z())/sd2,
238 return direction1^direction2;
244 vector Ux(1, 0, 0), Uy(0, 1, 0), Uz(0, 0, 1);
250 return tensor(Ux, Uy, Uz);
vector eigenVector(const tensor &T, const scalar lambda, const vector &direction1, const vector &direction2)
static const char *const typeName
#define forAll(list, i)
Loop across all elements in list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const char *const componentNames[]
dimensionedVector eigenValues(const dimensionedTensor &dt)
static const Form rootMin
Ostream & endl(Ostream &os)
Add newline and flush stream.
Templated storage for the roots of polynomial equations, plus flags to indicate the nature of the roo...
const dimensionedScalar & c
Speed of light in a vacuum.
Cubic equation of the form a*x^3 + b*x^2 + c*x + d = 0.
static const Identity< scalar > I
const dimensionedScalar & b
Wien displacement law constant: default SI units: [m K].
dimensionedTensor eigenVectors(const dimensionedTensor &dt)
Roots< 3 > roots() const
Get the roots.
static const Form rootMax
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
static Tensor< scalar > uniform(const scalar &s)
Return a VectorSpace with all elements = s.
dimensioned< scalar > mag(const dimensioned< Type > &)
Templated 3D tensor derived from MatrixSpace adding construction from 9 components, element access using xx(), xy() etc. member functions and the inner-product (dot-product) and outer-product of two Vectors (tensor-product) operators.
Tensor< scalar > tensor
Tensor of scalars.
void type(const direction i, const rootType t)
Set the type of the i-th root.