Go to the documentation of this file.
51 this->v_[XX] = st.
xx(); this->v_[XY] = st.
xy();
52 this->v_[YX] = st.
xy(); this->v_[YY] = st.
yy();
59 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero;
60 this->v_[YX] =
Zero; this->v_[YY] = st.
ii();
71 this->v_[XX] =
x.x(); this->v_[XY] =
x.y();
72 this->v_[YX] =
y.x(); this->v_[YY] =
y.y();
79 const Cmpt txx,
const Cmpt txy,
80 const Cmpt tyx,
const Cmpt tyy
83 this->v_[XX] = txx; this->v_[XY] = txy;
84 this->v_[YX] = tyx; this->v_[YY] = tyy;
174 template<Foam::direction Col>
177 if (Col == 0)
return cx();
178 else if (Col == 1)
return cy();
180 static_assert(Col < 2,
"Invalid column access");
190 case 0:
return cx();
break;
191 case 1:
return cy();
break;
202 template<Foam::direction Row>
205 if (Row == 0)
return x();
206 else if (Row == 1)
return y();
208 static_assert(Row < 2,
"Invalid row access");
218 case 0:
return x();
break;
219 case 1:
return y();
break;
230 template<Foam::direction Col>
235 this->v_[XX] = v.
x();
236 this->v_[YX] = v.
y();
240 this->v_[XY] = v.
x();
241 this->v_[YY] = v.
y();
244 static_assert(Col < 2,
"Invalid column access");
249 template<Foam::direction Row>
254 this->v_[XX] = v.
x(); this->v_[XY] = v.
y();
258 this->v_[YX] = v.
x(); this->v_[YY] = v.
y();
261 static_assert(Row < 2,
"Invalid row access");
272 this->v_[XX] =
x.x(); this->v_[XY] =
y.x();
273 this->v_[YX] =
x.y(); this->v_[YY] =
y.y();
284 this->v_[XX] =
x.x(); this->v_[XY] =
x.y();
285 this->v_[YX] =
y.x(); this->v_[YY] =
y.y();
298 case 0: col<0>(v);
break;
299 case 1: col<1>(v);
break;
317 case 0: row<0>(v);
break;
318 case 1: row<1>(v);
break;
337 this->v_[XX] = v.
x(); this->v_[YY] = v.
y();
390 this->v_[XX] = st.
xx(); this->v_[XY] = st.
xy();
391 this->v_[YX] = st.
xy(); this->v_[YY] = st.
yy();
398 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero;
399 this->v_[YX] =
Zero; this->v_[YY] = st.
ii();
414 return t.
xx() + t.
yy();
435 t.
xx(), 0.5*(t.
xy() + t.
yx()),
485 return t.
xx()*t.
yy() - t.
xy()*t.
yx();
506 if (
mag(dett) < SMALL)
509 <<
"Tensor2D is not invertible due to the zero determinant:"
510 <<
"det(Tensor2D) = " <<
mag(dett)
515 return cof(t).
T()/dett;
547 inline Tensor2D<Cmpt>
552 st1.
ii() + t2.
xx(), t2.
xy(),
553 t2.
yx(), st1.
ii() + t2.
yy()
560 inline Tensor2D<Cmpt>
565 t1.
xx() + st2.
ii(), t1.
xy(),
566 t1.
yx(), t1.
yy() + st2.
ii()
573 inline Tensor2D<Cmpt>
578 st1.
xx() + t2.
xx(), st1.
xy() + t2.
xy(),
579 st1.
xy() + t2.
yx(), st1.
yy() + t2.
yy()
586 inline Tensor2D<Cmpt>
591 t1.
xx() + st2.
xx(), t1.
xy() + st2.
xy(),
592 t1.
yx() + st2.
xy(), t1.
yy() + st2.
yy()
599 inline Tensor2D<Cmpt>
604 st1.
ii() - t2.
xx(), -t2.
xy(),
605 -t2.
yx(), st1.
ii() - t2.
yy()
612 inline Tensor2D<Cmpt>
617 t1.
xx() - st2.
ii(), t1.
xy(),
618 t1.
yx(), t1.
yy() - st2.
ii()
625 inline Tensor2D<Cmpt>
630 st1.
xx() - t2.
xx(), st1.
xy() - t2.
xy(),
631 st1.
xy() - t2.
yx(), st1.
yy() - t2.
yy()
638 inline Tensor2D<Cmpt>
643 t1.
xx() - st2.
xx(), t1.
xy() - st2.
xy(),
644 t1.
yx() - st2.
xy(), t1.
yy() - st2.
yy()
651 inline Tensor2D<Cmpt>
658 <<
"Tensor2D = " << t
659 <<
" is not divisible due to a zero value in Cmpt:"
675 inline typename innerProduct<Tensor2D<Cmpt>, Tensor2D<Cmpt>>
::type
684 inline Tensor2D<Cmpt>
699 inline Tensor2D<Cmpt>
715 inline Tensor2D<Cmpt>
720 st1.
xx()*t2.
xx() + st1.
xy()*t2.
yx(),
721 st1.
xx()*t2.
xy() + st1.
xy()*t2.
yy(),
723 st1.
xy()*t2.
xx() + st1.
yy()*t2.
yx(),
731 inline Tensor2D<Cmpt>
736 t1.
xx()*st2.
xx() + t1.
xy()*st2.
xy(),
737 t1.
xx()*st2.
xy() + t1.
xy()*st2.
yy(),
739 t1.
yx()*st2.
xx() + t1.
yy()*st2.
xy(),
748 inline typename innerProduct<Tensor2D<Cmpt>, Vector2D<Cmpt>>
::type
753 t.
xx()*v.
x() + t.
xy()*v.
y(),
754 t.
yx()*v.
x() + t.
yy()*v.
y()
761 inline typename innerProduct<Vector2D<Cmpt>, Tensor2D<Cmpt>>
::type
766 v.
x()*t.
xx() + v.
y()*t.
yx(),
767 v.
x()*t.
xy() + v.
y()*t.
yy()
777 return (st1.
ii()*t2.
xx() + st1.
ii()*t2.
yy());
786 return (t1.
xx()*st2.
ii() + t1.
yy()*st2.
ii());
798 + st1.
xy()*t2.
yx() + st1.
yy()*t2.
yy()
811 + t1.
yx()*st2.
xy() + t1.
yy()*st2.
yy()
818 inline typename outerProduct<Vector2D<Cmpt>, Vector2D<Cmpt>>
::type
823 v1.
x()*v2.
x(), v1.
x()*v2.
y(),
824 v1.
y()*v2.
x(), v1.
y()*v2.
y()
Vector2D< Cmpt > cx() const
Extract vector for column 0.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Tensor2D & operator=(const Tensor2D &)=default
Copy assignment.
Vector2D< Cmpt > cy() const
Extract vector for column 1.
Tensor2D()=default
Default construct.
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))
dimensionedTensor skew(const dimensionedTensor &dt)
void cols(const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
Set column values.
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
Cmpt invariantI(const SymmTensor< Cmpt > &st)
Return the 1st invariant of a SymmTensor.
Tensor2D< Cmpt > inner(const Tensor2D< Cmpt > &t2) const
Inner-product of this with another Tensor2D.
static constexpr const zero Zero
Global zero (0)
Vector2D< Cmpt > row() const
Extract vector for given row.
A templated (2 x 2) symmetric tensor of objects of <T>, effectively containing 3 elements,...
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensioned< Type > T() const
Return transpose.
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
VectorSpace< Tensor2D< Cmpt >, Cmpt, Ncmpts > vsType
VectorSpace type.
dimensioned< typename scalarProduct< Type1, Type2 >::type > operator&&(const dimensioned< Type1 > &, const dimensioned< Type2 > &)
Vector2D< Cmpt > diag() const
Extract the diagonal as a vector.
Cmpt invariantII(const SymmTensor< Cmpt > &st)
Return the 2nd invariant of a SymmTensor.
errorManip< error > abort(error &err)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Vector2D< Cmpt > x() const
Extract vector for row 0.
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
Tensor2D< Cmpt > T() const
Return non-Hermitian transpose.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Vector2D< Cmpt > y() const
Extract vector for row 1.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Tensor2D< Cmpt > schur(const Tensor2D< Cmpt > &t2) const
Schur-product of this with another Tensor2D.
tmp< faMatrix< Type > > operator*(const areaScalarField &, const faMatrix< Type > &)
const dimensionedScalar c
Speed of light in a vacuum.
Vector2D< Cmpt > col() const
Extract vector for given column.
void rows(const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
Set row values.
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
const Cmpt & y() const
Access to the vector y component.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
const Cmpt & x() const
Access to the vector x component.
A templated (2 x 2) diagonal tensor of objects of <T>, effectively containing 1 element,...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)