30 #define TEMPLATE template<class Type>
63 template<
class Type, direction r>
73 powProductType, res, =,
pow, Type, vf, powProductType,
78 template<
class Type, direction r>
88 powProductType, res, =,
pow, Type, vf, powProductType,
94 template<
class Type, direction r>
95 tmp<Field<typename powProduct<Type, r>::type>>
107 pow<Type, r>(tRes.
ref(),
f);
111 template<
class Type, direction r>
112 tmp<Field<typename powProduct<Type, r>::type>>
124 pow<Type, r>(tRes.
ref(),
f);
128 template<
class Type, direction r>
129 tmp<Field<typename powProduct<Type, r>::type>>
138 pow<Type, r>(tRes.
ref(),
tf());
156 tmp<Field<typename outerProduct<Type, Type>::type>>
169 tmp<Field<typename outerProduct<Type, Type>::type>>
182 tmp<Field<typename outerProduct<Type, Type>::type>>
425 #define PRODUCT_OPERATOR(product, Op, OpFunc) \
427 template<class Type1, class Type2> \
430 Field<typename product<Type1, Type2>::type>& res, \
431 const UList<Type1>& f1, \
432 const UList<Type2>& f2 \
435 typedef typename product<Type1, Type2>::type productType; \
436 TFOR_ALL_F_OP_F_OP_F(productType, res, =, Type1, f1, Op, Type2, f2) \
439 template<class Type1, class Type2> \
440 tmp<Field<typename product<Type1, Type2>::type>> \
441 operator Op(const Field<Type1>& f1, const Field<Type2>& f2) \
443 typedef typename product<Type1, Type2>::type productType; \
444 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
445 OpFunc(tRes.ref(), f1, f2); \
449 template<class Type1, class Type2> \
450 tmp<Field<typename product<Type1, Type2>::type>> \
451 operator Op(const Field<Type1>& f1, const SubField<Type2>& f2) \
453 typedef typename product<Type1, Type2>::type productType; \
454 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
455 OpFunc(tRes.ref(), f1, f2); \
459 template<class Type1, class Type2> \
460 tmp<Field<typename product<Type1, Type2>::type>> \
461 operator Op(const SubField<Type1>& f1, const Field<Type2>& f2) \
463 typedef typename product<Type1, Type2>::type productType; \
464 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
465 OpFunc(tRes.ref(), f1, f2); \
469 template<class Type1, class Type2> \
470 tmp<Field<typename product<Type1, Type2>::type>> \
471 operator Op(const SubField<Type1>& f1, const SubField<Type2>& f2) \
473 typedef typename product<Type1, Type2>::type productType; \
474 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
475 OpFunc(tRes.ref(), f1, f2); \
479 template<class Type1, class Type2> \
480 tmp<Field<typename product<Type1, Type2>::type>> \
481 operator Op(const Field<Type1>& f1, const tmp<Field<Type2>>& tf2) \
483 typedef typename product<Type1, Type2>::type productType; \
484 tmp<Field<productType>> tRes = reuseTmp<productType, Type2>::New(tf2); \
485 OpFunc(tRes.ref(), f1, tf2()); \
490 template<class Type1, class Type2> \
491 tmp<Field<typename product<Type1, Type2>::type>> \
492 operator Op(const SubField<Type1>& f1, const tmp<Field<Type2>>& tf2) \
494 typedef typename product<Type1, Type2>::type productType; \
495 tmp<Field<productType>> tRes = reuseTmp<productType, Type2>::New(tf2); \
496 OpFunc(tRes.ref(), f1, tf2()); \
501 template<class Type1, class Type2> \
502 tmp<Field<typename product<Type1, Type2>::type>> \
503 operator Op(const tmp<Field<Type1>>& tf1, const Field<Type2>& f2) \
505 typedef typename product<Type1, Type2>::type productType; \
506 tmp<Field<productType>> tRes = reuseTmp<productType, Type1>::New(tf1); \
507 OpFunc(tRes.ref(), tf1(), f2); \
512 template<class Type1, class Type2> \
513 tmp<Field<typename product<Type1, Type2>::type>> \
514 operator Op(const tmp<Field<Type1>>& tf1, const SubField<Type2>& f2) \
516 typedef typename product<Type1, Type2>::type productType; \
517 tmp<Field<productType>> tRes = reuseTmp<productType, Type1>::New(tf1); \
518 OpFunc(tRes.ref(), tf1(), f2); \
523 template<class Type1, class Type2> \
524 tmp<Field<typename product<Type1, Type2>::type>> \
525 operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2) \
527 typedef typename product<Type1, Type2>::type productType; \
528 tmp<Field<productType>> tRes = \
529 reuseTmpTmp<productType, Type1, Type1, Type2>::New(tf1, tf2); \
530 OpFunc(tRes.ref(), tf1(), tf2()); \
536 template<class Type, class Form, class Cmpt, direction nCmpt> \
539 Field<typename product<Type, Form>::type>& res, \
540 const UList<Type>& f1, \
541 const VectorSpace<Form,Cmpt,nCmpt>& vs \
544 typedef typename product<Type, Form>::type productType; \
545 TFOR_ALL_F_OP_F_OP_S \
546 (productType, res, =,Type, f1, Op, Form, static_cast<const Form&>(vs)) \
549 template<class Type, class Form, class Cmpt, direction nCmpt> \
550 tmp<Field<typename product<Type, Form>::type>> \
551 operator Op(const Field<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs) \
553 typedef typename product<Type, Form>::type productType; \
554 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
555 OpFunc(tRes.ref(), f1, static_cast<const Form&>(vs)); \
559 template<class Type, class Form, class Cmpt, direction nCmpt> \
560 tmp<Field<typename product<Type, Form>::type>> \
561 operator Op(const SubField<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs) \
563 typedef typename product<Type, Form>::type productType; \
564 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
565 OpFunc(tRes.ref(), f1, static_cast<const Form&>(vs)); \
569 template<class Type, class Form, class Cmpt, direction nCmpt> \
570 tmp<Field<typename product<Type, Form>::type>> \
573 const tmp<Field<Type>>& tf1, \
574 const VectorSpace<Form,Cmpt,nCmpt>& vs \
577 typedef typename product<Type, Form>::type productType; \
578 tmp<Field<productType>> tRes = reuseTmp<productType, Type>::New(tf1); \
579 OpFunc(tRes.ref(), tf1(), static_cast<const Form&>(vs)); \
584 template<class Form, class Cmpt, direction nCmpt, class Type> \
587 Field<typename product<Form, Type>::type>& res, \
588 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
589 const UList<Type>& f1 \
592 typedef typename product<Form, Type>::type productType; \
593 TFOR_ALL_F_OP_S_OP_F \
594 (productType, res, =,Form,static_cast<const Form&>(vs), Op, Type, f1) \
597 template<class Form, class Cmpt, direction nCmpt, class Type> \
598 tmp<Field<typename product<Form, Type>::type>> \
599 operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const Field<Type>& f1) \
601 typedef typename product<Form, Type>::type productType; \
602 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
603 OpFunc(tRes.ref(), static_cast<const Form&>(vs), f1); \
607 template<class Form, class Cmpt, direction nCmpt, class Type> \
608 tmp<Field<typename product<Form, Type>::type>> \
609 operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const SubField<Type>& f1) \
611 typedef typename product<Form, Type>::type productType; \
612 tmp<Field<productType>> tRes(new Field<productType>(f1.size())); \
613 OpFunc(tRes.ref(), static_cast<const Form&>(vs), f1); \
617 template<class Form, class Cmpt, direction nCmpt, class Type> \
618 tmp<Field<typename product<Form, Type>::type>> \
621 const VectorSpace<Form,Cmpt,nCmpt>& vs, const tmp<Field<Type>>& tf1 \
624 typedef typename product<Form, Type>::type productType; \
625 tmp<Field<productType>> tRes = reuseTmp<productType, Type>::New(tf1); \
626 OpFunc(tRes.ref(), static_cast<const Form&>(vs), tf1()); \
639 #undef PRODUCT_OPERATOR
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
#define PRODUCT_OPERATOR(product, Op, OpFunc)
#define TFOR_ALL_F_OP_FUNC_F_S(typeF1, f1, OP, FUNC, typeF2, f2, typeS, s)
#define TFOR_ALL_F_OP_F_FUNC(typeF1, f1, OP, typeF2, f2, FUNC)
#define TFOR_ALL_F_OP_F_FUNC_S(typeF1, f1, OP, typeF2, f2, FUNC, typeS, s)
#define TFOR_ALL_F_OP_FUNC_F(typeF1, f1, OP, FUNC, typeF2, f2)
Inter-processor communication reduction functions.
Pre-declare SubField and related Field type.
pTraits< Type >::cmptType cmptType
Component type.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
Pre-declare related SubField type.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Traits class for primitives.
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
static tmp< Field< TypeR > > New(const tmp< Field< Type1 >> &tf1)
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
void subtract(GeometricField< typename typeOfSum< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
void outer(GeometricField< typename outerProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
void add(GeometricField< typename typeOfSum< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMultiply(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
void divide(pointPatchField< Type > &f, const pointPatchField< Type > &f1, const pointPatchField< scalar > &f2)
void cmptMax(Field< typename Field< Type >::cmptType > &res, const UList< Type > &f)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void component(GeometricField< typename GeometricField< Type, GeoMesh, PrimitiveField1 >::cmptType, GeoMesh, PrimitiveField1 > &gcf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf, const direction d)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptDivide(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
void dotdot(GeometricField< typename scalarProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void cmptMin(Field< typename Field< Type >::cmptType > &res, const UList< Type > &f)
void cross(GeometricField< typename crossProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh, PrimitiveField >::cmptType, GeoMesh, Field >> cmptAv(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void multiply(pointPatchField< Type > &f, const pointPatchField< scalar > &f1, const pointPatchField< Type > &f2)
void negate(pointPatchField< Type > &f, const pointPatchField< Type > &f1)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void dot(GeometricField< typename innerProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)