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
76 const UList<Tensor<Cmpt>>&
input,
77 Field<Cmpt>& xx, Field<Cmpt>& xy, Field<Cmpt>& xz,
78 Field<Cmpt>& yx, Field<Cmpt>& yy, Field<Cmpt>& yz,
79 Field<Cmpt>& zx, Field<Cmpt>& zy, Field<Cmpt>& zz
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)
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);
131 Field<Tensor<Cmpt>>& result,
132 const UList<Vector<Cmpt>>&
x,
133 const UList<Vector<Cmpt>>&
y,
134 const UList<Vector<Cmpt>>& z
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]);
160 Field<Tensor<Cmpt>>& result,
161 const UList<Vector<Cmpt>>&
x,
162 const UList<Vector<Cmpt>>&
y,
163 const UList<Vector<Cmpt>>& z
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]);
189 const UList<Tensor<Cmpt>>&
input,
190 Field<Vector<Cmpt>>&
x,
191 Field<Vector<Cmpt>>&
y,
192 Field<Vector<Cmpt>>& z
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)
220 const UList<Tensor<Cmpt>>&
input,
221 Field<Vector<Cmpt>>&
x,
222 Field<Vector<Cmpt>>&
y,
223 Field<Vector<Cmpt>>& z
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)
251 const UList<Tensor<Cmpt>>&
input,
253 Field<Vector<Cmpt>>& result
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();
304 const UList<Tensor<Cmpt>>&
input,
306 Field<Vector<Cmpt>>& result
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();
357 const UList<Tensor<Cmpt>>&
input,
358 Field<Vector<Cmpt>>& result
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());
void size(const label n)
Older name for setAddressableSize.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
void zip(FieldField< Field, SphericalTensor< Cmpt >> &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
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.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
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 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 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 unzip(const FieldField< Field, SphericalTensor< Cmpt >> &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
void unzipDiag(const FieldField< Field, SymmTensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &result)
Extract a symmTensor field field diagonal.
Generic templated field type.
static Istream & input(Istream &is, IntRange< T > &range)
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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)
static constexpr direction size() noexcept
The number of elements in the VectorSpace = Ncmpts.
PtrList< volScalarField > & Y
A class for managing temporary objects.
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.