46 template<
class Type1,
class Type2>
49 const UList<Type1>& f1,
50 const UList<Type2>& f2,
54 if (f1.size() != f2.size())
57 <<
" Field<"<<pTraits<Type1>::typeName<<
"> f1("<<f1.size()<<
')' 58 <<
" and Field<"<<pTraits<Type2>::typeName<<
"> f2("<<f2.size()<<
')' 59 <<
endl <<
" for operation " << op
64 template<
class Type1,
class Type2,
class Type3>
67 const UList<Type1>& f1,
68 const UList<Type2>& f2,
69 const UList<Type3>& f3,
73 if (f1.size() != f2.size() || f1.size() != f3.size())
76 <<
" Field<"<<pTraits<Type1>::typeName<<
"> f1("<<f1.size()<<
')' 77 <<
", Field<"<<pTraits<Type2>::typeName<<
"> f2("<<f2.size()<<
')' 78 <<
" and Field<"<<pTraits<Type3>::typeName<<
"> f3("<<f3.size()<<
')' 79 <<
endl <<
" for operation " << op
86 template<
class Type1,
class Type2>
95 template<
class Type1,
class Type2,
class Type3>
112 #define TFOR_ALL_F_OP_FUNC_F(typeF1, f1, OP, FUNC, typeF2, f2) \ 115 checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2)"); \ 118 List_ACCESS(typeF1, f1, f1P); \ 119 List_CONST_ACCESS(typeF2, f2, f2P); \ 122 List_FOR_ALL(f1, i) \ 123 List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i)); \ 127 #define TFOR_ALL_F_OP_F_FUNC(typeF1, f1, OP, typeF2, f2, FUNC) \ 130 checkFields(f1, f2, "f1 " #OP " f2" #FUNC); \ 133 List_ACCESS(typeF1, f1, f1P); \ 134 List_CONST_ACCESS(typeF2, f2, f2P); \ 137 List_FOR_ALL(f1, i) \ 138 List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i).FUNC(); \ 144 #define TFOR_ALL_F_OP_FUNC_F_F(typeF1, f1, OP, FUNC, typeF2, f2, typeF3, f3)\ 147 checkFields(f1, f2, f3, "f1 " #OP " " #FUNC "(f2, f3)"); \ 150 List_ACCESS(typeF1, f1, f1P); \ 151 List_CONST_ACCESS(typeF2, f2, f2P); \ 152 List_CONST_ACCESS(typeF3, f3, f3P); \ 155 List_FOR_ALL(f1, i) \ 156 List_ELEM(f1, f1P, i) \ 157 OP FUNC(List_ELEM(f2, f2P, i), List_ELEM(f3, f3P, i)); \ 163 #define TFOR_ALL_S_OP_FUNC_F_F(typeS, s, OP, FUNC, typeF1, f1, typeF2, f2) \ 166 checkFields(f1, f2, "s " #OP " " #FUNC "(f1, f2)"); \ 169 List_CONST_ACCESS(typeF1, f1, f1P); \ 170 List_CONST_ACCESS(typeF2, f2, f2P); \ 173 List_FOR_ALL(f1, i) \ 174 (s) OP FUNC(List_ELEM(f1, f1P, i), List_ELEM(f2, f2P, i)); \ 180 #define TFOR_ALL_F_OP_FUNC_F_S(typeF1, f1, OP, FUNC, typeF2, f2, typeS, s) \ 183 checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2, s)"); \ 186 List_ACCESS(typeF1, f1, f1P); \ 187 List_CONST_ACCESS(typeF2, f2, f2P); \ 190 List_FOR_ALL(f1, i) \ 191 List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i), (s)); \ 197 #define TFOR_ALL_S_OP_FUNC_F_S(typeS1, s1, OP, FUNC, typeF, f, typeS2, s2) \ 200 List_CONST_ACCESS(typeF, f, fP); \ 204 (s1) OP FUNC(List_ELEM(f, fP, i), (s2)); \ 210 #define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2) \ 213 checkFields(f1, f2, "f1 " #OP " " #FUNC "(s, f2)"); \ 216 List_ACCESS(typeF1, f1, f1P); \ 217 List_CONST_ACCESS(typeF2, f2, f2P); \ 220 List_FOR_ALL(f1, i) \ 221 List_ELEM(f1, f1P, i) OP FUNC((s), List_ELEM(f2, f2P, i)); \ 227 #define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2)\ 230 List_ACCESS(typeF1, f1, f1P); \ 233 List_FOR_ALL(f1, i) \ 234 List_ELEM(f1, f1P, i) OP FUNC((s1), (s2)); \ 240 #define TFOR_ALL_F_OP_F_FUNC_S(typeF1, f1, OP, typeF2, f2, FUNC, typeS, s) \ 243 checkFields(f1, f2, "f1 " #OP " f2 " #FUNC "(s)"); \ 246 List_ACCESS(typeF1, f1, f1P); \ 247 List_CONST_ACCESS(typeF2, f2, f2P); \ 250 List_FOR_ALL(f1, i) \ 251 List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i) FUNC((s)); \ 259 #define TFOR_ALL_F_OP_F_OP_F(typeF1, f1, OP1, typeF2, f2, OP2, typeF3, f3) \ 262 checkFields(f1, f2, f3, "f1 " #OP1 " f2 " #OP2 " f3"); \ 265 List_ACCESS(typeF1, f1, f1P); \ 266 List_CONST_ACCESS(typeF2, f2, f2P); \ 267 List_CONST_ACCESS(typeF3, f3, f3P); \ 270 List_FOR_ALL(f1, i) \ 271 List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i) \ 272 OP2 List_ELEM(f3, f3P, i); \ 278 #define TFOR_ALL_F_OP_S_OP_F(typeF1, f1, OP1, typeS, s, OP2, typeF2, f2) \ 281 checkFields(f1, f2, "f1 " #OP1 " s " #OP2 " f2"); \ 284 List_ACCESS(typeF1, f1, f1P); \ 285 List_CONST_ACCESS(typeF2, f2, f2P); \ 288 List_FOR_ALL(f1, i) \ 289 List_ELEM(f1, f1P, i) OP1 (s) OP2 List_ELEM(f2, f2P, i); \ 295 #define TFOR_ALL_F_OP_F_OP_S(typeF1, f1, OP1, typeF2, f2, OP2, typeS, s) \ 298 checkFields(f1, f2, "f1 " #OP1 " f2 " #OP2 " s"); \ 301 List_ACCESS(typeF1, f1, f1P); \ 302 List_CONST_ACCESS(typeF2, f2, f2P); \ 305 List_FOR_ALL(f1, i) \ 306 List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i) OP2 (s); \ 312 #define TFOR_ALL_F_OP_F(typeF1, f1, OP, typeF2, f2) \ 315 checkFields(f1, f2, "f1 " #OP " f2"); \ 319 List_ACCESS(typeF1, f1, f1P); \ 320 List_CONST_ACCESS(typeF2, f2, f2P); \ 323 List_FOR_ALL(f1, i) \ 324 List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i); \ 329 #define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2) \ 332 checkFields(f1, f2, #OP1 " " #OP2 " f2"); \ 336 List_ACCESS(typeF1, f1, f1P); \ 337 List_CONST_ACCESS(typeF2, f2, f2P); \ 340 List_FOR_ALL(f1, i) \ 341 List_ELEM(f1, f1P, i) OP1 OP2 List_ELEM(f2, f2P, i); \ 347 #define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s) \ 350 List_ACCESS(typeF, f, fP); \ 354 List_ELEM(f, fP, i) OP (s); \ 363 #define TFOR_ALL_S_OP_F(typeS, s, OP, typeF, f) \ 366 List_CONST_ACCESS(typeF, f, fP); \ 370 (s) OP List_ELEM(f, fP, i); \ 376 #define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2) \ 379 List_CONST_ACCESS(typeF1, f1, f1P); \ 380 List_CONST_ACCESS(typeF2, f2, f2P); \ 383 List_FOR_ALL(f1, i) \ 384 (s) OP1 List_ELEM(f1, f1P, i) OP2 List_ELEM(f2, f2P, i); \ 390 #define TFOR_ALL_S_OP_FUNC_F(typeS, s, OP, FUNC, typeF, f) \ 393 List_CONST_ACCESS(typeF, f, fP); \ 397 (s) OP FUNC(List_ELEM(f, fP, i)); \
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void checkFields(const FieldField< Field, Type1 > &, const FieldField< Field, Type2 > &, const char *op)
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...
List<T> is a 1D vector of objects of type T, where the size of the vector is known and used for subsc...