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();
73 this->v_[XX] =
x.x(); this->v_[XY] =
x.y();
74 this->v_[YX] =
y.x(); this->v_[YY] =
y.y();
81 const Cmpt txx,
const Cmpt txy,
82 const Cmpt tyx,
const Cmpt tyy
85 this->v_[XX] = txx; this->v_[XY] = txy;
86 this->v_[YX] = tyx; this->v_[YY] = tyy;
176 template<Foam::direction Col>
179 if (Col == 0)
return cx();
180 else if (Col == 1)
return cy();
182 static_assert(Col < 2,
"Invalid column access");
192 case 0:
return cx();
break;
193 case 1:
return cy();
break;
204 template<Foam::direction Row>
207 if (Row == 0)
return x();
208 else if (Row == 1)
return y();
210 static_assert(Row < 2,
"Invalid row access");
220 case 0:
return x();
break;
221 case 1:
return y();
break;
232 template<Foam::direction Col>
237 this->v_[XX] = v.
x();
238 this->v_[YX] = v.
y();
242 this->v_[XY] = v.
x();
243 this->v_[YY] = v.
y();
246 static_assert(Col < 2,
"Invalid column access");
251 template<Foam::direction Row>
256 this->v_[XX] = v.
x(); this->v_[XY] = v.
y();
260 this->v_[YX] = v.
x(); this->v_[YY] = v.
y();
263 static_assert(Row < 2,
"Invalid row access");
274 this->v_[XX] =
x.x(); this->v_[XY] =
y.x();
275 this->v_[YX] =
x.y(); this->v_[YY] =
y.y();
286 this->v_[XX] =
x.x(); this->v_[XY] =
x.y();
287 this->v_[YX] =
y.x(); this->v_[YY] =
y.y();
300 case 0: col<0>(v);
break;
301 case 1: col<1>(v);
break;
319 case 0: row<0>(v);
break;
320 case 1: row<1>(v);
break;
339 this->v_[XX] = v.
x(); this->v_[YY] = v.
y();
392 this->v_[XX] = st.
xx(); this->v_[XY] = st.
xy();
393 this->v_[YX] = st.
xy(); this->v_[YY] = st.
yy();
400 this->v_[XX] = st.
ii(); this->v_[XY] = 0;
401 this->v_[YX] = 0; this->v_[YY] = st.
ii();
423 inline typename innerProduct<Tensor2D<Cmpt>, Vector2D<Cmpt>>
::type
428 t.
xx()*v.
x() + t.
xy()*v.
y(),
429 t.
yx()*v.
x() + t.
yy()*v.
y()
435 inline typename innerProduct<Vector2D<Cmpt>, Tensor2D<Cmpt>>
::type
440 v.
x()*t.
xx() + v.
y()*t.
yx(),
441 v.
x()*t.
xy() + v.
y()*t.
yy()
447 inline typename outerProduct<Vector2D<Cmpt>, Vector2D<Cmpt>>
::type
452 v1.
x()*v2.
x(), v1.
x()*v2.
y(),
453 v1.
y()*v2.
x(), v1.
y()*v2.
y()
462 return t.
xx() + t.
yy();
480 t.
xx(), 0.5*(t.
xy() + t.
yx()),
502 0.0, 0.5*(t.
xy() - t.
yx()),
503 0.5*(t.
yx() - t.
xy()), 0.0
528 return(t.
xx()*t.
yy() - t.
xy()*t.
yx());
595 inline Tensor2D<Cmpt>
600 st1.
ii() + t2.
xx(), t2.
xy(),
601 t2.
yx(), st1.
ii() + t2.
yy()
607 inline Tensor2D<Cmpt>
612 t1.
xx() + st2.
ii(), t1.
xy(),
613 t1.
yx(), t1.
yy() + st2.
ii()
619 inline Tensor2D<Cmpt>
624 st1.
ii() - t2.
xx(), -t2.
xy(),
625 -t2.
yx(), st1.
ii() - t2.
yy()
631 inline Tensor2D<Cmpt>
636 t1.
xx() - st2.
ii(), t1.
xy(),
637 t1.
yx(), t1.
yy() - st2.
ii()
644 inline Tensor2D<Cmpt>
659 inline Tensor2D<Cmpt>
678 return(st1.
ii()*t2.
xx() + st1.
ii()*t2.
yy());
687 return(t1.
xx()*st2.
ii() + t1.
yy()*st2.
ii());
694 inline Tensor2D<Cmpt>
699 st1.
xx() + t2.
xx(), st1.
xy() + t2.
xy(),
700 st1.
xy() + t2.
yx(), st1.
yy() + t2.
yy()
706 inline Tensor2D<Cmpt>
711 t1.
xx() + st2.
xx(), t1.
xy() + st2.
xy(),
712 t1.
yx() + st2.
xy(), t1.
yy() + st2.
yy()
718 inline Tensor2D<Cmpt>
723 st1.
xx() - t2.
xx(), st1.
xy() - t2.
xy(),
724 st1.
xy() - t2.
yx(), st1.
yy() - t2.
yy()
730 inline Tensor2D<Cmpt>
735 t1.
xx() - st2.
xx(), t1.
xy() - st2.
xy(),
736 t1.
yx() - st2.
xy(), t1.
yy() - st2.
yy()
743 inline Tensor2D<Cmpt>
748 st1.
xx()*t2.
xx() + st1.
xy()*t2.
yx(),
749 st1.
xx()*t2.
xy() + st1.
xy()*t2.
yy(),
751 st1.
xy()*t2.
xx() + st1.
yy()*t2.
yx(),
759 inline Tensor2D<Cmpt>
764 t1.
xx()*st2.
xx() + t1.
xy()*st2.
xy(),
765 t1.
xx()*st2.
xy() + t1.
xy()*st2.
yy(),
767 t1.
yx()*st2.
xx() + t1.
yy()*st2.
xy(),
781 + st1.
xy()*t2.
yx() + st1.
yy()*t2.
yy()
794 + t1.
yx()*st2.
xy() + t1.
yy()*st2.
yy()
Vector2D< Cmpt > cx() const
Extract vector for column 0.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Vector2D< Cmpt > cy() const
Extract vector for column 1.
Tensor2D()=default
Construct null.
Cmpt invariantIII(const SymmTensor< Cmpt > &st)
Return the 3rd invariant of a symmetric tensor.
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 symmetric tensor.
Tensor2D< Cmpt > inner(const Tensor2D< Cmpt > &t2) const
Inner-product of this with another Tensor2D.
static constexpr const zero Zero
Global zero.
Vector2D< Cmpt > row() const
Extract vector for given row.
Templated 2D symmetric tensor derived from VectorSpace adding construction from 4 components,...
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
Cmpt v_[Ncmpts]
The components of this vector space.
Templated 2D tensor derived from VectorSpace adding construction from 4 components,...
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 diagonal tensor.
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 symmetric tensor.
errorManip< error > abort(error &err)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Vector2D< Cmpt > x() const
Extract vector for row 0.
Tensor2D< Cmpt > T() const
Return transpose.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Vector2D< Cmpt > y() const
Extract vector for row 1.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
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 > &)
void operator=(const SymmTensor2D< Cmpt > &)
Copy assign from SymmTensor2D.
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.
Templated 2D sphericalTensor derived from VectorSpace adding construction from 1 component,...
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)