61 const Cmpt txx,
const Cmpt txy,
65 this->
v_[
XX] = txx; this->
v_[
XY] = txy;
135 const Cmpt detval = this->
det();
138 if (
mag(detval) < SMALL)
141 <<
"SymmTensor2D not properly invertible, determinant:"
142 << detval <<
" tensor:" << *
this <<
nl
159 this->v_[XX] = st.ii(); this->v_[XY] =
Zero;
160 this->v_[YY] = st.ii();
175 return st.
xx() + st.
yy();
200inline SymmTensor2D<Cmpt>
twoSymm(
const SymmTensor2D<Cmpt>& st)
208inline SymmTensor2D<Cmpt>
dev(
const SymmTensor2D<Cmpt>& st)
216inline SymmTensor2D<Cmpt>
dev2(
const SymmTensor2D<Cmpt>& st)
218 return st - 2*
sph(st);
240inline SymmTensor2D<Cmpt>
inv(
const SymmTensor2D<Cmpt>& st,
const Cmpt detval)
243 if (
mag(detval) < SMALL)
246 <<
"SymmTensor2D not properly invertible, determinant:"
247 << detval <<
" tensor:" << st <<
nl
252 return st.adjunct()/detval;
258inline SymmTensor2D<Cmpt>
inv(
const SymmTensor2D<Cmpt>& st)
296inline Foam::scalar
magSqr(
const SymmTensor2D<Cmpt>& st)
308inline SymmTensor2D<Cmpt>
sqr(
const Vector2D<Cmpt>& v)
310 return SymmTensor2D<Cmpt>
312 v.x()*v.x(), v.x()*v.y(),
327 spt1.
ii() + st2.
xx(), st2.
xy(),
340 st1.
xx() + spt2.
ii(), st1.
xy(),
353 spt1.
ii() - st2.
xx(), -st2.
xy(),
361inline SymmTensor2D<Cmpt>
362operator-(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
366 st1.xx() - spt2.ii(), st1.xy(),
374inline SymmTensor2D<Cmpt>
375operator/(
const SymmTensor2D<Cmpt>& st,
const Cmpt
s)
377 return SymmTensor2D<Cmpt>
379 st.xx()/
s, st.xy()/
s,
388operator&(
const SymmTensor2D<Cmpt>& st1,
const SymmTensor2D<Cmpt>& st2)
390 return Tensor2D<Cmpt>
392 st1.xx()*st2.xx() + st1.xy()*st2.xy(),
393 st1.xx()*st2.xy() + st1.xy()*st2.yy(),
395 st1.xy()*st2.xx() + st1.yy()*st2.xy(),
396 st1.xy()*st2.xy() + st1.yy()*st2.yy()
403inline SymmTensor2D<Cmpt>
404operator&(
const SphericalTensor2D<Cmpt>& spt1,
const SymmTensor2D<Cmpt>& st2)
406 return SymmTensor2D<Cmpt>
408 spt1.ii()*st2.xx(), spt1.ii()*st2.xy(),
416inline SymmTensor2D<Cmpt>
417operator&(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
419 return SymmTensor2D<Cmpt>
421 st1.xx()*spt2.ii(), st1.xy()*spt2.ii(),
430operator&(
const SymmTensor2D<Cmpt>& st,
const Vector2D<Cmpt>& v)
432 return Vector2D<Cmpt>
434 st.xx()*v.x() + st.xy()*v.y(),
435 st.xy()*v.x() + st.yy()*v.y()
447 v.
x()*st.
xx() + v.
y()*st.
xy(),
448 v.
x()*st.
xy() + v.
y()*st.
yy()
460 st1.
xx()*st2.
xx() + 2*st1.
xy()*st2.
xy()
469operator&&(
const SphericalTensor2D<Cmpt>& spt1,
const SymmTensor2D<Cmpt>& st2)
471 return (spt1.ii()*st2.xx() + spt1.ii()*st2.yy());
478operator&&(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
480 return (st1.xx()*spt2.ii() + st1.yy()*spt2.ii());
495class outerProduct<Cmpt, SymmTensor2D<Cmpt>>
499 typedef SymmTensor2D<Cmpt>
type;
511class innerProduct<SymmTensor2D<Cmpt>, Vector2D<Cmpt>>
515 typedef Vector2D<Cmpt>
type;
519class innerProduct<Vector2D<Cmpt>, SymmTensor2D<Cmpt>>
523 typedef Vector2D<Cmpt>
type;
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A templated (2 x 2) diagonal tensor of objects of <T>, effectively containing 1 element,...
const Cmpt & ii() const noexcept
A templated (2 x 2) symmetric tensor of objects of <T>, effectively containing 3 elements,...
SymmTensor2D< Cmpt > cof() const
Return cofactor matrix (transpose of adjunct matrix).
scalar diagSqr() const
The L2-norm squared of the diagonal.
const Cmpt & yy() const noexcept
SymmTensor2D< Cmpt > adjunct() const
Return adjunct matrix (transpose of cofactor matrix).
Cmpt det() const
The determinate.
SymmTensor2D< Cmpt > inv() const
Return inverse.
const Cmpt & xx() const noexcept
Vector2D< Cmpt > diag() const
Extract the diagonal as a vector.
const Cmpt & xy() const noexcept
SymmTensor2D()=default
Default construct.
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & y() const noexcept
Access to the vector y component.
static const SymmTensor2D< Cmpt > zero
VectorSpace< SymmTensor2D< Cmpt >, Cmpt, Ncmpts > vsType
friend Ostream & operator(Ostream &, const VectorSpace< SymmTensor2D< Cmpt >, Cmpt, Ncmpts > &)
SymmTensor2D< Cmpt > type
SymmTensor2D< Cmpt > type
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) -2 >::type type
SymmTensor2D< Cmpt > type
SymmTensor2D< Cmpt > type
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
SymmTensor2D< Cmpt > type
SymmTensor2D< Cmpt > type
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
Cmpt invariantII(const SymmTensor2D< Cmpt > &st)
Return the 2nd invariant of a SymmTensor2D.
Cmpt invariantI(const SymmTensor2D< Cmpt > &st)
Return the 1st invariant of a SymmTensor2D.
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
tmp< GeometricField< Type, faPatchField, areaMesh > > operator&(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor innerSqr(const dimensionedSymmTensor &dt)
dimensioned< typename scalarProduct< Type1, Type2 >::type > operator&&(const dimensioned< Type1 > &, const dimensioned< Type2 > &)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a).