Go to the documentation of this file.
35 #define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc) \
40 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
41 const GeometricField<Type1, PatchField, GeoMesh>& gf1 \
44 Foam::Func(res.internalField(), gf1.internalField()); \
45 Foam::Func(res.boundaryField(), gf1.boundaryField()); \
49 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
51 const GeometricField<Type1, PatchField, GeoMesh>& gf1 \
54 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
56 new GeometricField<ReturnType, PatchField, GeoMesh> \
60 #Func "(" + gf1.name() + ')', \
67 Dfunc(gf1.dimensions()) \
71 Foam::Func(tRes(), gf1); \
77 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
79 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1 \
82 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
84 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
86 reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh>::New \
89 #Func "(" + gf1.name() + ')', \
90 Dfunc(gf1.dimensions()) \
94 Foam::Func(tRes(), gf1); \
96 reuseTmpGeometricField \
97 <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \
105 #define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc) \
110 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
111 const GeometricField<Type1, PatchField, GeoMesh>& gf1 \
114 Foam::OpFunc(res.internalField(), gf1.internalField()); \
115 Foam::OpFunc(res.boundaryField(), gf1.boundaryField()); \
119 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
121 const GeometricField<Type1, PatchField, GeoMesh>& gf1 \
124 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
126 new GeometricField<ReturnType, PatchField, GeoMesh> \
137 Dfunc(gf1.dimensions()) \
141 Foam::OpFunc(tRes(), gf1); \
147 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
149 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1 \
152 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
154 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
156 reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh>::New \
160 Dfunc(gf1.dimensions()) \
164 Foam::OpFunc(tRes(), gf1); \
166 reuseTmpGeometricField \
167 <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \
175 #define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
180 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
181 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
182 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
185 Foam::Func(res.internalField(), gf1.internalField(), gf2.internalField());\
186 Foam::Func(res.boundaryField(), gf1.boundaryField(), gf2.boundaryField());\
190 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
192 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
193 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
196 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
198 new GeometricField<ReturnType, PatchField, GeoMesh> \
202 #Func "(" + gf1.name() + ',' + gf2.name() + ')', \
209 Func(gf1.dimensions(), gf2.dimensions()) \
213 Foam::Func(tRes(), gf1, gf2); \
219 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
221 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
222 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
225 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
227 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
229 reuseTmpGeometricField<ReturnType, Type2, PatchField, GeoMesh>::New \
232 #Func "(" + gf1.name() + ',' + gf2.name() + ')', \
233 Func(gf1.dimensions(), gf2.dimensions()) \
237 Foam::Func(tRes(), gf1, gf2); \
239 reuseTmpGeometricField \
240 <ReturnType, Type2, PatchField, GeoMesh>::clear(tgf2); \
246 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
248 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
249 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
252 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
254 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
256 reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh>::New \
259 #Func "(" + gf1.name() + ',' + gf2.name() + ')', \
260 Func(gf1.dimensions(), gf2.dimensions()) \
264 Foam::Func(tRes(), gf1, gf2); \
266 reuseTmpGeometricField \
267 <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \
273 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
275 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
276 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
279 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
280 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
282 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
284 reuseTmpTmpGeometricField \
285 <ReturnType, Type1, Type1, Type2, PatchField, GeoMesh> \
290 #Func "(" + gf1.name() + ',' + gf2.name() + ')', \
291 Func(gf1.dimensions(), gf2.dimensions()) \
295 Foam::Func(tRes(), gf1, gf2); \
297 reuseTmpTmpGeometricField \
298 <ReturnType, Type1, Type1, Type2, PatchField, GeoMesh> \
299 ::clear(tgf1, tgf2); \
306 #define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
311 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
312 const dimensioned<Type1>& dt1, \
313 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
316 Foam::Func(res.internalField(), dt1.value(), gf2.internalField()); \
317 Foam::Func(res.boundaryField(), dt1.value(), gf2.boundaryField()); \
321 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
323 const dimensioned<Type1>& dt1, \
324 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
327 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
329 new GeometricField<ReturnType, PatchField, GeoMesh> \
333 #Func "(" + dt1.name() + ',' + gf2.name() + ')', \
340 Func(dt1.dimensions(), gf2.dimensions()) \
344 Foam::Func(tRes(), dt1, gf2); \
350 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
353 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
356 return Func(dimensioned<Type1>(t1), gf2); \
361 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
363 const dimensioned<Type1>& dt1, \
364 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
367 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
369 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
371 reuseTmpGeometricField<ReturnType, Type2, PatchField, GeoMesh>::New \
374 #Func "(" + dt1.name() + gf2.name() + ',' + ')', \
375 Func(dt1.dimensions(), gf2.dimensions()) \
379 Foam::Func(tRes(), dt1, gf2); \
381 reuseTmpGeometricField \
382 <ReturnType, Type2, PatchField, GeoMesh>::clear(tgf2); \
388 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
391 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
394 return Func(dimensioned<Type1>(t1), tgf2); \
398 #define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
403 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
404 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
405 const dimensioned<Type2>& dt2 \
408 Foam::Func(res.internalField(), gf1.internalField(), dt2.value()); \
409 Foam::Func(res.boundaryField(), gf1.boundaryField(), dt2.value()); \
413 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
415 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
416 const dimensioned<Type2>& dt2 \
419 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
421 new GeometricField<ReturnType, PatchField, GeoMesh> \
425 #Func "(" + gf1.name() + ',' + dt2.name() + ')', \
432 Func(gf1.dimensions(), dt2.dimensions()) \
436 Foam::Func(tRes(), gf1, dt2); \
442 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
444 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
448 return Func(gf1, dimensioned<Type2>(t2)); \
453 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
455 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
456 const dimensioned<Type2>& dt2 \
459 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
461 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
463 reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh>::New \
466 #Func "(" + gf1.name() + ',' + dt2.name() + ')', \
467 Func(gf1.dimensions(), dt2.dimensions()) \
471 Foam::Func(tRes(), gf1, dt2); \
473 reuseTmpGeometricField \
474 <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \
480 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
482 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
486 return Func(tgf1, dimensioned<Type2>(t2)); \
490 #define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
491 BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
492 BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
497 #define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
502 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
503 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
504 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
508 (res.internalField(), gf1.internalField(), gf2.internalField()); \
510 (res.boundaryField(), gf1.boundaryField(), gf2.boundaryField()); \
514 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
516 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
517 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
520 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
522 new GeometricField<ReturnType, PatchField, GeoMesh> \
526 '(' + gf1.name() + OpName + gf2.name() + ')', \
533 gf1.dimensions() Op gf2.dimensions() \
537 Foam::OpFunc(tRes(), gf1, gf2); \
543 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
545 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
546 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
549 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
551 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
553 reuseTmpGeometricField<ReturnType, Type2, PatchField, GeoMesh>::New \
556 '(' + gf1.name() + OpName + gf2.name() + ')', \
557 gf1.dimensions() Op gf2.dimensions() \
561 Foam::OpFunc(tRes(), gf1, gf2); \
563 reuseTmpGeometricField \
564 <ReturnType, Type2, PatchField, GeoMesh>::clear(tgf2); \
570 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
572 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
573 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
576 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
578 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
580 reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh>::New \
583 '(' + gf1.name() + OpName + gf2.name() + ')', \
584 gf1.dimensions() Op gf2.dimensions() \
588 Foam::OpFunc(tRes(), gf1, gf2); \
590 reuseTmpGeometricField \
591 <ReturnType, Type1, PatchField, GeoMesh>::clear(tgf1); \
597 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
599 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
600 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
603 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
604 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
606 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
608 reuseTmpTmpGeometricField \
609 <ReturnType, Type1, Type1, Type2, PatchField, GeoMesh>::New \
613 '(' + gf1.name() + OpName + gf2.name() + ')', \
614 gf1.dimensions() Op gf2.dimensions() \
618 Foam::OpFunc(tRes(), gf1, gf2); \
620 reuseTmpTmpGeometricField \
621 <ReturnType, Type1, Type1, Type2, PatchField, GeoMesh> \
622 ::clear(tgf1, tgf2); \
630 #define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
635 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
636 const dimensioned<Type1>& dt1, \
637 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
640 Foam::OpFunc(res.internalField(), dt1.value(), gf2.internalField()); \
641 Foam::OpFunc(res.boundaryField(), dt1.value(), gf2.boundaryField()); \
645 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
647 const dimensioned<Type1>& dt1, \
648 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
651 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
653 new GeometricField<ReturnType, PatchField, GeoMesh> \
657 '(' + dt1.name() + OpName + gf2.name() + ')', \
664 dt1.dimensions() Op gf2.dimensions() \
668 Foam::OpFunc(tRes(), dt1, gf2); \
674 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
677 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
680 return dimensioned<Type1>(t1) Op gf2; \
685 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
687 const dimensioned<Type1>& dt1, \
688 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
691 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
693 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
695 reuseTmpGeometricField<ReturnType, Type2, PatchField, GeoMesh>::New \
698 '(' + dt1.name() + OpName + gf2.name() + ')', \
699 dt1.dimensions() Op gf2.dimensions() \
703 Foam::OpFunc(tRes(), dt1, gf2); \
705 reuseTmpGeometricField<ReturnType, Type2, PatchField, GeoMesh> \
712 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
715 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
718 return dimensioned<Type1>(t1) Op tgf2; \
722 #define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
727 GeometricField<ReturnType, PatchField, GeoMesh>& res, \
728 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
729 const dimensioned<Type2>& dt2 \
732 Foam::OpFunc(res.internalField(), gf1.internalField(), dt2.value()); \
733 Foam::OpFunc(res.boundaryField(), gf1.boundaryField(), dt2.value()); \
737 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
739 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
740 const dimensioned<Type2>& dt2 \
743 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
745 new GeometricField<ReturnType, PatchField, GeoMesh> \
749 '(' + gf1.name() + OpName + dt2.name() + ')', \
756 gf1.dimensions() Op dt2.dimensions() \
760 Foam::OpFunc(tRes(), gf1, dt2); \
766 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
768 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
772 return gf1 Op dimensioned<Type2>(t2); \
777 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
779 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
780 const dimensioned<Type2>& dt2 \
783 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
785 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > tRes \
787 reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh>::New \
790 '(' + gf1.name() + OpName + dt2.name() + ')', \
791 gf1.dimensions() Op dt2.dimensions() \
795 Foam::OpFunc(tRes(), gf1, dt2); \
797 reuseTmpGeometricField<ReturnType, Type1, PatchField, GeoMesh> \
804 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
806 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
810 return tgf1 Op dimensioned<Type2>(t2); \
814 #define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
815 BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
816 BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)