29 #include <type_traits> 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,
155 return Vector<Cmpt>(this->v_[XX], this->v_[XY], this->v_[XZ]);
162 return Vector<Cmpt>(this->v_[YX], this->v_[YY], this->v_[YZ]);
169 return Vector<Cmpt>(this->v_[ZX], this->v_[ZY], this->v_[ZZ]);
176 return Vector<Cmpt>(this->v_[XX], this->v_[YX], this->v_[ZX]);
183 return Vector<Cmpt>(this->v_[XY], this->v_[YY], this->v_[ZY]);
190 return Vector<Cmpt>(this->v_[XZ], this->v_[YZ], this->v_[ZZ]);
195 template<Foam::direction Idx>
198 if (Idx == 0)
return cx();
199 else if (Idx == 1)
return cy();
200 else if (Idx == 2)
return cz();
202 static_assert(Idx < 3,
"Invalid column access");
212 case 0:
return cx();
break;
213 case 1:
return cy();
break;
214 case 2:
return cz();
break;
225 template<Foam::direction Idx>
228 if (Idx == 0)
return x();
229 else if (Idx == 1)
return y();
230 else if (Idx == 2)
return z();
232 static_assert(Idx < 3,
"Invalid row access");
242 case 0:
return x();
break;
243 case 1:
return y();
break;
244 case 2:
return z();
break;
255 template<Foam::direction Idx>
260 this->v_[XX] = v.
x();
261 this->v_[YX] = v.
y();
262 this->v_[ZX] = v.
z();
266 this->v_[XY] = v.
x();
267 this->v_[YY] = v.
y();
268 this->v_[ZY] = v.
z();
272 this->v_[XZ] = v.
x();
273 this->v_[YZ] = v.
y();
274 this->v_[ZZ] = v.
z();
277 static_assert(Idx < 3,
"Invalid column access");
282 template<Foam::direction Idx>
287 this->v_[XX] = v.
x(); this->v_[XY] = v.
y(); this->v_[XZ] = v.
z();
291 this->v_[YX] = v.
x(); this->v_[YY] = v.
y(); this->v_[YZ] = v.
z();
295 this->v_[ZX] = v.
x(); this->v_[ZY] = v.
y(); this->v_[ZZ] = v.
z();
298 static_assert(Idx < 3,
"Invalid row access");
310 this->v_[XX] =
x.x(); this->v_[XY] =
y.x(); this->v_[XZ] = z.
x();
311 this->v_[YX] =
x.y(); this->v_[YY] =
y.y(); this->v_[YZ] = z.
y();
312 this->v_[ZX] =
x.z(); this->v_[ZY] =
y.z(); this->v_[ZZ] = z.
z();
324 this->v_[XX] =
x.x(); this->v_[XY] =
x.y(); this->v_[XZ] =
x.z();
325 this->v_[YX] =
y.x(); this->v_[YY] =
y.y(); this->v_[YZ] =
y.z();
326 this->v_[ZX] = z.
x(); this->v_[ZY] = z.
y(); this->v_[ZZ] = z.
z();
339 case 0: col<0>(v);
break;
340 case 1: col<1>(v);
break;
341 case 2: col<2>(v);
break;
353 const Vector<Cmpt>& v
358 case 0: row<0>(v);
break;
359 case 1: row<1>(v);
break;
360 case 2: row<2>(v);
break;
371 return Vector<Cmpt>(this->v_[XX], this->v_[YY], this->v_[ZZ]);
378 this->v_[XX] = v.
x(); this->v_[YY] = v.
y(); this->v_[ZZ] = v.
z();
385 this->v_[XX] += v.
x(); this->v_[YY] += v.
y(); this->v_[ZZ] += v.
z();
392 this->v_[XX] -= v.
x(); this->v_[YY] -= v.
y(); this->v_[ZZ] -= v.
z();
416 &&
mag(xy()) < tol &&
mag(xz()) < tol
417 &&
mag(yx()) < tol &&
mag(yz()) < tol
418 &&
mag(zx()) < tol &&
mag(zy()) < tol
442 xx()*yy()*zz() + xy()*yz()*zx()
443 + xz()*yx()*zy() - xx()*yz()*zy()
444 - xy()*yx()*zz() - xz()*yy()*zx()
456 return (yy()*zz() - yz()*zy());
461 return (xx()*zz() - xz()*zx());
466 return (xx()*yy() - xy()*yx());
475 yy()*zz() - zy()*yz(), xz()*zy() - xy()*zz(), xy()*yz() - xz()*yy(),
476 zx()*yz() - yx()*zz(), xx()*zz() - xz()*zx(), yx()*xz() - xx()*yz(),
477 yx()*zy() - yy()*zx(), xy()*zx() - xx()*zy(), xx()*yy() - yx()*xy()
485 return this->adjunct().T();
534 const Cmpt detval = this->det2D(excludeCmpt);
536 return this->adjunct2D(excludeCmpt)/detval;
582 const Cmpt detval = this->
det();
585 if (
mag(detval) < VSMALL)
588 <<
"Tensor not properly invertible, determinant:" 589 << detval <<
" tensor:" << *
this <<
nl 594 return this->adjunct()/detval;
612 const scalar threshold = SMALL * (magSqr_xx + magSqr_yy + magSqr_zz);
614 const bool small_xx = (magSqr_xx < threshold);
615 const bool small_yy = (magSqr_yy < threshold);
616 const bool small_zz = (magSqr_zz < threshold);
618 if (small_xx || small_yy || small_zz)
626 const Cmpt detval = work.
det();
628 if (
mag(detval) < ROOTVSMALL)
644 const Cmpt detval = this->
det();
646 if (
mag(detval) < ROOTVSMALL)
649 return Tensor<Cmpt>(
Zero);
652 return this->adjunct()/detval;
661 *
this = this->inner(t);
666 template<
class Cmpt2>
679 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero; this->v_[XZ] =
Zero;
680 this->v_[YX] =
Zero; this->v_[YY] = st.
ii(); this->v_[YZ] =
Zero;
681 this->v_[ZX] =
Zero; this->v_[ZY] =
Zero; this->v_[ZZ] = st.
ii();
688 this->v_[XX] = st.
xx(); this->v_[XY] = st.
xy(); this->v_[XZ] = st.
xz();
689 this->v_[YX] = st.
xy(); this->v_[YY] = st.
yy(); this->v_[YZ] = st.
yz();
690 this->v_[ZX] = st.
xz(); this->v_[ZY] = st.
yz(); this->v_[ZZ] = st.
zz();
697 this->v_[XX] =
tr.x().x();
698 this->v_[XY] =
tr.x().y();
699 this->v_[XZ] =
tr.x().z();
701 this->v_[YX] =
tr.y().x();
702 this->v_[YY] =
tr.y().y();
703 this->v_[YZ] =
tr.y().z();
705 this->v_[ZX] =
tr.z().x();
706 this->v_[ZY] =
tr.z().y();
707 this->v_[ZZ] =
tr.z().z();
722 return t.
xx() + t.
yy() + t.
zz();
743 t.
xx(), 0.5*(t.
xy() + t.
yx()), 0.5*(t.
xz() + t.
zx()),
744 t.
yy(), 0.5*(t.
yz() + t.
zy()),
752 inline SymmTensor<Cmpt>
twoSymm(
const Tensor<Cmpt>& t)
756 2*t.xx(), (t.xy() + t.yx()), (t.xz() + t.zx()),
757 2*t.yy(), (t.yz() + t.zy()),
765 inline SymmTensor<Cmpt>
devSymm(
const Tensor<Cmpt>& t)
767 const Cmpt
sph(
tr(t)/3.0);
771 t.xx() -
sph, 0.5*(t.xy() + t.yx()), 0.5*(t.xz() + t.zx()),
772 t.yy() -
sph, 0.5*(t.yz() + t.zy()),
780 inline SymmTensor<Cmpt>
devTwoSymm(
const Tensor<Cmpt>& t)
782 const Cmpt
sph((2.0/3.0)*
tr(t));
784 return SymmTensor<Cmpt>
786 2*t.xx() -
sph, (t.xy() + t.yx()), (t.xz() + t.zx()),
787 2*t.yy() -
sph, (t.yz() + t.zy()),
795 inline Tensor<Cmpt>
skew(
const Tensor<Cmpt>& t)
799 Zero, 0.5*(t.xy() - t.yx()), 0.5*(t.xz() - t.zx()),
800 0.5*(t.yx() - t.xy()),
Zero, 0.5*(t.yz() - t.zy()),
801 0.5*(t.zx() - t.xz()), 0.5*(t.zy() - t.yz()),
Zero 808 inline const Tensor<Cmpt>&
skew(
const SymmTensor<Cmpt>& st)
816 inline Tensor<Cmpt>
dev(
const Tensor<Cmpt>& t)
824 inline Tensor<Cmpt>
dev2(
const Tensor<Cmpt>& t)
832 inline Cmpt
det(
const Tensor<Cmpt>& t)
851 if (
mag(detval) < VSMALL)
854 <<
"Tensor not properly invertible, determinant:" 855 << detval <<
" tensor:" << t <<
nl 866 inline Tensor<Cmpt>
inv(
const Tensor<Cmpt>& t)
886 t.xx()*t.yy() + t.yy()*t.zz() + t.xx()*t.zz()
887 - t.xy()*t.yx() - t.yz()*t.zy() - t.xz()*t.zx()
902 inline Tensor<Cmpt>
lerp 904 const Tensor<Cmpt>& a,
905 const Tensor<Cmpt>&
b,
909 const scalar onet = (1-t);
913 onet*a.xx() + t*
b.xx(),
914 onet*a.xy() + t*
b.xy(),
915 onet*a.xz() + t*
b.xz(),
916 onet*a.yx() + t*
b.yx(),
917 onet*a.yy() + t*
b.yy(),
918 onet*a.yz() + t*
b.yz(),
919 onet*a.zx() + t*
b.zx(),
920 onet*a.zy() + t*
b.zy(),
921 onet*a.zz() + t*
b.zz()
931 operator+(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
935 st1.ii() + t2.xx(), t2.xy(), t2.xz(),
936 t2.yx(), st1.ii() + t2.yy(), t2.yz(),
937 t2.zx(), t2.zy(), st1.ii() + t2.zz()
945 operator+(
const Tensor<Cmpt>& t1,
const SphericalTensor<Cmpt>& st2)
949 t1.xx() + st2.ii(), t1.xy(), t1.xz(),
950 t1.yx(), t1.yy() + st2.ii(), t1.yz(),
951 t1.zx(), t1.zy(), t1.zz() + st2.ii()
959 operator+(
const SymmTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
963 st1.xx() + t2.xx(), st1.xy() + t2.xy(), st1.xz() + t2.xz(),
964 st1.xy() + t2.yx(), st1.yy() + t2.yy(), st1.yz() + t2.yz(),
965 st1.xz() + t2.zx(), st1.yz() + t2.zy(), st1.zz() + t2.zz()
973 operator+(
const Tensor<Cmpt>& t1,
const SymmTensor<Cmpt>& st2)
977 t1.xx() + st2.xx(), t1.xy() + st2.xy(), t1.xz() + st2.xz(),
978 t1.yx() + st2.xy(), t1.yy() + st2.yy(), t1.yz() + st2.yz(),
979 t1.zx() + st2.xz(), t1.zy() + st2.yz(), t1.zz() + st2.zz()
987 operator-(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
991 st1.ii() - t2.xx(), -t2.xy(), -t2.xz(),
992 -t2.yx(), st1.ii() - t2.yy(), -t2.yz(),
993 -t2.zx(), -t2.zy(), st1.ii() - t2.zz()
1001 operator-(
const Tensor<Cmpt>& t1,
const SphericalTensor<Cmpt>& st2)
1005 t1.xx() - st2.ii(), t1.xy(), t1.xz(),
1006 t1.yx(), t1.yy() - st2.ii(), t1.yz(),
1007 t1.zx(), t1.zy(), t1.zz() - st2.ii()
1013 template<
class Cmpt>
1019 st1.
xx() - t2.
xx(), st1.
xy() - t2.
xy(), st1.
xz() - t2.
xz(),
1020 st1.
xy() - t2.
yx(), st1.
yy() - t2.
yy(), st1.
yz() - t2.
yz(),
1021 st1.
xz() - t2.
zx(), st1.
yz() - t2.
zy(), st1.
zz() - t2.
zz()
1027 template<
class Cmpt>
1033 t1.
xx() - st2.
xx(), t1.
xy() - st2.
xy(), t1.
xz() - st2.
xz(),
1034 t1.
yx() - st2.
xy(), t1.
yy() - st2.
yy(), t1.
yz() - st2.
yz(),
1035 t1.
zx() - st2.
xz(), t1.
zy() - st2.
yz(), t1.
zz() - st2.
zz()
1041 template<
class Cmpt>
1049 template<
class Cmpt>
1050 inline Tensor<Cmpt>
operator*(
const Vector<Cmpt>& v)
1054 Zero, -v.z(), v.y(),
1055 v.z(),
Zero, -v.x(),
1062 template<
class Cmpt>
1063 inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt>>
::type 1064 operator/(
const Vector<Cmpt>& v,
const Tensor<Cmpt>& t)
1071 template<
class Cmpt>
1073 operator/(
const Tensor<Cmpt>& t,
const Cmpt
s)
1076 if (
mag(
s) < VSMALL)
1080 <<
" is not divisible due to a zero value in Cmpt:" 1088 t.xx()/
s, t.xy()/
s, t.xz()/
s,
1090 t.zx()/
s, t.zy()/
s, t.zz()/
s 1096 template<
class Cmpt>
1097 inline typename innerProduct<Tensor<Cmpt>, Tensor<Cmpt>>
::type 1098 operator&(
const Tensor<Cmpt>& t1,
const Tensor<Cmpt>& t2)
1100 return t1.inner(t2);
1105 template<
class Cmpt>
1107 operator&(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1111 st1.ii()*t2.xx(), st1.ii()*t2.xy(), st1.ii()*t2.xz(),
1112 st1.ii()*t2.yx(), st1.ii()*t2.yy(), st1.ii()*t2.yz(),
1113 st1.ii()*t2.zx(), st1.ii()*t2.zy(), st1.ii()*t2.zz()
1119 template<
class Cmpt>
1121 operator&(
const Tensor<Cmpt>& t1,
const SphericalTensor<Cmpt>& st2)
1125 t1.xx()*st2.ii(), t1.xy()*st2.ii(), t1.xz()*st2.ii(),
1126 t1.yx()*st2.ii(), t1.yy()*st2.ii(), t1.yz()*st2.ii(),
1127 t1.zx()*st2.ii(), t1.zy()*st2.ii(), t1.zz()*st2.ii()
1133 template<
class Cmpt>
1135 operator&(
const SymmTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1139 st1.xx()*t2.xx() + st1.xy()*t2.yx() + st1.xz()*t2.zx(),
1140 st1.xx()*t2.xy() + st1.xy()*t2.yy() + st1.xz()*t2.zy(),
1141 st1.xx()*t2.xz() + st1.xy()*t2.yz() + st1.xz()*t2.zz(),
1143 st1.xy()*t2.xx() + st1.yy()*t2.yx() + st1.yz()*t2.zx(),
1144 st1.xy()*t2.xy() + st1.yy()*t2.yy() + st1.yz()*t2.zy(),
1145 st1.xy()*t2.xz() + st1.yy()*t2.yz() + st1.yz()*t2.zz(),
1147 st1.xz()*t2.xx() + st1.yz()*t2.yx() + st1.zz()*t2.zx(),
1148 st1.xz()*t2.xy() + st1.yz()*t2.yy() + st1.zz()*t2.zy(),
1149 st1.xz()*t2.xz() + st1.yz()*t2.yz() + st1.zz()*t2.zz()
1155 template<
class Cmpt>
1161 t1.
xx()*st2.
xx() + t1.
xy()*st2.
xy() + t1.
xz()*st2.
xz(),
1162 t1.
xx()*st2.
xy() + t1.
xy()*st2.
yy() + t1.
xz()*st2.
yz(),
1163 t1.
xx()*st2.
xz() + t1.
xy()*st2.
yz() + t1.
xz()*st2.
zz(),
1165 t1.
yx()*st2.
xx() + t1.
yy()*st2.
xy() + t1.
yz()*st2.
xz(),
1166 t1.
yx()*st2.
xy() + t1.
yy()*st2.
yy() + t1.
yz()*st2.
yz(),
1167 t1.
yx()*st2.
xz() + t1.
yy()*st2.
yz() + t1.
yz()*st2.
zz(),
1169 t1.
zx()*st2.
xx() + t1.
zy()*st2.
xy() + t1.
zz()*st2.
xz(),
1170 t1.
zx()*st2.
xy() + t1.
zy()*st2.
yy() + t1.
zz()*st2.
yz(),
1177 template<
class Cmpt>
1178 #if defined(__GNUC__) && !defined(__clang__) 1180 __attribute__((optimize(
"no-tree-vectorize")))
1187 t.
xx()*v.
x() + t.
xy()*v.
y() + t.
xz()*v.
z(),
1188 t.
yx()*v.
x() + t.
yy()*v.
y() + t.
yz()*v.
z(),
1189 t.
zx()*v.
x() + t.
zy()*v.
y() + t.
zz()*v.
z()
1195 template<
class Cmpt>
1201 v.
x()*t.
xx() + v.
y()*t.
yx() + v.
z()*t.
zx(),
1202 v.
x()*t.
xy() + v.
y()*t.
yy() + v.
z()*t.
zy(),
1203 v.
x()*t.
xz() + v.
y()*t.
yz() + v.
z()*t.
zz()
1209 template<
class Cmpt>
1211 operator&&(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1213 return (st1.ii()*t2.xx() + st1.ii()*t2.yy() + st1.ii()*t2.zz());
1218 template<
class Cmpt>
1222 return (t1.
xx()*st2.
ii() + t1.
yy()*st2.
ii() + t1.
zz()*st2.
ii());
1227 template<
class Cmpt>
1229 operator&&(
const SymmTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1233 st1.xx()*t2.xx() + st1.xy()*t2.xy() + st1.xz()*t2.xz() +
1234 st1.xy()*t2.yx() + st1.yy()*t2.yy() + st1.yz()*t2.yz() +
1235 st1.xz()*t2.zx() + st1.yz()*t2.zy() + st1.zz()*t2.zz()
1241 template<
class Cmpt>
1243 operator&&(
const Tensor<Cmpt>& t1,
const SymmTensor<Cmpt>& st2)
1247 t1.xx()*st2.xx() + t1.xy()*st2.xy() + t1.xz()*st2.xz() +
1248 t1.yx()*st2.xy() + t1.yy()*st2.yy() + t1.yz()*st2.yz() +
1249 t1.zx()*st2.xz() + t1.zy()*st2.yz() + t1.zz()*st2.zz()
1255 template<
class Cmpt>
1256 inline typename outerProduct<Vector<Cmpt>, Vector<Cmpt>>
::type 1257 operator*(
const Vector<Cmpt>& v1,
const Vector<Cmpt>& v2)
1261 v1.x()*v2.x(), v1.x()*v2.y(), v1.x()*v2.z(),
1262 v1.y()*v2.x(), v1.y()*v2.y(), v1.y()*v2.z(),
1263 v1.z()*v2.x(), v1.z()*v2.y(), v1.z()*v2.z()
1270 template<
class Cmpt>
1271 class typeOfSum<SphericalTensor<Cmpt>, Tensor<Cmpt>>
1275 typedef Tensor<Cmpt>
type;
1279 template<
class Cmpt>
1288 template<
class Cmpt>
1289 class innerProduct<SphericalTensor<Cmpt>, Tensor<Cmpt>>
1297 template<
class Cmpt>
1298 class innerProduct<Tensor<Cmpt>, SphericalTensor<Cmpt>>
1306 template<
class Cmpt>
1307 class typeOfSum<SymmTensor<Cmpt>, Tensor<Cmpt>>
1311 typedef Tensor<Cmpt>
type;
1315 template<
class Cmpt>
1316 class typeOfSum<Tensor<Cmpt>, SymmTensor<Cmpt>>
1324 template<
class Cmpt>
1325 class innerProduct<SymmTensor<Cmpt>, Tensor<Cmpt>>
1329 typedef Tensor<Cmpt>
type;
1333 template<
class Cmpt>
Cmpt invariantII(const SymmTensor< Cmpt > &st)
Return the 2nd invariant of a SymmTensor.
Tensor< Cmpt > adjunct2D(const direction excludeCmpt) const
Return 2D adjunct matrix by excluding given direction.
Cmpt tr(const Tensor< Cmpt > &t)
Return the trace of a Tensor.
const Cmpt & xz() const noexcept
Vector< Cmpt > cx() const
Extract vector for column 0.
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements, derived from VectorSpace.
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
dimensionedTensor skew(const dimensionedTensor &dt)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
Vector< Cmpt > cz() const
Extract vector for column 2.
Tensor< Cmpt > T() const
Return non-Hermitian transpose.
Vector< Cmpt > x() const
Extract vector for row 0.
void subtractDiag(const Vector< Cmpt > &v)
Subtract from the diagonal.
Cmpt det() const
The determinate.
A traits class, which is primarily used for primitives and vector-space.
const Cmpt & xy() const noexcept
dimensionSet operator &&(const dimensionSet &ds1, const dimensionSet &ds2)
SymmTensor< Cmpt > devSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of the symmetric part of a SymmTensor.
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
Vector< Cmpt > y() const
Extract vector for row 1.
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 > &)
Tensor()=default
Default construct.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
const Cmpt & zz() const noexcept
Cmpt det(const Tensor< Cmpt > &t)
Return the determinant of a Tensor.
A templated (3 x 3) diagonal tensor of objects of <T>, effectively containing 1 element, derived from VectorSpace.
Tensor< Cmpt > inv2D(const direction excludeCmpt) const
Return inverse of 2D tensor (by excluding given direction)
Vector< Cmpt > z() const
Extract vector for row 2.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const Cmpt & yz() const noexcept
const Cmpt & xx() const noexcept
const Cmpt & yy() const noexcept
void cols(const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
Set column values.
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
Vector< Cmpt > col() const
Extract vector for given column: compile-time check of index.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
bool is_identity(const scalar tol=ROOTVSMALL) const
Is identity tensor?
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Cmpt invariantIII(const SymmTensor< Cmpt > &st)
Return the 3rd invariant of a SymmTensor.
const Cmpt & zx() const noexcept
const Cmpt & ii() const noexcept
const Cmpt & xx() const noexcept
void rows(const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
Set row values.
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
errorManip< error > abort(error &err)
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
void addDiag(const Vector< Cmpt > &v)
Add to the diagonal.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
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.
Tensor< Cmpt > adjunct() const
Return adjunct matrix (transpose of cofactor matrix)
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)
Tensor< Cmpt > inv() const
Return inverse.
const Cmpt & zy() const noexcept
Tensor< Cmpt > schur(const Tensor< Cmpt > &t2) const
Schur-product of this with another Tensor.
Tensor< Cmpt > safeInv() const
Return inverse, with (ad hoc) failsafe handling of 2D tensors.
Tensor & operator=(const Tensor &)=default
Copy assignment.
const Cmpt & z() const noexcept
Access to the vector z component.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
Vector< Cmpt > diag() const
Extract the diagonal as a vector.
const Cmpt & yy() const noexcept
const Cmpt & zz() const noexcept
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
tmp< GeometricField< Type, faPatchField, areaMesh > > operator &(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
const dimensionedScalar c
Speed of light in a vacuum.
Cmpt invariantI(const SymmTensor< Cmpt > &st)
Return the 1st invariant of a SymmTensor.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
void operator &=(const Tensor< Cmpt > &t)
Assign inner-product of this with another Tensor.
Tensor< Cmpt > cof() const
Return cofactor matrix (transpose of adjunct matrix)
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))
Cmpt det2D(const direction excludeCmpt) const
The 2D determinant by excluding given direction.
const Cmpt & xz() const noexcept
Tensor< Cmpt > inner(const Tensor< Cmpt > &t2) const
Inner-product of this with another Tensor.
scalar diagSqr() const
The L2-norm squared of the diagonal.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) - 2 >::type type
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Vector< Cmpt > cy() const
Extract vector for column 1.
static const Tensor< Cmpt > zero
const Cmpt & xy() const noexcept
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
SymmTensor< Cmpt > devTwoSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of twice the symmetric part of a SymmTensor.
static constexpr const zero Zero
Global zero (0)
Vector< Cmpt > row() const
Extract vector for given row: compile-time check of index.
const Cmpt & yz() const noexcept