Go to the documentation of this file.
48 template<
class Type1,
class Type2>
51 const UList<Type1>& f1,
52 const UList<Type2>& f2,
56 if (f1.size() != f2.size())
59 <<
" Field<"<<pTraits<Type1>::typeName<<
"> f1("<<f1.size()<<
')'
60 <<
" and Field<"<<pTraits<Type2>::typeName<<
"> f2("<<f2.size()<<
')'
62 <<
" for operation " << op
67 template<
class Type1,
class Type2,
class Type3>
70 const UList<Type1>& f1,
71 const UList<Type2>& f2,
72 const UList<Type3>& f3,
76 if (f1.size() != f2.size() || f1.size() != f3.size())
79 <<
" Field<"<<pTraits<Type1>::typeName<<
"> f1("<<f1.size()<<
')'
80 <<
", Field<"<<pTraits<Type2>::typeName<<
"> f2("<<f2.size()<<
')'
81 <<
" and Field<"<<pTraits<Type3>::typeName<<
"> f3("<<f3.size()<<
')'
83 <<
" for operation " << op
90 template<
class Type1,
class Type2>
99 template<
class Type1,
class Type2,
class Type3>
116 #define TFOR_ALL_F_OP_FUNC_F(typeF1, f1, OP, FUNC, typeF2, f2) \
119 checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2)"); \
122 List_ACCESS(typeF1, f1, f1P); \
123 List_CONST_ACCESS(typeF2, f2, f2P); \
126 List_FOR_ALL(f1, i) \
128 (f1P[i]) OP FUNC(f2P[i]); \
132 #define TFOR_ALL_F_OP_F_FUNC(typeF1, f1, OP, typeF2, f2, FUNC) \
135 checkFields(f1, f2, "f1 " #OP " f2" #FUNC); \
138 List_ACCESS(typeF1, f1, f1P); \
139 List_CONST_ACCESS(typeF2, f2, f2P); \
142 List_FOR_ALL(f1, i) \
144 (f1P[i]) OP (f2P[i]).FUNC(); \
150 #define TFOR_ALL_F_OP_FUNC_F_F(typeF1, f1, OP, FUNC, typeF2, f2, typeF3, f3) \
153 checkFields(f1, f2, f3, "f1 " #OP " " #FUNC "(f2, f3)"); \
156 List_ACCESS(typeF1, f1, f1P); \
157 List_CONST_ACCESS(typeF2, f2, f2P); \
158 List_CONST_ACCESS(typeF3, f3, f3P); \
161 List_FOR_ALL(f1, i) \
163 (f1P[i]) OP FUNC((f2P[i]), (f3P[i])); \
169 #define TFOR_ALL_S_OP_FUNC_F_F(typeS, s, OP, FUNC, typeF1, f1, typeF2, f2) \
172 checkFields(f1, f2, "s " #OP " " #FUNC "(f1, f2)"); \
175 List_CONST_ACCESS(typeF1, f1, f1P); \
176 List_CONST_ACCESS(typeF2, f2, f2P); \
179 List_FOR_ALL(f1, i) \
181 (s) OP FUNC((f1P[i]), (f2P[i])); \
187 #define TFOR_ALL_F_OP_FUNC_F_S(typeF1, f1, OP, FUNC, typeF2, f2, typeS, s) \
190 checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2, s)"); \
193 List_ACCESS(typeF1, f1, f1P); \
194 List_CONST_ACCESS(typeF2, f2, f2P); \
197 List_FOR_ALL(f1, i) \
199 (f1P[i]) OP FUNC((f2P[i]), (s)); \
205 #define TFOR_ALL_S_OP_FUNC_F_S(typeS1, s1, OP, FUNC, typeF, f, typeS2, s2) \
208 List_CONST_ACCESS(typeF, f, fP); \
213 (s1) OP FUNC((fP[i]), (s2)); \
219 #define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2) \
222 checkFields(f1, f2, "f1 " #OP " " #FUNC "(s, f2)"); \
225 List_ACCESS(typeF1, f1, f1P); \
226 List_CONST_ACCESS(typeF2, f2, f2P); \
229 List_FOR_ALL(f1, i) \
231 (f1P[i]) OP FUNC((s), (f2P[i])); \
237 #define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2) \
240 List_ACCESS(typeF1, f1, f1P); \
243 List_FOR_ALL(f1, i) \
245 (f1P[i]) OP FUNC((s1), (s2)); \
251 #define TFOR_ALL_F_OP_F_FUNC_S(typeF1, f1, OP, typeF2, f2, FUNC, typeS, s) \
254 checkFields(f1, f2, "f1 " #OP " f2 " #FUNC "(s)"); \
257 List_ACCESS(typeF1, f1, f1P); \
258 List_CONST_ACCESS(typeF2, f2, f2P); \
261 List_FOR_ALL(f1, i) \
263 (f1P[i]) OP (f2P[i]) FUNC((s)); \
269 #define TFOR_ALL_F_OP_F_OP_F(typeF1, f1, OP1, typeF2, f2, OP2, typeF3, f3) \
272 checkFields(f1, f2, f3, "f1 " #OP1 " f2 " #OP2 " f3"); \
275 List_ACCESS(typeF1, f1, f1P); \
276 List_CONST_ACCESS(typeF2, f2, f2P); \
277 List_CONST_ACCESS(typeF3, f3, f3P); \
280 List_FOR_ALL(f1, i) \
282 (f1P[i]) OP1 (f2P[i]) OP2 (f3P[i]); \
288 #define TFOR_ALL_F_OP_S_OP_F(typeF1, f1, OP1, typeS, s, OP2, typeF2, f2) \
291 checkFields(f1, f2, "f1 " #OP1 " s " #OP2 " f2"); \
294 List_ACCESS(typeF1, f1, f1P); \
295 List_CONST_ACCESS(typeF2, f2, f2P); \
298 List_FOR_ALL(f1, i) \
300 (f1P[i]) OP1 (s) OP2 (f2P[i]); \
306 #define TFOR_ALL_F_OP_F_OP_S(typeF1, f1, OP1, typeF2, f2, OP2, typeS, s) \
309 checkFields(f1, f2, "f1 " #OP1 " f2 " #OP2 " s"); \
312 List_ACCESS(typeF1, f1, f1P); \
313 List_CONST_ACCESS(typeF2, f2, f2P); \
316 List_FOR_ALL(f1, i) \
318 (f1P[i]) OP1 (f2P[i]) OP2 (s); \
324 #define TFOR_ALL_F_OP_F(typeF1, f1, OP, typeF2, f2) \
327 checkFields(f1, f2, "f1 " #OP " f2"); \
330 List_ACCESS(typeF1, f1, f1P); \
331 List_CONST_ACCESS(typeF2, f2, f2P); \
334 List_FOR_ALL(f1, i) \
336 (f1P[i]) OP (f2P[i]); \
341 #define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2) \
344 checkFields(f1, f2, #OP1 " " #OP2 " f2"); \
347 List_ACCESS(typeF1, f1, f1P); \
348 List_CONST_ACCESS(typeF2, f2, f2P); \
351 List_FOR_ALL(f1, i) \
353 (f1P[i]) OP1 OP2 (f2P[i]); \
359 #define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s) \
362 List_ACCESS(typeF, f, fP); \
375 #define TFOR_ALL_S_OP_F(typeS, s, OP, typeF, f) \
378 List_CONST_ACCESS(typeF, f, fP); \
389 #define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2) \
392 List_CONST_ACCESS(typeF1, f1, f1P); \
393 List_CONST_ACCESS(typeF2, f2, f2P); \
396 List_FOR_ALL(f1, i) \
398 (s) OP1 (f1P[i]) OP2 (f2P[i]); \
404 #define TFOR_ALL_S_OP_FUNC_F(typeS, s, OP, FUNC, typeF, f) \
407 List_CONST_ACCESS(typeF, f, fP); \
412 (s) OP FUNC(fP[i]); \
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)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Macros for accessing List elements.