46 symmTensor2D::uniform(0)
52 symmTensor2D::uniform(1)
58 symmTensor2D::uniform(VGREAT)
64 symmTensor2D::uniform(-VGREAT)
70 symmTensor2D::uniform(ROOTVGREAT)
76 symmTensor2D::uniform(-ROOTVGREAT)
92 if (
sqr(
T.xy()) < ROOTSMALL)
98 const scalar skewTrace =
T.xx() -
T.yy();
99 const scalar trace =
tr(
T);
100 const scalar gap =
sign(skewTrace)*
hypot(skewTrace, 2*
T.xy());
102 return vector2D(0.5*(trace + gap), 0.5*(trace - gap));
122 if (
mag(eVec) < SMALL)
125 <<
"Eigenvector magnitude should be non-zero:" 126 <<
"mag(eigenvector) = " <<
mag(eVec)
131 return eVec/
mag(eVec);
133 else if (
mag(
A.xx()) > SMALL)
138 if (
mag(eVec) < SMALL)
141 <<
"Eigenvector magnitude should be non-zero:" 142 <<
"mag(eigenvector) = " <<
mag(eVec)
147 return eVec/
mag(eVec);
151 return vector2D(-standardBasis.y(), standardBasis.x());
162 const scalar skewTrace =
T.xx() -
T.yy();
164 if (
mag(skewTrace) > SMALL)
166 const scalar
phi = 0.5*
atan(2*
T.xy()/skewTrace);
167 const scalar cphi =
cos(
phi);
168 const scalar sphi =
sin(
phi);
169 return tensor2D(cphi, sphi, -sphi, cphi);
171 else if (
mag(
T.xy()) > SMALL)
173 const scalar a = 0.70710678;
vector eigenVector(const symmTensor &T, const scalar eVal, const vector &standardBasis1, const vector &standardBasis2)
Return a real eigenvector corresponding to a given real eigenvalue of a given symmTensor.
dimensionedScalar sign(const dimensionedScalar &ds)
static const char *const typeName
static const SymmTensor2D I
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Vector2D< scalar > vector2D
A 2D vector of scalars obtained from the generic Vector2D.
static const char *const componentNames[]
static const Form rootMin
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
dimensionedScalar cos(const dimensionedScalar &ds)
static const Identity< scalar > I
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
errorManip< error > abort(error &err)
dimensionedScalar sin(const dimensionedScalar &ds)
static const Form rootMax
dimensionedScalar atan(const dimensionedScalar &ds)
A templated (2 x 2) symmetric tensor of objects of <T>, effectively containing 3 elements, derived from VectorSpace.
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
dimensionedScalar hypot(const dimensionedScalar &x, const dimensionedScalar &y)
SymmTensor2D< scalar > symmTensor2D
SymmTensor2D of scalars, i.e. SymmTensor2D<scalar>.
Tensor2D< scalar > tensor2D
Tensor2D of scalars, i.e. Tensor2D<scalar>.