114 return dt.
xx() + dt.
yy() + dt.
zz();
133 return dt.
xx()*dt.
yy()*dt.
zz();
139inline DiagTensor<Cmpt>
inv(
const DiagTensor<Cmpt>& dt)
142 if (
mag(
det(dt)) < VSMALL)
145 <<
"DiagTensor is not invertible due to the zero determinant:"
146 <<
"det(DiagTensor) = " <<
det(dt)
157inline DiagTensor<Cmpt>
diag(
const Tensor<Cmpt>& t)
159 return DiagTensor<Cmpt>(t.xx(), t.yy(), t.zz());
165inline DiagTensor<Cmpt>
diag(
const SymmTensor<Cmpt>& st)
167 return DiagTensor<Cmpt>(st.xx(), st.yy(), st.zz());
187 const scalar onet = (1-t);
191 onet*a.
xx() + t*
b.xx(),
192 onet*a.
yy() + t*
b.yy(),
193 onet*a.
zz() + t*
b.zz()
203operator+(
const DiagTensor<Cmpt>& dt1,
const Tensor<Cmpt>& t2)
207 dt1.xx() + t2.xx(), t2.xy(), t2.xz(),
208 t2.yx(), dt1.yy() + t2.yy(), t2.yz(),
209 t2.zx(), t2.zy(), dt1.zz() + t2.zz()
221 t1.
xx() + dt2.
xx(), t1.
xy(), t1.
xz(),
222 t1.
yx(), t1.
yy() + dt2.
yy(), t1.
yz(),
223 t1.
zx(), t1.
zy(), t1.
zz() + dt2.
zz()
235 dt1.
xx() - t2.
xx(), -t2.
xy(), -t2.
xz(),
236 -t2.
yx(), dt1.
yy() - t2.
yy(), -t2.
yz(),
237 -t2.
zx(), -t2.
zy(), dt1.
zz() - t2.
zz()
249 t1.
xx() - dt2.
xx(), t1.
xy(), t1.
xz(),
250 t1.
yx(), t1.
yy() - dt2.
yy(), t1.
yz(),
251 t1.
zx(), t1.
zy(), t1.
zz() - dt2.
zz()
258inline DiagTensor<Cmpt>
259operator/(
const Cmpt
s,
const DiagTensor<Cmpt>& dt)
262 if (
mag(
det(dt)) < VSMALL)
266 <<
" is not divisible by the DiagTensor due to a zero element:"
267 <<
"DiagTensor = " << dt
285 <<
"DiagTensor = " << dt
286 <<
" is not divisible due to a zero value in Cmpt:"
302 if (
mag(
det(dt)) < VSMALL)
306 <<
" is not divisible by the DiagTensor due to a zero element:"
307 <<
"DiagTensor = " << dt
318inline DiagTensor<Cmpt>
319operator&(
const DiagTensor<Cmpt>& dt1,
const DiagTensor<Cmpt>& dt2)
333operator&(
const DiagTensor<Cmpt>& dt1,
const Tensor<Cmpt>& t2)
355operator&(
const Tensor<Cmpt>& t1,
const DiagTensor<Cmpt>& dt2)
377operator&(
const DiagTensor<Cmpt>& dt,
const Vector<Cmpt>& v)
391operator&(
const Vector<Cmpt>& v,
const DiagTensor<Cmpt>& dt)
A templated (3 x 3) diagonal tensor of objects of <T>, effectively containing 3 elements,...
scalar diagSqr() const
The L2-norm squared of the diagonal.
const Cmpt & yy() const noexcept
DiagTensor()=default
Default construct.
const Cmpt & xx() const noexcept
Vector< Cmpt > diag() const
Extract the diagonal as a vector.
const Cmpt & zz() const noexcept
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A templated (3 x 3) diagonal tensor of objects of <T>, effectively containing 1 element,...
const Cmpt & ii() const noexcept
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements,...
const Cmpt & yy() const noexcept
const Cmpt & xx() const noexcept
const Cmpt & zz() const noexcept
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
const Cmpt & yy() const noexcept
const Cmpt & zy() const noexcept
const Cmpt & yx() const noexcept
const Cmpt & xx() const noexcept
const Cmpt & yz() const noexcept
const Cmpt & zz() const noexcept
const Cmpt & xy() const noexcept
const Cmpt & xz() const noexcept
const Cmpt & zx() const noexcept
static const DiagTensor< Cmpt > zero
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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))
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
tmp< GeometricField< Type, faPatchField, areaMesh > > operator&(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)