55 this->v_[XX] = st.
ii();
56 this->v_[YY] = st.
ii();
57 this->v_[ZZ] = st.
ii();
107 return dt.
xx() + dt.
yy() + dt.
zz();
126 return dt.
xx()*dt.
yy()*dt.
zz();
132 inline DiagTensor<Cmpt>
inv(
const DiagTensor<Cmpt>& dt)
135 if (
mag(
det(dt)) < VSMALL)
138 <<
"DiagTensor is not invertible due to the zero determinant:" 139 <<
"det(DiagTensor) = " <<
det(dt)
150 inline DiagTensor<Cmpt>
diag(
const Tensor<Cmpt>& t)
152 return DiagTensor<Cmpt>(t.xx(), t.yy(), t.zz());
158 inline DiagTensor<Cmpt>
diag(
const SymmTensor<Cmpt>& st)
160 return DiagTensor<Cmpt>(st.xx(), st.yy(), st.zz());
180 const scalar onet = (1-t);
184 onet*a.
xx() + t*
b.xx(),
185 onet*a.
yy() + t*
b.yy(),
186 onet*a.
zz() + t*
b.zz()
196 operator+(
const DiagTensor<Cmpt>& dt1,
const Tensor<Cmpt>& t2)
200 dt1.xx() + t2.xx(), t2.xy(), t2.xz(),
201 t2.yx(), dt1.yy() + t2.yy(), t2.yz(),
202 t2.zx(), t2.zy(), dt1.zz() + t2.zz()
214 t1.
xx() + dt2.
xx(), t1.
xy(), t1.
xz(),
215 t1.
yx(), t1.
yy() + dt2.
yy(), t1.
yz(),
216 t1.
zx(), t1.
zy(), t1.
zz() + dt2.
zz()
228 dt1.
xx() - t2.
xx(), -t2.
xy(), -t2.
xz(),
229 -t2.
yx(), dt1.
yy() - t2.
yy(), -t2.
yz(),
230 -t2.
zx(), -t2.
zy(), dt1.
zz() - t2.
zz()
242 t1.
xx() - dt2.
xx(), t1.
xy(), t1.
xz(),
243 t1.
yx(), t1.
yy() - dt2.
yy(), t1.
yz(),
244 t1.
zx(), t1.
zy(), t1.
zz() - dt2.
zz()
251 inline DiagTensor<Cmpt>
252 operator/(
const Cmpt
s,
const DiagTensor<Cmpt>& dt)
255 if (
mag(
det(dt)) < VSMALL)
259 <<
" is not divisible by the DiagTensor due to a zero element:" 260 <<
"DiagTensor = " << dt
278 <<
"DiagTensor = " << dt
279 <<
" is not divisible due to a zero value in Cmpt:" 295 if (
mag(
det(dt)) < VSMALL)
299 <<
" is not divisible by the DiagTensor due to a zero element:" 300 <<
"DiagTensor = " << dt
311 inline DiagTensor<Cmpt>
312 operator&(
const DiagTensor<Cmpt>& dt1,
const DiagTensor<Cmpt>& dt2)
326 operator&(
const DiagTensor<Cmpt>& dt1,
const Tensor<Cmpt>& t2)
348 operator&(
const Tensor<Cmpt>& t1,
const DiagTensor<Cmpt>& dt2)
370 operator&(
const DiagTensor<Cmpt>& dt,
const Vector<Cmpt>& v)
384 operator&(
const Vector<Cmpt>& v,
const DiagTensor<Cmpt>& dt)
const Cmpt & zz() const noexcept
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
const Cmpt & yx() const noexcept
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
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
const Cmpt & y() const noexcept
Access to the vector y component.
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 (3 x 3) diagonal tensor of objects of <T>, effectively containing 1 element, derived from VectorSpace.
const Cmpt & yz() const noexcept
const Cmpt & xx() const noexcept
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
const Cmpt & yy() const noexcept
DiagTensor()=default
Default construct.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
const Cmpt & zx() const noexcept
A templated (3 x 3) diagonal tensor of objects of <T>, effectively containing 3 elements, derived from VectorSpace.
const Cmpt & ii() const noexcept
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
errorManip< error > abort(error &err)
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross-product operators.
const Cmpt & yy() const noexcept
const Cmpt & x() const noexcept
Access to the vector x component.
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
const Cmpt & zy() const noexcept
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & zz() const noexcept
tmp< GeometricField< Type, faPatchField, areaMesh > > operator &(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const Cmpt & xx() const noexcept
scalar diagSqr() const
The L2-norm squared of the diagonal.
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
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))
const Cmpt & xz() const noexcept
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)