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();
108 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero;
109 this->v_[YY] = st.
ii();
124 return st.
xx() + st.
yy();
149 inline SymmTensor2D<Cmpt>
twoSymm(
const SymmTensor2D<Cmpt>& st)
157 inline SymmTensor2D<Cmpt>
dev(
const SymmTensor2D<Cmpt>& st)
165 inline SymmTensor2D<Cmpt>
dev2(
const SymmTensor2D<Cmpt>& st)
167 return st - 2*
sph(st);
175 return (st.
xx()*st.
yy() - st.
xy()*st.
xy());
196 if (
mag(detst) < SMALL)
199 <<
"SymmTensor2D is not invertible due to the zero determinant:" 200 <<
"det(SymmTensor2D) = " <<
mag(detst)
205 return cof(st)/detst;
211 inline SymmTensor2D<Cmpt>
inv(
const SymmTensor2D<Cmpt>& st)
219 inline Cmpt
invariantI(
const SymmTensor2D<Cmpt>& st)
249 inline Cmpt
magSqr(
const SymmTensor2D<Cmpt>& st)
253 mag(st.xx()*st.xx()) + 2*
mag(st.xy()*st.xy())
254 +
mag(st.yy()*st.yy())
261 inline SymmTensor2D<Cmpt>
sqr(
const Vector2D<Cmpt>& v)
263 return SymmTensor2D<Cmpt>
265 v.x()*v.x(), v.x()*v.y(),
280 spt1.
ii() + st2.
xx(), st2.
xy(),
293 st1.
xx() + spt2.
ii(), st1.
xy(),
306 spt1.
ii() - st2.
xx(), -st2.
xy(),
314 inline SymmTensor2D<Cmpt>
315 operator-(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
319 st1.xx() - spt2.ii(), st1.xy(),
327 inline SymmTensor2D<Cmpt>
328 operator/(
const SymmTensor2D<Cmpt>& st,
const Cmpt
s)
330 return SymmTensor2D<Cmpt>
332 st.xx()/
s, st.xy()/
s,
340 inline Tensor2D<Cmpt>
341 operator&(
const SymmTensor2D<Cmpt>& st1,
const SymmTensor2D<Cmpt>& st2)
343 return Tensor2D<Cmpt>
345 st1.xx()*st2.xx() + st1.xy()*st2.xy(),
346 st1.xx()*st2.xy() + st1.xy()*st2.yy(),
348 st1.xy()*st2.xx() + st1.yy()*st2.xy(),
349 st1.xy()*st2.xy() + st1.yy()*st2.yy()
356 inline SymmTensor2D<Cmpt>
357 operator&(
const SphericalTensor2D<Cmpt>& spt1,
const SymmTensor2D<Cmpt>& st2)
359 return SymmTensor2D<Cmpt>
361 spt1.ii()*st2.xx(), spt1.ii()*st2.xy(),
369 inline SymmTensor2D<Cmpt>
370 operator&(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
372 return SymmTensor2D<Cmpt>
374 st1.xx()*spt2.ii(), st1.xy()*spt2.ii(),
382 inline Vector2D<Cmpt>
383 operator&(
const SymmTensor2D<Cmpt>& st,
const Vector2D<Cmpt>& v)
385 return Vector2D<Cmpt>
387 st.xx()*v.x() + st.xy()*v.y(),
388 st.xy()*v.x() + st.yy()*v.y()
400 v.
x()*st.
xx() + v.
y()*st.
xy(),
401 v.
x()*st.
xy() + v.
y()*st.
yy()
413 st1.
xx()*st2.
xx() + 2*st1.
xy()*st2.
xy()
422 operator&&(
const SphericalTensor2D<Cmpt>& spt1,
const SymmTensor2D<Cmpt>& st2)
424 return (spt1.ii()*st2.xx() + spt1.ii()*st2.yy());
431 operator&&(
const SymmTensor2D<Cmpt>& st1,
const SphericalTensor2D<Cmpt>& spt2)
433 return (st1.xx()*spt2.ii() + st1.yy()*spt2.ii());
448 class outerProduct<Cmpt, SymmTensor2D<Cmpt>>
452 typedef SymmTensor2D<Cmpt>
type;
464 class innerProduct<SymmTensor2D<Cmpt>, Vector2D<Cmpt>>
468 typedef Vector2D<Cmpt>
type;
472 class innerProduct<Vector2D<Cmpt>, SymmTensor2D<Cmpt>>
476 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 > 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)...
const Cmpt & xy() const noexcept
dimensionSet operator &&(const dimensionSet &ds1, const dimensionSet &ds2)
const Cmpt & yx() const noexcept
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
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 > &)
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)
const SymmTensor2D< Cmpt > & T() const
Return non-Hermitian transpose.
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)
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).
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)