56 tensor2D::uniform(vGreat)
62 tensor2D::uniform(-vGreat)
68 tensor2D::uniform(rootVGreat)
74 tensor2D::uniform(-rootVGreat)
90 const scalar b = - t.xx() - t.yy();
91 const scalar c = t.xx()*t.yy() - t.xy()*t.yx();
94 Roots<2> roots = quadraticEqn(1, b, c).roots();
100 switch (roots.type(i))
103 lambda[i] = roots[i];
105 case rootType::complex:
107 <<
"Complex eigenvalues detected for tensor: " << t
111 case rootType::posInf:
114 case rootType::negInf:
115 lambda[i] = - vGreat;
119 <<
"Eigenvalue calculation failed for tensor: " << t
125 if (lambda.x() > lambda.y())
127 Swap(lambda.x(), lambda.y());
145 if (
mag(A.yy()) >
mag(A.xx()) &&
mag(A.yy()) > small)
151 else if (
mag(A.xx()) > small)
159 return vector2D(- direction1.y(), direction1.x());
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.
Vector2D< scalar > vector2D
vector2D obtained from generic Vector2D
static const char *const componentNames[]
dimensionedVector eigenValues(const dimensionedTensor &dt)
static const Form rootMin
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar lambda(viscosity->lookup("lambda"))
Templated 2D tensor derived from VectorSpace adding construction from 4 components, element access using xx(), xy(), yx() and yy() member functions and the iner-product (dot-product) and outer-product of two Vector2Ds (tensor-product) operators.
static const Identity< scalar > I
dimensionedTensor eigenVectors(const dimensionedTensor &dt)
static const Form rootMax
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > mag(const dimensioned< Type > &)
Templated 2D Vector derived from VectorSpace adding construction from 2 components, element access using x() and y() member functions and the inner-product (dot-product).
Tensor2D< scalar > tensor2D
Tensor2D or scalars.