41 const label len = result.
size();
47 || len != yy.
size() || len != yz.
size()
52 <<
"Components sizes do not match: " << len <<
" (" 53 << xx.
size() <<
' ' << xy.
size() <<
' ' << xz.
size() <<
' ' 54 << yy.
size() <<
' ' << yz.
size() <<
' ' 61 for (label i=0; i < len; ++i)
63 result[i] = value_type
76 const UList<SymmTensor<Cmpt>>&
input,
77 Field<Cmpt>& xx, Field<Cmpt>& xy, Field<Cmpt>& xz,
78 Field<Cmpt>& yy, Field<Cmpt>& yz,
82 const label len =
input.size();
87 len != xx.size() || len != xy.size() || len != xz.size()
88 || len != yy.size() || len != yz.size()
93 <<
"Components sizes do not match: " << len <<
" (" 94 << xx.size() <<
' ' << xy.size() <<
' ' << xz.size() <<
' ' 95 << yy.size() <<
' ' << yz.size() <<
' ' 102 for (label i=0; i < len; ++i)
106 zz[i] =
input[i].zz();
115 const Field<Cmpt>& xx,
const Field<Cmpt>& xy,
const Field<Cmpt>& xz,
116 const Field<Cmpt>& yy,
const Field<Cmpt>& yz,
117 const Field<Cmpt>& zz
120 auto tresult = tmp<Field<SymmTensor<Cmpt>>>
::New(xx.size());
122 Foam::zip(tresult.ref(), xx, xy, xz, yy, yz, zz);
131 Field<SymmTensor<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)
154 result[i].xx() =
x[i].x();
155 result[i].xy() =
x[i].y();
156 result[i].xz() =
x[i].z();
158 result[i].yy() =
y[i].y();
159 result[i].yz() =
y[i].z();
161 result[i].zz() = z[i].z();
169 const UList<SymmTensor<Cmpt>>&
input,
170 Field<Vector<Cmpt>>&
x,
171 Field<Vector<Cmpt>>&
y,
172 Field<Vector<Cmpt>>& z
175 const label len =
input.size();
178 if (len !=
x.size() || len !=
y.size() || len != z.size())
181 <<
"Components sizes do not match: " << len <<
" (" 182 <<
x.size() <<
' ' <<
y.size() <<
' ' << z.size() <<
')' 188 for (label i=0; i < len; ++i)
200 const UList<SymmTensor<Cmpt>>&
input,
202 Field<Vector<Cmpt>>& result
205 const label len =
input.size();
208 if (len != result.size())
211 <<
"Components sizes do not match: " << len <<
" (" 212 << result.size() <<
')' 220 case vector::components::X :
222 for (label i=0; i < len; ++i)
224 result[i] =
input[i].x();
231 for (label i=0; i < len; ++i)
233 result[i] =
input[i].y();
238 case vector::components::Z :
240 for (label i=0; i < len; ++i)
242 result[i] =
input[i].z();
253 const UList<SymmTensor<Cmpt>>&
input,
254 Field<Vector<Cmpt>>& result
257 const label len =
input.size();
260 if (len != result.size())
263 <<
"Components sizes do not match: " << len <<
" (" 264 << result.size() <<
')' 270 for (label i=0; i < len; ++i)
272 result[i] =
input[i].diag();
281 const Field<SymmTensor<Cmpt>>&
input,
285 auto tresult = tmp<Field<Vector<Cmpt>>>
::New(
input.size());
297 const Field<SymmTensor<Cmpt>>&
input 300 auto tresult = tmp<Field<Vector<Cmpt>>>
::New(
input.size());
void size(const label n)
Older name for setAddressableSize.
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements, derived from VectorSpace.
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.
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.
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...
static constexpr direction size() noexcept
The number of elements in the VectorSpace = Ncmpts.
PtrList< volScalarField > & Y
A class for managing temporary objects.