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,
252 const vector::components cmpt,
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,
305 const vector::components cmpt,
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,
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());