53 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero;
54 this->v_[YY] = st.
ii();
61 const Cmpt txx,
const Cmpt txy,
65 this->v_[XX] = txx; this->v_[XY] = txy;
89 this->v_[XX] = v.
x(); this->v_[YY] = v.
y();
107 return (xx()*yy() - xy()*xy());
127 return this->adjunct();
135 const Cmpt detval = this->
det();
138 if (
mag(detval) < SMALL)
141 <<
"SymmTensor2D not properly invertible, determinant:" 142 << detval <<
" tensor:" << *
this <<
nl 147 return this->adjunct()/detval;
159 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero;
160 this->v_[YY] = st.
ii();
175 return st.
xx() + st.
yy();
200 inline SymmTensor2D<Cmpt>
twoSymm(
const SymmTensor2D<Cmpt>& st)
208 inline SymmTensor2D<Cmpt>
dev(
const SymmTensor2D<Cmpt>& st)
216 inline SymmTensor2D<Cmpt>
dev2(
const SymmTensor2D<Cmpt>& st)
218 return st - 2*
sph(st);
240 inline 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;
258 inline SymmTensor2D<Cmpt>
inv(
const SymmTensor2D<Cmpt>& st)
266 inline Cmpt
invariantI(
const SymmTensor2D<Cmpt>& st)
296 inline Foam::scalar
magSqr(
const SymmTensor2D<Cmpt>& st)
308 inline 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(),
361 inline SymmTensor2D<Cmpt>
362 operator-(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
366 st1.xx() - spt2.ii(), st1.xy(),
374 inline SymmTensor2D<Cmpt>
375 operator/(
const SymmTensor2D<Cmpt>& st,
const Cmpt
s)
377 return SymmTensor2D<Cmpt>
379 st.xx()/
s, st.xy()/
s,
387 inline Tensor2D<Cmpt>
388 operator&(
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()
403 inline SymmTensor2D<Cmpt>
404 operator&(
const SphericalTensor2D<Cmpt>& spt1,
const SymmTensor2D<Cmpt>& st2)
406 return SymmTensor2D<Cmpt>
408 spt1.ii()*st2.xx(), spt1.ii()*st2.xy(),
416 inline SymmTensor2D<Cmpt>
417 operator&(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
419 return SymmTensor2D<Cmpt>
421 st1.xx()*spt2.ii(), st1.xy()*spt2.ii(),
429 inline Vector2D<Cmpt>
430 operator&(
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()
469 operator&&(
const SphericalTensor2D<Cmpt>& spt1,
const SymmTensor2D<Cmpt>& st2)
471 return (spt1.ii()*st2.xx() + spt1.ii()*st2.yy());
478 operator&&(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
480 return (st1.xx()*spt2.ii() + st1.yy()*spt2.ii());
495 class outerProduct<Cmpt, SymmTensor2D<Cmpt>>
499 typedef SymmTensor2D<Cmpt>
type;
511 class innerProduct<SymmTensor2D<Cmpt>, Vector2D<Cmpt>>
515 typedef Vector2D<Cmpt>
type;
519 class innerProduct<Vector2D<Cmpt>, SymmTensor2D<Cmpt>>
523 typedef Vector2D<Cmpt>
type;
Cmpt invariantII(const SymmTensor< Cmpt > &st)
Return the 2nd invariant of a SymmTensor.
SymmTensor2D()=default
Default construct.
SymmTensor2D< Cmpt > type
SymmTensor2D< Cmpt > inv() const
Return inverse.
SymmTensor2D< Cmpt > type
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const Cmpt & xx() const noexcept
const Cmpt & y() const noexcept
Access to the vector y component.
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.
Vector2D< Cmpt > diag() const
Extract the diagonal as a vector.
const Cmpt & ii() const noexcept
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
const Cmpt & xy() const noexcept
dimensionSet operator &&(const dimensionSet &ds1, const dimensionSet &ds2)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
SymmTensor2D< Cmpt > adjunct() const
Return adjunct matrix (transpose of cofactor matrix)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
dimensionedScalar det(const dimensionedSphericalTensor &dt)
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
Cmpt det() const
The determinate.
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
const Cmpt & yy() const noexcept
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
errorManip< error > abort(error &err)
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
dimensionedSymmTensor innerSqr(const dimensionedSymmTensor &dt)
const Cmpt & x() const noexcept
Access to the vector x component.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
SymmTensor2D< Cmpt > cof() const
Return cofactor matrix (transpose of adjunct matrix)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
A templated (2 x 2) diagonal tensor of objects of <T>, effectively containing 1 element, derived from VectorSpace.
tmp< GeometricField< Type, faPatchField, areaMesh > > operator &(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
Cmpt invariantI(const SymmTensor< Cmpt > &st)
Return the 1st invariant of a SymmTensor.
A templated (2 x 2) symmetric tensor of objects of <T>, effectively containing 3 elements, derived from VectorSpace.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
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))
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).
scalar diagSqr() const
The L2-norm squared of the diagonal.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) - 2 >::type type
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)