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
82 const label len = input.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)
104 xx[i] = input[i].xx(); xy[i] = input[i].xy(); xz[i] = input[i].xz();
105 yy[i] = input[i].yy(); yz[i] = input[i].yz();
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);
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();
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)
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();
229 case vector::components::Y :
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();
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());
Generic templated field type.
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements,...
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 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.
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 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)