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;
541 #if defined(__GNUC__) && !defined(__clang__) 543 __attribute__((optimize(
"no-tree-vectorize")))
568 #if defined(__GNUC__) && !defined(__clang__) 570 __attribute__((optimize(
"no-tree-vectorize")))
590 const Cmpt detval = this->
det();
593 if (
mag(detval) < VSMALL)
596 <<
"Tensor not properly invertible, determinant:" 597 << detval <<
" tensor:" << *
this <<
nl 602 return this->adjunct()/detval;
620 const scalar threshold = SMALL * (magSqr_xx + magSqr_yy + magSqr_zz);
622 const bool small_xx = (magSqr_xx < threshold);
623 const bool small_yy = (magSqr_yy < threshold);
624 const bool small_zz = (magSqr_zz < threshold);
626 if (small_xx || small_yy || small_zz)
634 const Cmpt detval = work.
det();
636 if (
mag(detval) < ROOTVSMALL)
652 const Cmpt detval = this->
det();
654 if (
mag(detval) < ROOTVSMALL)
657 return Tensor<Cmpt>(
Zero);
660 return this->adjunct()/detval;
669 *
this = this->inner(t);
674 template<
class Cmpt2>
687 this->v_[XX] = st.
ii(); this->v_[XY] =
Zero; this->v_[XZ] =
Zero;
688 this->v_[YX] =
Zero; this->v_[YY] = st.
ii(); this->v_[YZ] =
Zero;
689 this->v_[ZX] =
Zero; this->v_[ZY] =
Zero; this->v_[ZZ] = st.
ii();
696 this->v_[XX] = st.
xx(); this->v_[XY] = st.
xy(); this->v_[XZ] = st.
xz();
697 this->v_[YX] = st.
xy(); this->v_[YY] = st.
yy(); this->v_[YZ] = st.
yz();
698 this->v_[ZX] = st.
xz(); this->v_[ZY] = st.
yz(); this->v_[ZZ] = st.
zz();
705 this->v_[XX] =
tr.x().x();
706 this->v_[XY] =
tr.x().y();
707 this->v_[XZ] =
tr.x().z();
709 this->v_[YX] =
tr.y().x();
710 this->v_[YY] =
tr.y().y();
711 this->v_[YZ] =
tr.y().z();
713 this->v_[ZX] =
tr.z().x();
714 this->v_[ZY] =
tr.z().y();
715 this->v_[ZZ] =
tr.z().z();
730 return t.
xx() + t.
yy() + t.
zz();
751 t.
xx(), 0.5*(t.
xy() + t.
yx()), 0.5*(t.
xz() + t.
zx()),
752 t.
yy(), 0.5*(t.
yz() + t.
zy()),
760 inline SymmTensor<Cmpt>
twoSymm(
const Tensor<Cmpt>& t)
764 2*t.xx(), (t.xy() + t.yx()), (t.xz() + t.zx()),
765 2*t.yy(), (t.yz() + t.zy()),
773 inline SymmTensor<Cmpt>
devSymm(
const Tensor<Cmpt>& t)
775 const Cmpt
sph(
tr(t)/3.0);
779 t.xx() -
sph, 0.5*(t.xy() + t.yx()), 0.5*(t.xz() + t.zx()),
780 t.yy() -
sph, 0.5*(t.yz() + t.zy()),
788 inline SymmTensor<Cmpt>
devTwoSymm(
const Tensor<Cmpt>& t)
790 const Cmpt
sph((2.0/3.0)*
tr(t));
792 return SymmTensor<Cmpt>
794 2*t.xx() -
sph, (t.xy() + t.yx()), (t.xz() + t.zx()),
795 2*t.yy() -
sph, (t.yz() + t.zy()),
803 inline Tensor<Cmpt>
skew(
const Tensor<Cmpt>& t)
807 Zero, 0.5*(t.xy() - t.yx()), 0.5*(t.xz() - t.zx()),
808 0.5*(t.yx() - t.xy()),
Zero, 0.5*(t.yz() - t.zy()),
809 0.5*(t.zx() - t.xz()), 0.5*(t.zy() - t.yz()),
Zero 816 inline const Tensor<Cmpt>&
skew(
const SymmTensor<Cmpt>& st)
824 inline Tensor<Cmpt>
dev(
const Tensor<Cmpt>& t)
832 inline Tensor<Cmpt>
dev2(
const Tensor<Cmpt>& t)
840 inline Cmpt
det(
const Tensor<Cmpt>& t)
859 if (
mag(detval) < VSMALL)
862 <<
"Tensor not properly invertible, determinant:" 863 << detval <<
" tensor:" << t <<
nl 874 inline Tensor<Cmpt>
inv(
const Tensor<Cmpt>& t)
894 t.xx()*t.yy() + t.yy()*t.zz() + t.xx()*t.zz()
895 - t.xy()*t.yx() - t.yz()*t.zy() - t.xz()*t.zx()
910 inline Tensor<Cmpt>
lerp 912 const Tensor<Cmpt>& a,
913 const Tensor<Cmpt>&
b,
917 const scalar onet = (1-t);
921 onet*a.xx() + t*
b.xx(),
922 onet*a.xy() + t*
b.xy(),
923 onet*a.xz() + t*
b.xz(),
924 onet*a.yx() + t*
b.yx(),
925 onet*a.yy() + t*
b.yy(),
926 onet*a.yz() + t*
b.yz(),
927 onet*a.zx() + t*
b.zx(),
928 onet*a.zy() + t*
b.zy(),
929 onet*a.zz() + t*
b.zz()
939 operator+(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
943 st1.ii() + t2.xx(), t2.xy(), t2.xz(),
944 t2.yx(), st1.ii() + t2.yy(), t2.yz(),
945 t2.zx(), t2.zy(), st1.ii() + t2.zz()
953 operator+(
const Tensor<Cmpt>& t1,
const SphericalTensor<Cmpt>& st2)
957 t1.xx() + st2.ii(), t1.xy(), t1.xz(),
958 t1.yx(), t1.yy() + st2.ii(), t1.yz(),
959 t1.zx(), t1.zy(), t1.zz() + st2.ii()
967 operator+(
const SymmTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
971 st1.xx() + t2.xx(), st1.xy() + t2.xy(), st1.xz() + t2.xz(),
972 st1.xy() + t2.yx(), st1.yy() + t2.yy(), st1.yz() + t2.yz(),
973 st1.xz() + t2.zx(), st1.yz() + t2.zy(), st1.zz() + t2.zz()
981 operator+(
const Tensor<Cmpt>& t1,
const SymmTensor<Cmpt>& st2)
985 t1.xx() + st2.xx(), t1.xy() + st2.xy(), t1.xz() + st2.xz(),
986 t1.yx() + st2.xy(), t1.yy() + st2.yy(), t1.yz() + st2.yz(),
987 t1.zx() + st2.xz(), t1.zy() + st2.yz(), t1.zz() + st2.zz()
995 operator-(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
999 st1.ii() - t2.xx(), -t2.xy(), -t2.xz(),
1000 -t2.yx(), st1.ii() - t2.yy(), -t2.yz(),
1001 -t2.zx(), -t2.zy(), st1.ii() - t2.zz()
1007 template<
class Cmpt>
1009 operator-(
const Tensor<Cmpt>& t1,
const SphericalTensor<Cmpt>& st2)
1013 t1.xx() - st2.ii(), t1.xy(), t1.xz(),
1014 t1.yx(), t1.yy() - st2.ii(), t1.yz(),
1015 t1.zx(), t1.zy(), t1.zz() - st2.ii()
1021 template<
class Cmpt>
1027 st1.
xx() - t2.
xx(), st1.
xy() - t2.
xy(), st1.
xz() - t2.
xz(),
1028 st1.
xy() - t2.
yx(), st1.
yy() - t2.
yy(), st1.
yz() - t2.
yz(),
1029 st1.
xz() - t2.
zx(), st1.
yz() - t2.
zy(), st1.
zz() - t2.
zz()
1035 template<
class Cmpt>
1041 t1.
xx() - st2.
xx(), t1.
xy() - st2.
xy(), t1.
xz() - st2.
xz(),
1042 t1.
yx() - st2.
xy(), t1.
yy() - st2.
yy(), t1.
yz() - st2.
yz(),
1043 t1.
zx() - st2.
xz(), t1.
zy() - st2.
yz(), t1.
zz() - st2.
zz()
1049 template<
class Cmpt>
1057 template<
class Cmpt>
1058 inline Tensor<Cmpt>
operator*(
const Vector<Cmpt>& v)
1062 Zero, -v.z(), v.y(),
1063 v.z(),
Zero, -v.x(),
1070 template<
class Cmpt>
1071 inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt>>
::type 1072 operator/(
const Vector<Cmpt>& v,
const Tensor<Cmpt>& t)
1079 template<
class Cmpt>
1081 operator/(
const Tensor<Cmpt>& t,
const Cmpt
s)
1084 if (
mag(
s) < VSMALL)
1088 <<
" is not divisible due to a zero value in Cmpt:" 1096 t.xx()/
s, t.xy()/
s, t.xz()/
s,
1098 t.zx()/
s, t.zy()/
s, t.zz()/
s 1104 template<
class Cmpt>
1105 inline typename innerProduct<Tensor<Cmpt>, Tensor<Cmpt>>
::type 1106 operator&(
const Tensor<Cmpt>& t1,
const Tensor<Cmpt>& t2)
1108 return t1.inner(t2);
1113 template<
class Cmpt>
1114 #if defined(__GNUC__) && !defined(__clang__) 1116 __attribute__((optimize(
"no-tree-vectorize")))
1119 operator&(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1123 st1.ii()*t2.xx(), st1.ii()*t2.xy(), st1.ii()*t2.xz(),
1124 st1.ii()*t2.yx(), st1.ii()*t2.yy(), st1.ii()*t2.yz(),
1125 st1.ii()*t2.zx(), st1.ii()*t2.zy(), st1.ii()*t2.zz()
1131 template<
class Cmpt>
1132 #if defined(__GNUC__) && !defined(__clang__) 1134 __attribute__((optimize(
"no-tree-vectorize")))
1149 template<
class Cmpt>
1150 #if defined(__GNUC__) && !defined(__clang__) 1152 __attribute__((optimize(
"no-tree-vectorize")))
1155 operator&(
const SymmTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1159 st1.xx()*t2.xx() + st1.xy()*t2.yx() + st1.xz()*t2.zx(),
1160 st1.xx()*t2.xy() + st1.xy()*t2.yy() + st1.xz()*t2.zy(),
1161 st1.xx()*t2.xz() + st1.xy()*t2.yz() + st1.xz()*t2.zz(),
1163 st1.xy()*t2.xx() + st1.yy()*t2.yx() + st1.yz()*t2.zx(),
1164 st1.xy()*t2.xy() + st1.yy()*t2.yy() + st1.yz()*t2.zy(),
1165 st1.xy()*t2.xz() + st1.yy()*t2.yz() + st1.yz()*t2.zz(),
1167 st1.xz()*t2.xx() + st1.yz()*t2.yx() + st1.zz()*t2.zx(),
1168 st1.xz()*t2.xy() + st1.yz()*t2.yy() + st1.zz()*t2.zy(),
1169 st1.xz()*t2.xz() + st1.yz()*t2.yz() + st1.zz()*t2.zz()
1175 template<
class Cmpt>
1176 #if defined(__GNUC__) && !defined(__clang__) 1178 __attribute__((optimize(
"no-tree-vectorize")))
1185 t1.
xx()*st2.
xx() + t1.
xy()*st2.
xy() + t1.
xz()*st2.
xz(),
1186 t1.
xx()*st2.
xy() + t1.
xy()*st2.
yy() + t1.
xz()*st2.
yz(),
1187 t1.
xx()*st2.
xz() + t1.
xy()*st2.
yz() + t1.
xz()*st2.
zz(),
1189 t1.
yx()*st2.
xx() + t1.
yy()*st2.
xy() + t1.
yz()*st2.
xz(),
1190 t1.
yx()*st2.
xy() + t1.
yy()*st2.
yy() + t1.
yz()*st2.
yz(),
1191 t1.
yx()*st2.
xz() + t1.
yy()*st2.
yz() + t1.
yz()*st2.
zz(),
1193 t1.
zx()*st2.
xx() + t1.
zy()*st2.
xy() + t1.
zz()*st2.
xz(),
1194 t1.
zx()*st2.
xy() + t1.
zy()*st2.
yy() + t1.
zz()*st2.
yz(),
1201 template<
class Cmpt>
1202 #if defined(__GNUC__) && !defined(__clang__) 1204 __attribute__((optimize(
"no-tree-vectorize")))
1207 operator&(
const Tensor<Cmpt>& t,
const Vector<Cmpt>& v)
1211 t.xx()*v.x() + t.xy()*v.y() + t.xz()*v.z(),
1212 t.yx()*v.x() + t.yy()*v.y() + t.yz()*v.z(),
1213 t.zx()*v.x() + t.zy()*v.y() + t.zz()*v.z()
1219 template<
class Cmpt>
1220 #if defined(__GNUC__) && !defined(__clang__) 1222 __attribute__((optimize(
"no-tree-vectorize")))
1229 v.
x()*t.
xx() + v.
y()*t.
yx() + v.
z()*t.
zx(),
1230 v.
x()*t.
xy() + v.
y()*t.
yy() + v.
z()*t.
zy(),
1231 v.
x()*t.
xz() + v.
y()*t.
yz() + v.
z()*t.
zz()
1237 template<
class Cmpt>
1239 operator&&(
const SphericalTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1241 return (st1.ii()*t2.xx() + st1.ii()*t2.yy() + st1.ii()*t2.zz());
1246 template<
class Cmpt>
1250 return (t1.
xx()*st2.
ii() + t1.
yy()*st2.
ii() + t1.
zz()*st2.
ii());
1255 template<
class Cmpt>
1257 operator&&(
const SymmTensor<Cmpt>& st1,
const Tensor<Cmpt>& t2)
1261 st1.xx()*t2.xx() + st1.xy()*t2.xy() + st1.xz()*t2.xz() +
1262 st1.xy()*t2.yx() + st1.yy()*t2.yy() + st1.yz()*t2.yz() +
1263 st1.xz()*t2.zx() + st1.yz()*t2.zy() + st1.zz()*t2.zz()
1269 template<
class Cmpt>
1271 operator&&(
const Tensor<Cmpt>& t1,
const SymmTensor<Cmpt>& st2)
1275 t1.xx()*st2.xx() + t1.xy()*st2.xy() + t1.xz()*st2.xz() +
1276 t1.yx()*st2.xy() + t1.yy()*st2.yy() + t1.yz()*st2.yz() +
1277 t1.zx()*st2.xz() + t1.zy()*st2.yz() + t1.zz()*st2.zz()
1283 template<
class Cmpt>
1284 inline typename outerProduct<Vector<Cmpt>, Vector<Cmpt>>
::type 1285 operator*(
const Vector<Cmpt>& v1,
const Vector<Cmpt>& v2)
1289 v1.x()*v2.x(), v1.x()*v2.y(), v1.x()*v2.z(),
1290 v1.y()*v2.x(), v1.y()*v2.y(), v1.y()*v2.z(),
1291 v1.z()*v2.x(), v1.z()*v2.y(), v1.z()*v2.z()
1298 template<
class Cmpt>
1299 class typeOfSum<SphericalTensor<Cmpt>, Tensor<Cmpt>>
1303 typedef Tensor<Cmpt>
type;
1307 template<
class Cmpt>
1316 template<
class Cmpt>
1317 class innerProduct<SphericalTensor<Cmpt>, Tensor<Cmpt>>
1325 template<
class Cmpt>
1326 class innerProduct<Tensor<Cmpt>, SphericalTensor<Cmpt>>
1334 template<
class Cmpt>
1335 class typeOfSum<SymmTensor<Cmpt>, Tensor<Cmpt>>
1339 typedef Tensor<Cmpt>
type;
1343 template<
class Cmpt>
1344 class typeOfSum<Tensor<Cmpt>, SymmTensor<Cmpt>>
1352 template<
class Cmpt>
1353 class innerProduct<SymmTensor<Cmpt>, Tensor<Cmpt>>
1357 typedef Tensor<Cmpt>
type;
1361 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