33 template<class> class PrimitiveField \
40 template<class> class PrimitiveField1, \
41 template<class> class PrimitiveField2 \
48 template<class> class PrimitiveField1, \
49 template<class> class PrimitiveField2, \
50 template<class> class PrimitiveField3 \
95 template<
class>
class PrimitiveField1,
96 template<
class>
class PrimitiveField2,
119 template<
class>
class PrimitiveField,
122 tmp<GeometricField<typename powProduct<Type, r>::type, GeoMesh, Field>>
135 "pow(" + gf.
name() +
',' +
name(r) +
')',
141 pow<Type, GeoMesh, Field, PrimitiveField, r>(tPow.
ref(), gf);
151 template<
class>
class PrimitiveField,
154 tmp<GeometricField<typename powProduct<Type, r>::type, GeoMesh, Field>>
169 "pow(" + gf.
name() +
',' +
name(r) +
')',
175 pow<Type, GeoMesh, Field, PrimitiveField, r>
205 tmp<GeometricField<typename outerProduct<Type, Type>::type, GeoMesh, Field>>
214 "sqr(" + gf.
name() +
')',
227 tmp<GeometricField<typename outerProduct<Type, Type>::type, GeoMesh, Field>>
238 "sqr(" + gf.
name() +
')',
274 "magSqr(" + gf.
name() +
')',
298 "magSqr(" + gf.
name() +
')',
334 "mag(" + gf.
name() +
')',
358 "mag(" + gf.
name() +
')',
408 "cmptAv(" + gf.
name() +
')',
441 "cmptAv(" + gf.
name() +
')',
457 #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \
460 dimensioned<returnType> func \
462 const GeometricField<Type, GeoMesh, PrimitiveField>& gf \
465 return dimensioned<Type> \
467 #func "(" + gf.name() + ')', \
469 Foam::func(gFunc(gf.primitiveField()), gFunc(gf.boundaryField())) \
474 dimensioned<returnType> func \
476 const tmp<GeometricField<Type, GeoMesh, PrimitiveField>>& tgf1 \
479 dimensioned<returnType> res = func(tgf1()); \
487 #undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY
490 #define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \
493 dimensioned<returnType> func \
495 const GeometricField<Type, GeoMesh, PrimitiveField>& gf \
498 return dimensioned<Type> \
500 #func "(" + gf.name() + ')', \
502 gFunc(gf.primitiveField()) \
507 dimensioned<returnType> func \
509 const tmp<GeometricField<Type, GeoMesh, PrimitiveField>>& tgf1 \
512 dimensioned<returnType> res = func(tgf1()); \
521 #undef UNARY_REDUCTION_FUNCTION
551 #define PRODUCT_OPERATOR(product, op, opFunc) \
558 template<class> class PrimitiveField1, \
559 template<class> class PrimitiveField2, \
560 template<class> class PrimitiveField3 \
566 typename product<Type1, Type2>::type, \
570 const GeometricField<Type1, GeoMesh, PrimitiveField2>& gf1, \
571 const GeometricField<Type2, GeoMesh, PrimitiveField3>& gf2 \
576 gf.primitiveFieldRef(), \
577 gf1.primitiveField(), \
578 gf2.primitiveField() \
582 gf.boundaryFieldRef(), \
583 gf1.boundaryField(), \
584 gf2.boundaryField() \
593 template<class> class PrimitiveField1, \
594 template<class> class PrimitiveField2 \
596 tmp<GeometricField<typename product<Type1, Type2>::type, GeoMesh, Field>> \
599 const GeometricField<Type1, GeoMesh, PrimitiveField1>& gf1, \
600 const GeometricField<Type2, GeoMesh, PrimitiveField2>& gf2 \
603 typedef typename product<Type1, Type2>::type productType; \
605 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
607 GeometricField<productType, GeoMesh, Field>::New \
609 '(' + gf1.name() + #op + gf2.name() + ')', \
611 gf1.dimensions() op gf2.dimensions() \
615 Foam::opFunc(tRes.ref(), gf1, gf2); \
625 template<class> class PrimitiveField1, \
626 template<class> class PrimitiveField2 \
628 tmp<GeometricField<typename product<Type1, Type2>::type, GeoMesh, Field>> \
631 const GeometricField<Type1, GeoMesh, PrimitiveField1>& gf1, \
632 const tmp<GeometricField<Type2, GeoMesh, PrimitiveField2>>& tgf2 \
635 typedef typename product<Type1, Type2>::type productType; \
637 const GeometricField<Type2, GeoMesh, PrimitiveField2>& gf2 = tgf2(); \
639 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
641 reuseTmpGeometricField \
642 <productType, Type2, GeoMesh, PrimitiveField2>::New \
645 '(' + gf1.name() + #op + gf2.name() + ')', \
646 gf1.dimensions() op gf2.dimensions() \
650 Foam::opFunc(tRes.ref(), gf1, gf2); \
662 template<class> class PrimitiveField1, \
663 template<class> class PrimitiveField2 \
665 tmp<GeometricField<typename product<Type1, Type2>::type, GeoMesh, Field>> \
668 const tmp<GeometricField<Type1, GeoMesh, PrimitiveField1>>& tgf1, \
669 const GeometricField<Type2, GeoMesh, PrimitiveField2>& gf2 \
672 typedef typename product<Type1, Type2>::type productType; \
674 const GeometricField<Type1, GeoMesh, PrimitiveField1>& gf1 = tgf1(); \
676 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
678 reuseTmpGeometricField \
679 <productType, Type1, GeoMesh, PrimitiveField1>::New \
682 '(' + gf1.name() + #op + gf2.name() + ')', \
683 gf1.dimensions() op gf2.dimensions() \
687 Foam::opFunc(tRes.ref(), gf1, gf2); \
699 template<class> class PrimitiveField1, \
700 template<class> class PrimitiveField2 \
702 tmp<GeometricField<typename product<Type1, Type2>::type, GeoMesh, Field>> \
705 const tmp<GeometricField<Type1, GeoMesh, PrimitiveField1>>& tgf1, \
706 const tmp<GeometricField<Type2, GeoMesh, PrimitiveField2>>& tgf2 \
709 typedef typename product<Type1, Type2>::type productType; \
711 const GeometricField<Type1, GeoMesh, PrimitiveField1>& gf1 = tgf1(); \
712 const GeometricField<Type2, GeoMesh, PrimitiveField2>& gf2 = tgf2(); \
714 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
716 reuseTmpTmpGeometricField \
728 '(' + gf1.name() + #op + gf2.name() + ')', \
729 gf1.dimensions() op gf2.dimensions() \
733 Foam::opFunc(tRes.ref(), gf1, gf2); \
747 template<class> class PrimitiveField1, \
748 template<class> class PrimitiveField2 \
754 typename product<Type, Form>::type, \
758 const GeometricField<Type, GeoMesh, PrimitiveField2>& gf1, \
759 const dimensioned<Form>& dvs \
762 Foam::opFunc(gf.primitiveFieldRef(), gf1.primitiveField(), dvs.value()); \
763 Foam::opFunc(gf.boundaryFieldRef(), gf1.boundaryField(), dvs.value()); \
771 template<class> class PrimitiveField \
773 tmp<GeometricField<typename product<Form, Type>::type, GeoMesh, Field>> \
776 const GeometricField<Type, GeoMesh, PrimitiveField>& gf1, \
777 const dimensioned<Form>& dvs \
780 typedef typename product<Type, Form>::type productType; \
782 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
784 GeometricField<productType, GeoMesh, Field>::New \
786 '(' + gf1.name() + #op + dvs.name() + ')', \
788 gf1.dimensions() op dvs.dimensions() \
792 Foam::opFunc(tRes.ref(), gf1, dvs); \
804 template<class> class PrimitiveField \
806 tmp<GeometricField<typename product<Form, Type>::type, GeoMesh, Field>> \
809 const GeometricField<Type, GeoMesh, PrimitiveField>& gf1, \
810 const VectorSpace<Form, Cmpt, nCmpt>& vs \
813 return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
821 template<class> class PrimitiveField \
823 tmp<GeometricField<typename product<Type, Form>::type, GeoMesh, Field>> \
826 const tmp<GeometricField<Type, GeoMesh, PrimitiveField>>& tgf1, \
827 const dimensioned<Form>& dvs \
830 typedef typename product<Type, Form>::type productType; \
832 const GeometricField<Type, GeoMesh, PrimitiveField>& gf1 = tgf1(); \
834 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
836 reuseTmpGeometricField \
837 <productType, Type, GeoMesh, PrimitiveField>::New \
840 '(' + gf1.name() + #op + dvs.name() + ')', \
841 gf1.dimensions() op dvs.dimensions() \
845 Foam::opFunc(tRes.ref(), gf1, dvs); \
859 template<class> class PrimitiveField \
861 tmp<GeometricField<typename product<Form, Type>::type, GeoMesh, Field>> \
864 const tmp<GeometricField<Type, GeoMesh, PrimitiveField>>& tgf1, \
865 const VectorSpace<Form, Cmpt, nCmpt>& vs \
868 return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
877 template<class> class PrimitiveField1, \
878 template<class> class PrimitiveField2 \
884 typename product<Form, Type>::type, \
888 const dimensioned<Form>& dvs, \
889 const GeometricField<Type, GeoMesh, PrimitiveField2>& gf1 \
892 Foam::opFunc(gf.primitiveFieldRef(), dvs.value(), gf1.primitiveField()); \
893 Foam::opFunc(gf.boundaryFieldRef(), dvs.value(), gf1.boundaryField()); \
901 template<class> class PrimitiveField \
903 tmp<GeometricField<typename product<Form, Type>::type, GeoMesh, Field>> \
906 const dimensioned<Form>& dvs, \
907 const GeometricField<Type, GeoMesh, PrimitiveField>& gf1 \
910 typedef typename product<Form, Type>::type productType; \
912 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
914 GeometricField<productType, GeoMesh, Field>::New \
916 '(' + dvs.name() + #op + gf1.name() + ')', \
918 dvs.dimensions() op gf1.dimensions() \
922 Foam::opFunc(tRes.ref(), dvs, gf1); \
934 template<class> class PrimitiveField \
936 tmp<GeometricField<typename product<Form, Type>::type, GeoMesh, Field>> \
939 const VectorSpace<Form, Cmpt, nCmpt>& vs, \
940 const GeometricField<Type, GeoMesh, PrimitiveField>& gf1 \
943 return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \
951 template<class> class PrimitiveField \
953 tmp<GeometricField<typename product<Form, Type>::type, GeoMesh, Field>> \
956 const dimensioned<Form>& dvs, \
957 const tmp<GeometricField<Type, GeoMesh, PrimitiveField>>& tgf1 \
960 typedef typename product<Form, Type>::type productType; \
962 const GeometricField<Type, GeoMesh, PrimitiveField>& gf1 = tgf1(); \
964 tmp<GeometricField<productType, GeoMesh, Field>> tRes \
966 reuseTmpGeometricField \
967 <productType, Type, GeoMesh, PrimitiveField>::New \
970 '(' + dvs.name() + #op + gf1.name() + ')', \
971 dvs.dimensions() op gf1.dimensions() \
975 Foam::opFunc(tRes.ref(), dvs, gf1); \
989 template<class> class PrimitiveField \
991 tmp<GeometricField<typename product<Form, Type>::type, GeoMesh, Field>> \
994 const VectorSpace<Form, Cmpt, nCmpt>& vs, \
995 const tmp<GeometricField<Type, GeoMesh, PrimitiveField>>& tgf1 \
998 return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \
1009 #undef PRODUCT_OPERATOR
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc)
#define PRODUCT_OPERATOR(product, op, opFunc)
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc)
#define BINARY_TYPE_OPERATOR_FS(TYPE, op, opFunc)
#define BINARY_FUNCTION(func)
#define BINARY_OPERATOR(Template, Type, Type1, Type2, op, opFunc)
#define UNARY_OPERATOR(op, opFunc)
#define UNARY_FUNCTION(Template, Type, Type1, func)
#define BINARY_TYPE_OPERATOR_SF(TYPE, op, opFunc)
const dimensionSet & dimensions() const
Return dimensions.
const Mesh & mesh() const
Return mesh.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Internal::FieldType & primitiveFieldRef()
Return a reference to the primitive field.
Field< Type >::cmptType cmptType
Component type of the elements of the field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
const Internal::FieldType & primitiveField() const
Return a const-reference to the primitive field.
const word & name() const
Return name.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
void subtract(LagrangianPatchField< typename typeOfSum< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void dot(LagrangianPatchField< typename innerProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void negate(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
void cmptMultiply(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< Type > &f2)
Type gSum(const FieldField< Field, Type > &f)
void outer(LagrangianPatchField< typename outerProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void divide(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< scalar > &f2)
void dotdot(LagrangianPatchField< typename scalarProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
scalar gSumMag(const FieldField< Field, Type > &f)
void cmptDivide(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< Type > &f2)
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void cross(LagrangianPatchField< typename crossProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void component(LagrangianPatchField< typename LagrangianPatchField< Type >::cmptType > &sf, const LagrangianPatchField< Type > &f, const direction d)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
void multiply(LagrangianPatchField< Type > &f, const LagrangianPatchField< scalar > &f1, const LagrangianPatchField< Type > &f2)
dimensionSet transform(const dimensionSet &)
void cmptAv(LagrangianPatchField< typename LagrangianPatchField< Type >::cmptType > &f, const LagrangianPatchField< Type > &f1)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
Type gAverage(const FieldField< Field, Type > &f)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
Type gMin(const FieldField< Field, Type > &f)
void add(LagrangianPatchField< typename typeOfSum< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
Type gMax(const FieldField< Field, Type > &f)
void cmptMag(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)