47template<
class Type1,
class Type2>
55 if (f1.size() != f2.size())
61 <<
" for operation " << op
66template<
class Type1,
class Type2,
class Type3>
75 if (f1.size() != f2.size() || f1.size() != f3.size())
82 <<
" for operation " << op
87template<
class Type1,
class Type2,
class Type3,
class Type4>
99 f1.size() != f2.size()
100 || f1.size() != f3.size()
101 || f1.size() != f4.size()
110 <<
" for operation " << op
117template<
class Type1,
class Type2>
126template<
class Type1,
class Type2,
class Type3>
136template<
class Type1,
class Type2,
class Type3,
class Type4>
154#define TFOR_ALL_F_OP_FUNC_F(typeF1, f1, OP, FUNC, typeF2, f2) \
157 checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2)"); \
160 List_ACCESS(typeF1, f1, f1P); \
161 List_CONST_ACCESS(typeF2, f2, f2P); \
164 const label loop_len = (f1).size(); \
167 for (label i = 0; i < loop_len; ++i) \
169 (f1P[i]) OP FUNC(f2P[i]); \
176#define TFOR_ALL_F_OP_F_FUNC(typeF1, f1, OP, typeF2, f2, FUNC) \
179 checkFields(f1, f2, "f1 " #OP " f2" #FUNC); \
182 List_ACCESS(typeF1, f1, f1P); \
183 List_CONST_ACCESS(typeF2, f2, f2P); \
186 const label loop_len = (f1).size(); \
189 for (label i = 0; i < loop_len; ++i) \
191 (f1P[i]) OP (f2P[i]).FUNC(); \
198#define TFOR_ALL_F_OP_FUNC_F_F(typeF1, f1, OP, FUNC, typeF2, f2, typeF3, f3) \
201 checkFields(f1, f2, f3, "f1 " #OP " " #FUNC "(f2, f3)"); \
204 List_ACCESS(typeF1, f1, f1P); \
205 List_CONST_ACCESS(typeF2, f2, f2P); \
206 List_CONST_ACCESS(typeF3, f3, f3P); \
209 const label loop_len = (f1).size(); \
212 for (label i = 0; i < loop_len; ++i) \
214 (f1P[i]) OP FUNC((f2P[i]), (f3P[i])); \
221#define TFOR_ALL_S_OP_FUNC_F_F(typeS, s, OP, FUNC, typeF1, f1, typeF2, f2) \
224 checkFields(f1, f2, "s " #OP " " #FUNC "(f1, f2)"); \
227 List_CONST_ACCESS(typeF1, f1, f1P); \
228 List_CONST_ACCESS(typeF2, f2, f2P); \
231 const label loop_len = (f1).size(); \
234 for (label i = 0; i < loop_len; ++i) \
236 (s) OP FUNC((f1P[i]), (f2P[i])); \
243#define TFOR_ALL_F_OP_FUNC_F_S(typeF1, f1, OP, FUNC, typeF2, f2, typeS, s) \
246 checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2, s)"); \
249 List_ACCESS(typeF1, f1, f1P); \
250 List_CONST_ACCESS(typeF2, f2, f2P); \
253 const label loop_len = (f1).size(); \
256 for (label i = 0; i < loop_len; ++i) \
258 (f1P[i]) OP FUNC((f2P[i]), (s)); \
265#define TFOR_ALL_S_OP_FUNC_F_S(typeS1, s1, OP, FUNC, typeF, f, typeS2, s2) \
268 List_CONST_ACCESS(typeF, f, fP); \
271 const label loop_len = (f).size(); \
274 for (label i = 0; i < loop_len; ++i) \
276 (s1) OP FUNC((fP[i]), (s2)); \
283#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2) \
286 checkFields(f1, f2, "f1 " #OP " " #FUNC "(s, f2)"); \
289 List_ACCESS(typeF1, f1, f1P); \
290 List_CONST_ACCESS(typeF2, f2, f2P); \
293 const label loop_len = (f1).size(); \
296 for (label i = 0; i < loop_len; ++i) \
298 (f1P[i]) OP FUNC((s), (f2P[i])); \
305#define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2) \
308 List_ACCESS(typeF1, f1, f1P); \
311 const label loop_len = (f1).size(); \
314 for (label i = 0; i < loop_len; ++i) \
316 (f1P[i]) OP FUNC((s1), (s2)); \
323#define TFOR_ALL_F_OP_F_FUNC_S(typeF1, f1, OP, typeF2, f2, FUNC, typeS, s) \
326 checkFields(f1, f2, "f1 " #OP " f2 " #FUNC "(s)"); \
329 List_ACCESS(typeF1, f1, f1P); \
330 List_CONST_ACCESS(typeF2, f2, f2P); \
333 const label loop_len = (f1).size(); \
336 for (label i = 0; i < loop_len; ++i) \
338 (f1P[i]) OP (f2P[i]) FUNC((s)); \
347#define TFOR_ALL_F_OP_FUNC_F_F_F\
348(typeF1, f1, OP, FUNC, typeF2, f2, typeF3, f3, typeF4, f4) \
351 checkFields(f1, f2, f3, f4, "f1 " #OP " " #FUNC "(f2, f3, f4)"); \
354 List_ACCESS(typeF1, f1, f1P); \
355 List_CONST_ACCESS(typeF2, f2, f2P); \
356 List_CONST_ACCESS(typeF3, f3, f3P); \
357 List_CONST_ACCESS(typeF4, f4, f4P); \
360 const label loop_len = (f1).size(); \
363 for (label i = 0; i < loop_len; ++i) \
365 (f1P[i]) OP FUNC((f2P[i]), (f3P[i]), (f4P[i])); \
371#define TFOR_ALL_F_OP_FUNC_F_F_S\
372(typeF1, f1, OP, FUNC, typeF2, f2, typeF3, f3, typeS4, s4) \
375 checkFields(f1, f2, f3, "f1 " #OP " " #FUNC "(f2, f3, s)"); \
378 List_ACCESS(typeF1, f1, f1P); \
379 List_CONST_ACCESS(typeF2, f2, f2P); \
380 List_CONST_ACCESS(typeF3, f3, f3P); \
383 const label loop_len = (f1).size(); \
386 for (label i = 0; i < loop_len; ++i) \
388 (f1P[i]) OP FUNC((f2P[i]), (f3P[i]), (s4)); \
397#define TFOR_ALL_F_OP_F_OP_F(typeF1, f1, OP1, typeF2, f2, OP2, typeF3, f3) \
400 checkFields(f1, f2, f3, "f1 " #OP1 " f2 " #OP2 " f3"); \
403 List_ACCESS(typeF1, f1, f1P); \
404 List_CONST_ACCESS(typeF2, f2, f2P); \
405 List_CONST_ACCESS(typeF3, f3, f3P); \
408 const label loop_len = (f1).size(); \
411 for (label i = 0; i < loop_len; ++i) \
413 (f1P[i]) OP1 (f2P[i]) OP2 (f3P[i]); \
420#define TFOR_ALL_F_OP_S_OP_F(typeF1, f1, OP1, typeS, s, OP2, typeF2, f2) \
423 checkFields(f1, f2, "f1 " #OP1 " s " #OP2 " f2"); \
426 List_ACCESS(typeF1, f1, f1P); \
427 List_CONST_ACCESS(typeF2, f2, f2P); \
430 const label loop_len = (f1).size(); \
433 for (label i = 0; i < loop_len; ++i) \
435 (f1P[i]) OP1 (s) OP2 (f2P[i]); \
442#define TFOR_ALL_F_OP_F_OP_S(typeF1, f1, OP1, typeF2, f2, OP2, typeS, s) \
445 checkFields(f1, f2, "f1 " #OP1 " f2 " #OP2 " s"); \
448 List_ACCESS(typeF1, f1, f1P); \
449 List_CONST_ACCESS(typeF2, f2, f2P); \
452 const label loop_len = (f1).size(); \
455 for (label i = 0; i < loop_len; ++i) \
457 (f1P[i]) OP1 (f2P[i]) OP2 (s); \
464#define TFOR_ALL_F_OP_F(typeF1, f1, OP, typeF2, f2) \
467 checkFields(f1, f2, "f1 " #OP " f2"); \
470 List_ACCESS(typeF1, f1, f1P); \
471 List_CONST_ACCESS(typeF2, f2, f2P); \
474 const label loop_len = (f1).size(); \
477 for (label i = 0; i < loop_len; ++i) \
479 (f1P[i]) OP (f2P[i]); \
486#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2) \
489 checkFields(f1, f2, #OP1 " " #OP2 " f2"); \
492 List_ACCESS(typeF1, f1, f1P); \
493 List_CONST_ACCESS(typeF2, f2, f2P); \
496 const label loop_len = (f1).size(); \
499 for (label i = 0; i < loop_len; ++i) \
501 (f1P[i]) OP1 OP2 (f2P[i]); \
508#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s) \
511 List_ACCESS(typeF, f, fP); \
514 const label loop_len = (f).size(); \
517 for (label i = 0; i < loop_len; ++i) \
528#define TFOR_ALL_S_OP_F(typeS, s, OP, typeF, f) \
531 List_CONST_ACCESS(typeF, f, fP); \
534 const label loop_len = (f).size(); \
537 for (label i = 0; i < loop_len; ++i) \
546#define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2) \
549 List_CONST_ACCESS(typeF1, f1, f1P); \
550 List_CONST_ACCESS(typeF2, f2, f2P); \
553 const label loop_len = (f1).size(); \
556 for (label i = 0; i < loop_len; ++i) \
558 (s) OP1 (f1P[i]) OP2 (f2P[i]); \
564#define TFOR_ALL_S_OP_FUNC_F(typeS, s, OP, FUNC, typeF, f) \
567 List_CONST_ACCESS(typeF, f, fP); \
570 const label loop_len = (f).size(); \
573 for (label i = 0; i < loop_len; ++i) \
575 (s) OP FUNC(fP[i]); \
Macros for accessing List elements.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A traits class, which is primarily used for primitives and vector-space.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void checkFields(const FieldField< Field, Type1 > &, const FieldField< Field, Type2 > &, const char *op)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...