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();
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();
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();
280 case vector::components::Y :
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();
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();
333 case vector::components::Y :
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,
389 auto tresult = tmp<Field<Vector<Cmpt>>>::New(input.size());
401 const Field<Tensor<Cmpt>>& input,
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());
Generic templated field type.
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
static constexpr direction size() noexcept
The number of elements in the VectorSpace = Ncmpts.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void zipCols(FieldField< Field, SymmTensor< Cmpt > > &result, const FieldField< Field, Vector< Cmpt > > &x, const FieldField< Field, Vector< Cmpt > > &y, const FieldField< Field, Vector< Cmpt > > &z)
Zip together symmTensor field from column components.
void zipRows(FieldField< Field, SymmTensor< Cmpt > > &result, const FieldField< Field, Vector< Cmpt > > &x, const FieldField< Field, Vector< Cmpt > > &y, const FieldField< Field, Vector< Cmpt > > &z)
Zip together symmTensor field field from row components.
void unzipDiag(const FieldField< Field, SymmTensor< Cmpt > > &input, FieldField< Field, Vector< Cmpt > > &result)
Extract a symmTensor field field diagonal.
void unzipCol(const FieldField< Field, SymmTensor< Cmpt > > &input, const direction idx, FieldField< Field, Vector< Cmpt > > &result)
Extract a symmTensor field field column (x,y,z) == (0,1,2)
errorManip< error > abort(error &err)
void unzipRows(const FieldField< Field, SymmTensor< Cmpt > > &input, FieldField< Field, Vector< Cmpt > > &x, FieldField< Field, Vector< Cmpt > > &y, FieldField< Field, Vector< Cmpt > > &z)
Extract symmTensor field field rows.
void unzip(const FieldField< Field, SphericalTensor< Cmpt > > &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
void unzipRow(const FieldField< Field, SymmTensor< Cmpt > > &input, const direction idx, FieldField< Field, Vector< Cmpt > > &result)
Extract a symmTensor field field row (x,y,z) == (0,1,2)
void unzipCols(const FieldField< Field, SymmTensor< Cmpt > > &input, FieldField< Field, Vector< Cmpt > > &x, FieldField< Field, Vector< Cmpt > > &y, FieldField< Field, Vector< Cmpt > > &z)
Extract symmTensor field field columns.
void zip(FieldField< Field, SphericalTensor< Cmpt > > &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
constexpr char nl
The newline '\n' character (0x0a)