29 template<class Type, template<class> class PatchField, class GeoMesh>
39 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
57 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
69 template<
class Type,
template<
class>
class PatchField,
class GeoMesh,
int r>
80 template<
class Type,
template<
class>
class PatchField,
class GeoMesh,
int r>
96 "pow(" + gf.
name() +
',' +
name(r) +
')',
107 pow<Type, r, PatchField, GeoMesh>(tPow(), gf);
113 template<
class Type,
template<
class>
class PatchField,
class GeoMesh,
int r>
131 "pow(" + gf.
name() +
',' +
name(r) +
')',
142 pow<Type, r, PatchField, GeoMesh>(tPow(), gf);
150 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
162 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
182 "sqr(" + gf.
name() +
')',
198 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
220 "sqr(" + gf.
name() +
')',
239 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
250 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
251 tmp<GeometricField<scalar, PatchField, GeoMesh> >
magSqr
262 "magSqr(" + gf.
name() +
')',
278 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
279 tmp<GeometricField<scalar, PatchField, GeoMesh> >
magSqr
292 "magSqr(" + gf.
name() +
')',
311 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
322 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
323 tmp<GeometricField<scalar, PatchField, GeoMesh> >
mag
334 "mag(" + gf.
name() +
')',
350 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
351 tmp<GeometricField<scalar, PatchField, GeoMesh> >
mag
364 "mag(" + gf.
name() +
')',
383 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
399 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
404 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
420 "cmptAv(" + gf.
name() +
')',
436 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
441 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
459 "cmptAv(" + gf.
name() +
')',
478 #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
480 template<class Type, template<class> class PatchField, class GeoMesh> \
481 dimensioned<returnType> func \
483 const GeometricField<Type, PatchField, GeoMesh>& gf \
486 return dimensioned<Type> \
488 #func "(" + gf.name() + ')', \
490 Foam::func(gFunc(gf.internalField()), gFunc(gf.boundaryField())) \
494 template<class Type, template<class> class PatchField, class GeoMesh> \
495 dimensioned<returnType> func \
497 const tmp<GeometricField<Type, PatchField, GeoMesh> >& tgf1 \
500 dimensioned<returnType> res = func(tgf1()); \
508 #undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY
511 #define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \
513 template<class Type, template<class> class PatchField, class GeoMesh> \
514 dimensioned<returnType> func \
516 const GeometricField<Type, PatchField, GeoMesh>& gf \
519 return dimensioned<Type> \
521 #func "(" + gf.name() + ')', \
523 gFunc(gf.internalField()) \
527 template<class Type, template<class> class PatchField, class GeoMesh> \
528 dimensioned<returnType> func \
530 const tmp<GeometricField<Type, PatchField, GeoMesh> >& tgf1 \
533 dimensioned<returnType> res = func(tgf1()); \
542 #undef UNARY_REDUCTION_FUNCTION
560 #ifndef __INTEL_COMPILER
574 #define PRODUCT_OPERATOR(product, op, opFunc) \
577 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
581 <typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \
582 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
583 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
586 Foam::opFunc(gf.internalField(), gf1.internalField(), gf2.internalField());\
587 Foam::opFunc(gf.boundaryField(), gf1.boundaryField(), gf2.boundaryField());\
591 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
594 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
598 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
599 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
602 typedef typename product<Type1, Type2>::type productType; \
603 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes \
605 new GeometricField<productType, PatchField, GeoMesh> \
609 '(' + gf1.name() + #op + gf2.name() + ')', \
616 gf1.dimensions() op gf2.dimensions() \
620 Foam::opFunc(tRes(), gf1, gf2); \
626 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
629 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
633 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \
634 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
637 typedef typename product<Type1, Type2>::type productType; \
639 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
641 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes = \
642 reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh>::New \
645 '(' + gf1.name() + #op + gf2.name() + ')', \
646 gf1.dimensions() op gf2.dimensions() \
649 Foam::opFunc(tRes(), gf1, gf2); \
651 reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh> \
658 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
661 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
665 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
666 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \
669 typedef typename product<Type1, Type2>::type productType; \
671 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
673 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes = \
674 reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh>::New \
677 '(' + gf1.name() + #op + gf2.name() + ')', \
678 gf1.dimensions() op gf2.dimensions() \
681 Foam::opFunc(tRes(), gf1, gf2); \
683 reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh> \
690 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \
693 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \
697 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tgf1, \
698 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tgf2 \
701 typedef typename product<Type1, Type2>::type productType; \
703 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \
704 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \
706 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes = \
707 reuseTmpTmpGeometricField \
708 <productType, Type1, Type1, Type2, PatchField, GeoMesh>::New \
712 '(' + gf1.name() + #op + gf2.name() + ')', \
713 gf1.dimensions() op gf2.dimensions() \
716 Foam::opFunc(tRes(), gf1, gf2); \
718 reuseTmpTmpGeometricField \
719 <productType, Type1, Type1, Type2, PatchField, GeoMesh> \
720 ::clear(tgf1, tgf2); \
726 <class Form, class Type, template<class> class PatchField, class GeoMesh> \
730 <typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \
731 const GeometricField<Type, PatchField, GeoMesh>& gf1, \
732 const dimensioned<Form>& dvs \
735 Foam::opFunc(gf.internalField(), gf1.internalField(), dvs.value()); \
736 Foam::opFunc(gf.boundaryField(), gf1.boundaryField(), dvs.value()); \
740 <class Form, class Type, template<class> class PatchField, class GeoMesh> \
741 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh> > \
744 const GeometricField<Type, PatchField, GeoMesh>& gf1, \
745 const dimensioned<Form>& dvs \
748 typedef typename product<Type, Form>::type productType; \
750 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes \
752 new GeometricField<productType, PatchField, GeoMesh> \
756 '(' + gf1.name() + #op + dvs.name() + ')', \
763 gf1.dimensions() op dvs.dimensions() \
767 Foam::opFunc(tRes(), gf1, dvs); \
777 class Type, template<class> class PatchField, \
780 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh> > \
783 const GeometricField<Type, PatchField, GeoMesh>& gf1, \
784 const VectorSpace<Form,Cmpt,nCmpt>& vs \
787 return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
792 <class Form, class Type, template<class> class PatchField, class GeoMesh> \
793 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh> > \
796 const tmp<GeometricField<Type, PatchField, GeoMesh> >& tgf1, \
797 const dimensioned<Form>& dvs \
800 typedef typename product<Type, Form>::type productType; \
802 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \
804 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes = \
805 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \
808 '(' + gf1.name() + #op + dvs.name() + ')', \
809 gf1.dimensions() op dvs.dimensions() \
812 Foam::opFunc(tRes(), gf1, dvs); \
814 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh> \
825 class Type, template<class> class PatchField, \
828 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh> > \
831 const tmp<GeometricField<Type, PatchField, GeoMesh> >& tgf1, \
832 const VectorSpace<Form,Cmpt,nCmpt>& vs \
835 return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
840 <class Form, class Type, template<class> class PatchField, class GeoMesh> \
844 <typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \
845 const dimensioned<Form>& dvs, \
846 const GeometricField<Type, PatchField, GeoMesh>& gf1 \
849 Foam::opFunc(gf.internalField(), dvs.value(), gf1.internalField()); \
850 Foam::opFunc(gf.boundaryField(), dvs.value(), gf1.boundaryField()); \
854 <class Form, class Type, template<class> class PatchField, class GeoMesh> \
855 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh> > \
858 const dimensioned<Form>& dvs, \
859 const GeometricField<Type, PatchField, GeoMesh>& gf1 \
862 typedef typename product<Form, Type>::type productType; \
863 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes \
865 new GeometricField<productType, PatchField, GeoMesh> \
869 '(' + dvs.name() + #op + gf1.name() + ')', \
876 dvs.dimensions() op gf1.dimensions() \
880 Foam::opFunc(tRes(), dvs, gf1); \
890 class Type, template<class> class PatchField, \
893 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh> > \
896 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
897 const GeometricField<Type, PatchField, GeoMesh>& gf1 \
900 return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \
904 <class Form, class Type, template<class> class PatchField, class GeoMesh> \
905 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh> > \
908 const dimensioned<Form>& dvs, \
909 const tmp<GeometricField<Type, PatchField, GeoMesh> >& tgf1 \
912 typedef typename product<Form, Type>::type productType; \
914 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \
916 tmp<GeometricField<productType, PatchField, GeoMesh> > tRes = \
917 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \
920 '(' + dvs.name() + #op + gf1.name() + ')', \
921 dvs.dimensions() op gf1.dimensions() \
924 Foam::opFunc(tRes(), dvs, gf1); \
926 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh> \
937 class Type, template<class> class PatchField, \
940 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh> > \
943 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
944 const tmp<GeometricField<Type, PatchField, GeoMesh> >& tgf1 \
947 return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \
958 #undef PRODUCT_OPERATOR