Go to the documentation of this file.
29 #define TEMPLATE template<template<class> class Field, class Type>
39 template<
template<
class>
class Field,
class Type>
54 template<
template<
class>
class Field,
class Type>
64 template<
template<
class>
class Field,
class Type,
int r>
77 template<
template<
class>
class Field,
class Type,
int r>
89 pow<Type, r>(tRes(),
f);
93 template<
template<
class>
class Field,
class Type,
int r>
105 pow<Type, r>(tRes(),
tf());
111 template<
template<
class>
class Field,
class Type>
124 template<
template<
class>
class Field,
class Type>
137 template<
template<
class>
class Field,
class Type>
152 template<
template<
class>
class Field,
class Type>
161 template<
template<
class>
class Field,
class Type>
173 template<
template<
class>
class Field,
class Type>
187 template<
template<
class>
class Field,
class Type>
196 template<
template<
class>
class Field,
class Type>
208 template<
template<
class>
class Field,
class Type>
222 template<
template<
class>
class Field,
class Type>
235 template<
template<
class>
class Field,
class Type>
236 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType> >
cmptMax
250 template<
template<
class>
class Field,
class Type>
251 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType> >
cmptMax
267 template<
template<
class>
class Field,
class Type>
280 template<
template<
class>
class Field,
class Type>
281 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType> >
cmptMin
295 template<
template<
class>
class Field,
class Type>
296 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType> >
cmptMin
312 template<
template<
class>
class Field,
class Type>
325 template<
template<
class>
class Field,
class Type>
326 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType> >
cmptAv
340 template<
template<
class>
class Field,
class Type>
341 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType> >
cmptAv
357 template<
template<
class>
class Field,
class Type>
370 template<
template<
class>
class Field,
class Type>
371 tmp<FieldField<Field, Type> >
cmptMag
384 template<
template<
class>
class Field,
class Type>
385 tmp<FieldField<Field, Type> >
cmptMag
400 #define TMP_UNARY_FUNCTION(returnType, func) \
402 template<template<class> class Field, class Type> \
403 returnType func(const tmp<FieldField<Field, Type> >& tf1) \
405 returnType res = func(tf1()); \
410 template<
template<
class>
class Field,
class Type>
438 template<
template<
class>
class Field,
class Type>
447 while (!
f[i].size()) i++;
469 template<
template<
class>
class Field,
class Type>
491 template<
template<
class>
class Field,
class Type>
513 template<
template<
class>
class Field,
class Type>
528 <<
"empty fieldField, returning zero" <<
endl;
533 Type avrg =
sum(
f)/
n;
540 <<
"empty fieldField, returning zero" <<
endl;
549 #include "PstreamReduceOps.H"
551 #define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc) \
553 template<template<class> class Field, class Type> \
554 returnType gFunc(const FieldField<Field, Type>& f) \
556 returnType res = func(f); \
557 reduce(res, rFunc##Op<Type>()); \
560 TMP_UNARY_FUNCTION(returnType, gFunc)
567 #undef G_UNARY_FUNCTION
570 template<
template<
class>
class Field,
class Type>
591 <<
"empty fieldField, returning zero" <<
endl;
599 #undef TMP_UNARY_FUNCTION
629 #define PRODUCT_OPERATOR(product, op, opFunc) \
633 template<class> class Field1, \
634 template<class> class Field2, \
640 FieldField<Field1, typename product<Type1, Type2>::type>& f, \
641 const FieldField<Field1, Type1>& f1, \
642 const FieldField<Field2, Type2>& f2 \
647 opFunc(f[i], f1[i], f2[i]); \
653 template<class> class Field1, \
654 template<class> class Field2, \
658 tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
661 const FieldField<Field1, Type1>& f1, \
662 const FieldField<Field2, Type2>& f2 \
665 typedef typename product<Type1, Type2>::type productType; \
666 tmp<FieldField<Field1, productType> > tRes \
668 FieldField<Field1, productType>::NewCalculatedType(f1) \
670 opFunc(tRes(), f1, f2); \
674 template<template<class> class Field, class Type1, class Type2> \
675 tmp<FieldField<Field, typename product<Type1, Type2>::type> > \
678 const FieldField<Field, Type1>& f1, \
679 const tmp<FieldField<Field, Type2> >& tf2 \
682 typedef typename product<Type1, Type2>::type productType; \
683 tmp<FieldField<Field, productType> > tRes \
685 reuseTmpFieldField<Field, productType, Type2>::New(tf2) \
687 opFunc(tRes(), f1, tf2()); \
688 reuseTmpFieldField<Field, productType, Type2>::clear(tf2); \
694 template<class> class Field1, \
695 template<class> class Field2, \
699 tmp<FieldField<Field, typename product<Type1, Type2>::type> > \
702 const FieldField<Field1, Type1>& f1, \
703 const tmp<FieldField<Field2, Type2> >& tf2 \
706 typedef typename product<Type1, Type2>::type productType; \
707 tmp<FieldField<Field1, productType> > tRes \
709 FieldField<Field1, productType>::NewCalculatedType(f1) \
711 opFunc(tRes(), f1, tf2()); \
718 template<class> class Field1, \
719 template<class> class Field2, \
723 tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
726 const tmp<FieldField<Field1, Type1> >& tf1, \
727 const FieldField<Field2, Type2>& f2 \
730 typedef typename product<Type1, Type2>::type productType; \
731 tmp<FieldField<Field1, productType> > tRes \
733 reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \
735 opFunc(tRes(), tf1(), f2); \
736 reuseTmpFieldField<Field1, productType, Type1>::clear(tf1); \
742 template<class> class Field1, \
743 template<class> class Field2, \
747 tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
750 const tmp<FieldField<Field1, Type1> >& tf1, \
751 const tmp<FieldField<Field2, Type2> >& tf2 \
754 typedef typename product<Type1, Type2>::type productType; \
755 tmp<FieldField<Field1, productType> > tRes \
757 reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \
760 opFunc(tRes(), tf1(), tf2()); \
761 reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::clear \
767 <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
770 FieldField<Field, typename product<Type, Form>::type>& f, \
771 const FieldField<Field, Type>& f1, \
772 const VectorSpace<Form,Cmpt,nCmpt>& vs \
777 opFunc(f[i], f1[i], vs); \
782 <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
783 tmp<FieldField<Field, typename product<Type, Form>::type> > \
786 const FieldField<Field, Type>& f1, \
787 const VectorSpace<Form,Cmpt,nCmpt>& vs \
790 typedef typename product<Type, Form>::type productType; \
791 tmp<FieldField<Field, productType> > tRes \
793 FieldField<Field, productType>::NewCalculatedType(f1) \
795 opFunc(tRes(), f1, static_cast<const Form&>(vs)); \
800 <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
801 tmp<FieldField<Field, typename product<Type, Form>::type> > \
804 const tmp<FieldField<Field, Type> >& tf1, \
805 const VectorSpace<Form,Cmpt,nCmpt>& vs \
808 typedef typename product<Type, Form>::type productType; \
809 tmp<FieldField<Field, productType> > tRes \
811 reuseTmpFieldField<Field, productType, Type>::New(tf1) \
813 opFunc(tRes(), tf1(), static_cast<const Form&>(vs)); \
814 reuseTmpFieldField<Field, productType, Type>::clear(tf1); \
819 <template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
822 FieldField<Field, typename product<Form, Type>::type>& f, \
823 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
824 const FieldField<Field, Type>& f1 \
829 opFunc(f[i], vs, f1[i]); \
834 <template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
835 tmp<FieldField<Field, typename product<Form, Type>::type> > \
838 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
839 const FieldField<Field, Type>& f1 \
842 typedef typename product<Form, Type>::type productType; \
843 tmp<FieldField<Field, productType> > tRes \
845 FieldField<Field, productType>::NewCalculatedType(f1) \
847 opFunc(tRes(), static_cast<const Form&>(vs), f1); \
852 <template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
853 tmp<FieldField<Field, typename product<Form, Type>::type> > \
856 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
857 const tmp<FieldField<Field, Type> >& tf1 \
860 typedef typename product<Form, Type>::type productType; \
861 tmp<FieldField<Field, productType> > tRes \
863 reuseTmpFieldField<Field, productType, Type>::New(tf1) \
865 opFunc(tRes(), static_cast<const Form&>(vs), tf1()); \
866 reuseTmpFieldField<Field, productType, Type>::clear(tf1); \
878 #undef PRODUCT_OPERATOR
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
Type gAverage(const FieldField< Field, Type > &f)
typeOfRank< typename pTraits< arg1 >::cmptType, int(pTraits< arg1 >::rank)+int(pTraits< arg2 >::rank) >::type type
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
dimensioned< scalar > mag(const dimensioned< Type > &)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *int(pTraits< arg1 >::rank) >::type type
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define TMP_UNARY_FUNCTION(returnType, func)
Pre-declare SubField and related Field type.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static void clear(const tmp< FieldField< Field, Type1 > > &tf1)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh > &df)
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
volScalarField sf(fieldObject, mesh)
scalar gSumMag(const FieldField< Field, Type > &f)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
pTraits< Type >::cmptType cmptType
Component type.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
Traits class for primitives.
#define PRODUCT_OPERATOR(product, op, opFunc)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
void size(const label)
Override size to be inconsistent with allocated storage.
Type gMin(const FieldField< Field, Type > &f)
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Type gMax(const FieldField< Field, Type > &f)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)