Go to the documentation of this file.
41 const label len = result.size();
47 || len != yx.
size() || len != yy.
size() || len != yz.
size()
48 || len != zx.
size() || len != zy.
size() || len != zz.
size()
52 <<
"Components sizes do not match: " << len <<
" ("
53 << xx.
size() <<
' ' << xy.
size() <<
' ' << xz.
size() <<
' '
54 << yx.
size() <<
' ' << yy.
size() <<
' ' << yz.
size() <<
' '
55 << zx.
size() <<
' ' << zy.
size() <<
' ' << zz.
size() <<
')'
61 for (label i=0; i < len; ++i)
63 result[i] = value_type
82 const label len = input.size();
87 len != xx.size() || len != xy.size() || len != xz.size()
88 || len != yx.size() || len != yy.size() || len != yz.size()
89 || len != zx.size() || len != zy.size() || len != zz.size()
93 <<
"Components sizes do not match: " << len <<
" ("
94 << xx.size() <<
' ' << xy.size() <<
' ' << xz.size() <<
' '
95 << yx.size() <<
' ' << yy.size() <<
' ' << yz.size() <<
' '
96 << zx.size() <<
' ' << zy.size() <<
' ' << zz.size() <<
')'
102 for (label i=0; i < len; ++i)
104 xx[i] = input[i].xx(); xy[i] = input[i].xy(); xz[i] = input[i].xz();
105 yx[i] = input[i].yx(); yy[i] = input[i].yy(); yz[i] = input[i].yz();
106 zx[i] = input[i].zx(); zy[i] = input[i].zy(); zz[i] = input[i].zz();
115 const Field<Cmpt>& xx,
const Field<Cmpt>& xy,
const Field<Cmpt>& xz,
116 const Field<Cmpt>& yx,
const Field<Cmpt>& yy,
const Field<Cmpt>& yz,
117 const Field<Cmpt>& zx,
const Field<Cmpt>& zy,
const Field<Cmpt>& zz
120 auto tresult = tmp<Field<Tensor<Cmpt>>>
::New(xx.size());
122 Foam::zip(tresult.ref(), xx, xy, xz, yx, yy, yz, zx, zy, zz);
137 const label len = result.size();
140 if (len !=
x.size() || len !=
y.size() || len != z.size())
143 <<
"Components sizes do not match: " << len <<
" ("
144 <<
x.size() <<
' ' <<
y.size() <<
' ' << z.size() <<
')'
150 for (label i=0; i < len; ++i)
152 result[i].rows(
x[i],
y[i], z[i]);
166 const label len = result.size();
169 if (len !=
x.size() || len !=
y.size() || len != z.size())
172 <<
"Components sizes do not match: " << len <<
" ("
173 <<
x.size() <<
' ' <<
y.size() <<
' ' << z.size() <<
')'
179 for (label i=0; i < len; ++i)
181 result[i].cols(
x[i],
y[i], z[i]);
195 const label len = input.size();
198 if (len !=
x.size() || len !=
y.size() || len != z.size())
201 <<
"Components sizes do not match: " << len <<
" ("
202 <<
x.size() <<
' ' <<
y.size() <<
' ' << z.size() <<
')'
208 for (label i=0; i < len; ++i)
226 const label len = input.size();
229 if (len !=
x.size() || len !=
y.size() || len != z.size())
232 <<
"Components sizes do not match: " << len <<
" ("
233 <<
x.size() <<
' ' <<
y.size() <<
' ' << z.size() <<
')'
239 for (label i=0; i < len; ++i)
241 x[i] = input[i].cx();
242 y[i] = input[i].cy();
243 z[i] = input[i].cz();
252 const vector::components cmpt,
256 const label len = input.size();
259 if (len != result.size())
262 <<
"Components sizes do not match: " << len <<
" ("
263 << result.size() <<
')'
271 case vector::components::X :
273 for (label i=0; i < len; ++i)
275 result[i] = input[i].x();
282 for (label i=0; i < len; ++i)
284 result[i] = input[i].y();
289 case vector::components::Z :
291 for (label i=0; i < len; ++i)
293 result[i] = input[i].z();
305 const vector::components cmpt,
309 const label len = input.size();
312 if (len != result.size())
315 <<
"Components sizes do not match: " << len <<
" ("
316 << result.size() <<
')'
324 case vector::components::X :
326 for (label i=0; i < len; ++i)
328 result[i] = input[i].cx();
335 for (label i=0; i < len; ++i)
337 result[i] = input[i].cy();
342 case vector::components::Z :
344 for (label i=0; i < len; ++i)
346 result[i] = input[i].cz();
361 const label len = input.size();
364 if (len != result.size())
367 <<
"Components sizes do not match: " << len <<
" ("
368 << result.size() <<
')'
374 for (label i=0; i < len; ++i)
376 result[i] = input[i].diag();
385 const Field<Tensor<Cmpt>>& input,
386 const vector::components cmpt
389 auto tresult = tmp<Field<Vector<Cmpt>>>
::New(input.size());
401 const Field<Tensor<Cmpt>>& input,
402 const vector::components cmpt
405 auto tresult = tmp<Field<Vector<Cmpt>>>
::New(input.size());
417 const Field<Tensor<Cmpt>>& input
420 auto tresult = tmp<Field<Vector<Cmpt>>>
::New(input.size());
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
void zipCols(FieldField< Field, Tensor< Cmpt >> &result, const FieldField< Field, Vector< Cmpt >> &x, const FieldField< Field, Vector< Cmpt >> &y, const FieldField< Field, Vector< Cmpt >> &z)
Zip together tensor field from column components.
void unzipRows(const FieldField< Field, Tensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &x, FieldField< Field, Vector< Cmpt >> &y, FieldField< Field, Vector< Cmpt >> &z)
Extract tensor field field rows.
void unzip(const FieldField< Field, SphericalTensor< Cmpt >> &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
A class for managing temporary objects.
void unzipRow(const FieldField< Field, Tensor< Cmpt >> &input, const vector::components cmpt, FieldField< Field, Vector< Cmpt >> &result)
Extract a tensor field field row (x,y,z) == (0,1,2)
void zipRows(FieldField< Field, Tensor< Cmpt >> &result, const FieldField< Field, Vector< Cmpt >> &x, const FieldField< Field, Vector< Cmpt >> &y, const FieldField< Field, Vector< Cmpt >> &z)
Zip together tensor field field from row components.
void unzipCols(const FieldField< Field, Tensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &x, FieldField< Field, Vector< Cmpt >> &y, FieldField< Field, Vector< Cmpt >> &z)
Extract tensor field field columns.
Generic templated field type.
errorManip< error > abort(error &err)
PtrList< volScalarField > & Y
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
void unzipCol(const FieldField< Field, Tensor< Cmpt >> &input, const vector::components cmpt, FieldField< Field, Vector< Cmpt >> &result)
Extract a tensor field field column (x,y,z) == (0,1,2)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void zip(FieldField< Field, SphericalTensor< Cmpt >> &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
void unzipDiag(const FieldField< Field, SymmTensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &result)
Extract a symmTensor field field diagonal.