67 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero; this->v_[XZ] =
Zero;
68 this->v_[YX] =
Zero; this->v_[YY] = st.
ii(); this->v_[YZ] =
Zero;
69 this->v_[ZX] =
Zero; this->v_[ZY] =
Zero; this->v_[ZZ] = st.
ii();
76 this->v_[XX] = st.
xx(); this->v_[XY] = st.
xy(); this->v_[XZ] = st.
xz();
77 this->v_[YX] = st.
xy(); this->v_[YY] = st.
yy(); this->v_[YZ] = st.
yz();
78 this->v_[ZX] = st.
xz(); this->v_[ZY] = st.
yz(); this->v_[ZZ] = st.
zz();
89 Tensor<Cmpt>(vecs.
x(), vecs.
y(), vecs.z(), transposed)
116 const Cmpt txx,
const Cmpt txy,
const Cmpt txz,
117 const Cmpt tyx,
const Cmpt tyy,
const Cmpt tyz,
118 const Cmpt tzx,
const Cmpt tzy,
const Cmpt tzz
121 this->v_[XX] = txx; this->v_[XY] = txy; this->v_[XZ] = txz;
122 this->v_[YX] = tyx; this->v_[YY] = tyy; this->v_[YZ] = tyz;
123 this->v_[ZX] = tzx; this->v_[ZY] = tzy; this->v_[ZZ] = tzz;
130 template<
class, Foam::direction, Foam::direction>
class Block2,
288 return Vector<Cmpt>(this->v_[YX], this->v_[YY], this->v_[YZ]);
295 return Vector<Cmpt>(this->v_[ZX], this->v_[ZY], this->v_[ZZ]);
302 return Vector<Cmpt>(this->v_[XX], this->v_[YX], this->v_[ZX]);
309 return Vector<Cmpt>(this->v_[XY], this->v_[YY], this->v_[ZY]);
316 return Vector<Cmpt>(this->v_[XZ], this->v_[YZ], this->v_[ZZ]);
321template<Foam::direction Idx>
324 if (Idx == 0)
return cx();
325 else if (Idx == 1)
return cy();
326 else if (Idx == 2)
return cz();
328 static_assert(Idx < 3,
"Invalid column access");
338 case 0:
return cx();
break;
339 case 1:
return cy();
break;
340 case 2:
return cz();
break;
351template<Foam::direction Idx>
354 if (Idx == 0)
return x();
355 else if (Idx == 1)
return y();
356 else if (Idx == 2)
return z();
358 static_assert(Idx < 3,
"Invalid row access");
368 case 0:
return x();
break;
369 case 1:
return y();
break;
370 case 2:
return z();
break;
381template<Foam::direction Idx>
386 this->v_[XX] = v.
x();
387 this->v_[YX] = v.
y();
388 this->v_[ZX] = v.
z();
392 this->v_[XY] = v.
x();
393 this->v_[YY] = v.
y();
394 this->v_[ZY] = v.
z();
398 this->v_[XZ] = v.
x();
399 this->v_[YZ] = v.
y();
400 this->v_[ZZ] = v.
z();
403 static_assert(Idx < 3,
"Invalid column access");
408template<Foam::direction Idx>
413 this->v_[XX] = v.
x(); this->v_[XY] = v.
y(); this->v_[XZ] = v.
z();
417 this->v_[YX] = v.
x(); this->v_[YY] = v.
y(); this->v_[YZ] = v.
z();
421 this->v_[ZX] = v.
x(); this->v_[ZY] = v.
y(); this->v_[ZZ] = v.
z();
424 static_assert(Idx < 3,
"Invalid row access");
436 this->v_[XX] =
x.x(); this->v_[XY] =
y.x(); this->v_[XZ] = z.
x();
437 this->v_[YX] =
x.y(); this->v_[YY] =
y.y(); this->v_[YZ] = z.
y();
438 this->v_[ZX] =
x.z(); this->v_[ZY] =
y.z(); this->v_[ZZ] = z.
z();
450 this->v_[XX] =
x.x(); this->v_[XY] =
x.y(); this->v_[XZ] =
x.z();
451 this->v_[YX] =
y.x(); this->v_[YY] =
y.y(); this->v_[YZ] =
y.z();
452 this->v_[ZX] = z.
x(); this->v_[ZY] = z.
y(); this->v_[ZZ] = z.
z();
465 case 0: col<0>(v);
break;
466 case 1: col<1>(v);
break;
467 case 2: col<2>(v);
break;
484 case 0: row<0>(v);
break;
485 case 1: row<1>(v);
break;
486 case 2: row<2>(v);
break;
497 return Vector<Cmpt>(this->v_[XX], this->v_[YY], this->v_[ZZ]);
504 this->v_[XX] = v.
x(); this->v_[YY] = v.
y(); this->v_[ZZ] = v.
z();
516 &&
mag(xy()) < tol &&
mag(xz()) < tol
517 &&
mag(yx()) < tol &&
mag(yz()) < tol
518 &&
mag(zx()) < tol &&
mag(zy()) < tol
580 *
this = this->inner(t);
598 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero; this->v_[XZ] =
Zero;
599 this->v_[YX] =
Zero; this->v_[YY] = st.
ii(); this->v_[YZ] =
Zero;
600 this->v_[ZX] =
Zero; this->v_[ZY] =
Zero; this->v_[ZZ] = st.
ii();
607 this->v_[XX] = st.
xx(); this->v_[XY] = st.
xy(); this->v_[XZ] = st.
xz();
608 this->v_[YX] = st.
xy(); this->v_[YY] = st.
yy(); this->v_[YZ] = st.
yz();
609 this->v_[ZX] = st.
xz(); this->v_[ZY] = st.
yz(); this->v_[ZZ] = st.
zz();
616 this->v_[XX] =
tr.x().x();
617 this->v_[XY] =
tr.x().y();
618 this->v_[XZ] =
tr.x().z();
620 this->v_[YX] =
tr.y().x();
621 this->v_[YY] =
tr.y().y();
622 this->v_[YZ] =
tr.y().z();
624 this->v_[ZX] =
tr.z().x();
625 this->v_[ZY] =
tr.z().y();
626 this->v_[ZZ] =
tr.z().z();
641 return t.
xx() + t.
yy() + t.
zz();
662 t.
xx(), 0.5*(t.
xy() + t.
yx()), 0.5*(t.
xz() + t.
zx()),
663 t.
yy(), 0.5*(t.
yz() + t.
zy()),
675 2*t.
xx(), (t.
xy() + t.
yx()), (t.
xz() + t.
zx()),
676 2*t.
yy(), (t.
yz() + t.
zy()),
758 if (
mag(dett) < VSMALL)
761 <<
"Tensor is not invertible due to the (almost) zero determinant:"
762 <<
" Tensor = " << t <<
nl
763 <<
" det(Tensor) = " << dett
768 return cof(t).
T()/dett;
825 st1.
ii() + t2.
xx(), t2.
xy(), t2.
xz(),
826 t2.
yx(), st1.
ii() + t2.
yy(), t2.
yz(),
827 t2.
zx(), t2.
zy(), st1.
ii() + t2.
zz()
839 t1.
xx() + st2.
ii(), t1.
xy(), t1.
xz(),
840 t1.
yx(), t1.
yy() + st2.
ii(), t1.
yz(),
841 t1.
zx(), t1.
zy(), t1.
zz() + st2.
ii()
853 st1.
xx() + t2.
xx(), st1.
xy() + t2.
xy(), st1.
xz() + t2.
xz(),
854 st1.
xy() + t2.
yx(), st1.
yy() + t2.
yy(), st1.
yz() + t2.
yz(),
855 st1.
xz() + t2.
zx(), st1.
yz() + t2.
zy(), st1.
zz() + t2.
zz()
867 t1.
xx() + st2.
xx(), t1.
xy() + st2.
xy(), t1.
xz() + st2.
xz(),
868 t1.
yx() + st2.
xy(), t1.
yy() + st2.
yy(), t1.
yz() + st2.
yz(),
869 t1.
zx() + st2.
xz(), t1.
zy() + st2.
yz(), t1.
zz() + st2.
zz()
881 st1.
ii() - t2.
xx(), -t2.
xy(), -t2.
xz(),
882 -t2.
yx(), st1.
ii() - t2.
yy(), -t2.
yz(),
883 -t2.
zx(), -t2.
zy(), st1.
ii() - t2.
zz()
895 t1.
xx() - st2.
ii(), t1.
xy(), t1.
xz(),
896 t1.
yx(), t1.
yy() - st2.
ii(), t1.
yz(),
897 t1.
zx(), t1.
zy(), t1.
zz() - st2.
ii()
909 st1.
xx() - t2.
xx(), st1.
xy() - t2.
xy(), st1.
xz() - t2.
xz(),
910 st1.
xy() - t2.
yx(), st1.
yy() - t2.
yy(), st1.
yz() - t2.
yz(),
911 st1.
xz() - t2.
zx(), st1.
yz() - t2.
zy(), st1.
zz() - t2.
zz()
923 t1.
xx() - st2.
xx(), t1.
xy() - st2.
xy(), t1.
xz() - st2.
xz(),
924 t1.
yx() - st2.
xy(), t1.
yy() - st2.
yy(), t1.
yz() - st2.
yz(),
925 t1.
zx() - st2.
xz(), t1.
zy() - st2.
yz(), t1.
zz() - st2.
zz()
953inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt>>
::type
970 <<
" is not divisible due to a zero value in Cmpt:"
987inline typename innerProduct<Tensor<Cmpt>, Tensor<Cmpt>>
::type
1029 st1.
xx()*t2.
xx() + st1.
xy()*t2.
yx() + st1.
xz()*t2.
zx(),
1030 st1.
xx()*t2.
xy() + st1.
xy()*t2.
yy() + st1.
xz()*t2.
zy(),
1031 st1.
xx()*t2.
xz() + st1.
xy()*t2.
yz() + st1.
xz()*t2.
zz(),
1033 st1.
xy()*t2.
xx() + st1.
yy()*t2.
yx() + st1.
yz()*t2.
zx(),
1034 st1.
xy()*t2.
xy() + st1.
yy()*t2.
yy() + st1.
yz()*t2.
zy(),
1035 st1.
xy()*t2.
xz() + st1.
yy()*t2.
yz() + st1.
yz()*t2.
zz(),
1037 st1.
xz()*t2.
xx() + st1.
yz()*t2.
yx() + st1.
zz()*t2.
zx(),
1038 st1.
xz()*t2.
xy() + st1.
yz()*t2.
yy() + st1.
zz()*t2.
zy(),
1051 t1.
xx()*st2.
xx() + t1.
xy()*st2.
xy() + t1.
xz()*st2.
xz(),
1052 t1.
xx()*st2.
xy() + t1.
xy()*st2.
yy() + t1.
xz()*st2.
yz(),
1053 t1.
xx()*st2.
xz() + t1.
xy()*st2.
yz() + t1.
xz()*st2.
zz(),
1055 t1.
yx()*st2.
xx() + t1.
yy()*st2.
xy() + t1.
yz()*st2.
xz(),
1056 t1.
yx()*st2.
xy() + t1.
yy()*st2.
yy() + t1.
yz()*st2.
yz(),
1057 t1.
yx()*st2.
xz() + t1.
yy()*st2.
yz() + t1.
yz()*st2.
zz(),
1059 t1.
zx()*st2.
xx() + t1.
zy()*st2.
xy() + t1.
zz()*st2.
xz(),
1060 t1.
zx()*st2.
xy() + t1.
zy()*st2.
yy() + t1.
zz()*st2.
yz(),
1068#if defined(__GNUC__) && !defined(__clang__)
1070__attribute__((optimize(
"no-tree-vectorize")))
1072inline typename innerProduct<Tensor<Cmpt>, Vector<Cmpt>>
::type
1077 t.
xx()*v.
x() + t.
xy()*v.
y() + t.
xz()*v.
z(),
1078 t.
yx()*v.
x() + t.
yy()*v.
y() + t.
yz()*v.
z(),
1079 t.
zx()*v.
x() + t.
zy()*v.
y() + t.
zz()*v.
z()
1086inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt>>
::type
1091 v.
x()*t.
xx() + v.
y()*t.
yx() + v.
z()*t.
zx(),
1092 v.
x()*t.
xy() + v.
y()*t.
yy() + v.
z()*t.
zy(),
1093 v.
x()*t.
xz() + v.
y()*t.
yz() + v.
z()*t.
zz()
1103 return (st1.
ii()*t2.
xx() + st1.
ii()*t2.
yy() + st1.
ii()*t2.
zz());
1112 return (t1.
xx()*st2.
ii() + t1.
yy()*st2.
ii() + t1.
zz()*st2.
ii());
1123 st1.
xx()*t2.
xx() + st1.
xy()*t2.
xy() + st1.
xz()*t2.
xz() +
1124 st1.
xy()*t2.
yx() + st1.
yy()*t2.
yy() + st1.
yz()*t2.
yz() +
1137 t1.
xx()*st2.
xx() + t1.
xy()*st2.
xy() + t1.
xz()*st2.
xz() +
1138 t1.
yx()*st2.
xy() + t1.
yy()*st2.
yy() + t1.
yz()*st2.
yz() +
1146inline typename outerProduct<Vector<Cmpt>, Vector<Cmpt>>
::type
1151 v1.
x()*v2.
x(), v1.
x()*v2.
y(), v1.
x()*v2.
z(),
1152 v1.
y()*v2.
x(), v1.
y()*v2.
y(), v1.
y()*v2.
z(),
1153 v1.
z()*v2.
x(), v1.
z()*v2.
y(), v1.
z()*v2.
z()
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,...
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements,...
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
bool is_identity(const scalar tol=ROOTVSMALL) const
Is identity tensor?
Tensor< Cmpt > T() const
Return non-Hermitian transpose.
void rows(const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
Set row values.
void operator&=(const Tensor< Cmpt > &t)
Assign inner-product of this with another Tensor.
Tensor & operator=(const Tensor &)=default
Copy assignment.
Vector< Cmpt > row() const
Extract vector for given row: compile-time check of index.
Vector< Cmpt > z() const
Extract vector for row 2.
Vector< Cmpt > cz() const
Extract vector for column 2.
Tensor< Cmpt > inner(const Tensor< Cmpt > &t2) const
Inner-product of this with another Tensor.
Tensor< Cmpt > inv() const
Return inverse.
Vector< Cmpt > cx() const
Extract vector for column 0.
Vector< Cmpt > cy() const
Extract vector for column 1.
void cols(const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
Set column values.
Vector< Cmpt > y() const
Extract vector for row 1.
Vector< Cmpt > col() const
Extract vector for given column: compile-time check of index.
Tensor()=default
Default construct.
Tensor< Cmpt > schur(const Tensor< Cmpt > &t2) const
Schur-product of this with another Tensor.
Vector< Cmpt > diag() const
Extract the diagonal as a vector.
Vector< Cmpt > x() const
Extract vector for row 0.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
dimensioned< Type > T() const
Return transpose.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
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.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
Cmpt invariantII(const SymmTensor< Cmpt > &st)
Return the 2nd invariant of a SymmTensor.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
Cmpt invariantIII(const SymmTensor< Cmpt > &st)
Return the 3rd invariant of a SymmTensor.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Cmpt invariantI(const SymmTensor< Cmpt > &st)
Return the 1st invariant of a SymmTensor.
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.
static constexpr const zero Zero
Global zero (0)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensioned< typename scalarProduct< Type1, Type2 >::type > operator&&(const dimensioned< Type1 > &, const dimensioned< Type2 > &)
dimensionedTensor skew(const dimensionedTensor &dt)
constexpr char nl
The newline '\n' character (0x0a)
A non-counting (dummy) refCount.