81 - t.
xx() - t.
yy() - t.
zz();
97 switch (roots.
type(i))
104 <<
"Complex eigenvalues detected for tensor: " << t
116 <<
"Eigenvalue calculation failed for tensor: " << t
143 - t.
xx() - t.
yy() - t.
zz();
159 switch (roots.
type(i))
166 <<
"Complex eigenvalues detected for symmTensor: " << t
177 <<
"Eigenvalue calculation failed for symmTensor: " << t
200 template<
class TensorType>
213 scalar sd0, sd1, sd2;
214 scalar magSd0, magSd1, magSd2;
217 sd0 =
A.yy()*
A.zz() -
A.yz()*
A.zy();
218 sd1 =
A.zz()*
A.xx() -
A.zx()*
A.xz();
219 sd2 =
A.xx()*
A.yy() -
A.xy()*
A.yx();
225 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
230 (
A.yz()*
A.zx() -
A.zz()*
A.yx())/sd0,
231 (
A.zy()*
A.yx() -
A.yy()*
A.zx())/sd0
236 else if (magSd1 >= magSd2 && magSd1 > small)
240 (
A.xz()*
A.zy() -
A.zz()*
A.xy())/sd1,
242 (
A.zx()*
A.xy() -
A.xx()*
A.zy())/sd1
247 else if (magSd2 > small)
251 (
A.xy()*
A.yz() -
A.yy()*
A.xz())/sd2,
252 (
A.yx()*
A.xz() -
A.xx()*
A.yz())/sd2,
260 sd0 =
A.yy()*direction1.z() -
A.yz()*direction1.y();
261 sd1 =
A.zz()*direction1.x() -
A.zx()*direction1.z();
262 sd2 =
A.xx()*direction1.y() -
A.xy()*direction1.x();
268 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
273 (
A.yz()*direction1.x() - direction1.z()*
A.yx())/sd0,
274 (direction1.y()*
A.yx() -
A.yy()*direction1.x())/sd0
279 else if (magSd1 >= magSd2 && magSd1 > small)
283 (direction1.z()*
A.zy() -
A.zz()*direction1.y())/sd1,
285 (
A.zx()*direction1.y() - direction1.x()*
A.zy())/sd1
290 else if (magSd2 > small)
294 (
A.xy()*direction1.z() - direction1.y()*
A.xz())/sd2,
295 (direction1.x()*
A.xz() -
A.xx()*direction1.z())/sd2,
303 return direction1^direction2;
309 vector Ux(1, 0, 0), Uy(0, 1, 0), Uz(0, 0, 1);
315 return tensor(Ux, Uy, Uz);
321 vector Ux(1, 0, 0), Uy(0, 1, 0), Uz(0, 0, 1);
327 return tensor(Ux, Uy, Uz);
#define forAll(list, i)
Loop across all elements in list.
Templated storage for the roots of polynomial equations, plus flags to indicate the nature of the roo...
void type(const direction i, const rootType t)
Set the type of the i-th root.
static const char *const componentNames[]
static const Form rootMax
static const Form rootMin
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
static const char *const typeName
Cubic equation of the form a*x^3 + b*x^2 + c*x + d = 0.
Roots< 3 > roots(const bool real=false) const
Get the roots.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar lambda(viscosity->lookup("lambda"))
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
static const coefficient A("A", dimPressure, 611.21)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Tensor< scalar > tensor
Tensor of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vector eigenVector(const TensorType &T, const scalar lambda, const vector &direction1, const vector &direction2)
void eigenValues(LagrangianPatchField< vector > &f, const LagrangianPatchField< tensor > &f1)
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
static const Identity< scalar > I
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
Vector< scalar > vector
A scalar version of the templated Vector.
void eigenVectors(LagrangianPatchField< tensor > &f, const LagrangianPatchField< tensor > &f1)