32#define TEMPLATE template<template<class> class Field, class Type>
42template<
template<
class>
class Field,
class Type>
57template<
template<
class>
class Field,
class Type>
67template<
template<
class>
class Field,
class Type,
direction r>
80template<
template<
class>
class Field,
class Type,
direction r>
81tmp<FieldField<Field, typename powProduct<Type, r>::type>>
94 pow<Type, r>(tres.ref(),
f);
98template<
template<
class>
class Field,
class Type,
direction r>
99tmp<FieldField<Field, typename powProduct<Type, r>::type>>
112 pow<Type, r>(tres.ref(), tf());
118template<
template<
class>
class Field,
class Type>
131template<
template<
class>
class Field,
class Type>
132tmp<FieldField<Field, typename outerProduct<Type, Type>::type>>
144template<
template<
class>
class Field,
class Type>
145tmp<FieldField<Field, typename outerProduct<Type, Type>::type>>
155 sqr(tres.ref(), tf());
161template<
template<
class>
class Field,
class Type>
174template<
template<
class>
class Field,
class Type>
175tmp<FieldField<Field, typename typeOfMag<Type>::type>>
189template<
template<
class>
class Field,
class Type>
190tmp<FieldField<Field, typename typeOfMag<Type>::type>>
206template<
template<
class>
class Field,
class Type>
219template<
template<
class>
class Field,
class Type>
220tmp<FieldField<Field, typename typeOfMag<Type>::type>>
234template<
template<
class>
class Field,
class Type>
235tmp<FieldField<Field, typename typeOfMag<Type>::type>>
245 mag(tres.ref(), tf());
251template<
template<
class>
class Field,
class Type>
264template<
template<
class>
class Field,
class Type>
281template<
template<
class>
class Field,
class Type>
300template<
template<
class>
class Field,
class Type>
313template<
template<
class>
class Field,
class Type>
330template<
template<
class>
class Field,
class Type>
349template<
template<
class>
class Field,
class Type>
362template<
template<
class>
class Field,
class Type>
379template<
template<
class>
class Field,
class Type>
398template<
template<
class>
class Field,
class Type>
411template<
template<
class>
class Field,
class Type>
426template<
template<
class>
class Field,
class Type>
439#define TMP_UNARY_FUNCTION(returnType, func) \
441template<template<class> class Field, class Type> \
442returnType func(const tmp<FieldField<Field, Type>>& tf1) \
444 returnType res = func(tf1()); \
449template<
template<
class>
class Field,
class Type>
458 result =
max(
max(
f[i]), result);
469template<
template<
class>
class Field,
class Type>
478 result =
min(
min(
f[i]), result);
488template<
template<
class>
class Field,
class Type>
503template<
template<
class>
class Field,
class Type>
508 magType result =
Zero;
520template<
template<
class>
class Field,
class Type>
534 Type avrg =
sum(
f)/
n;
541 <<
"empty fieldField, returning zero" <<
endl;
549template<
template<
class>
class Field,
class Type>
564template<
template<
class>
class Field,
class Type>
581#define G_UNARY_FUNCTION(ReturnType, gFunc, func, rFunc) \
583template<template<class> class Field, class Type> \
584ReturnType gFunc(const FieldField<Field, Type>& f) \
586 ReturnType res = func(f); \
587 reduce(res, rFunc##Op<ReturnType>()); \
590TMP_UNARY_FUNCTION(ReturnType, gFunc)
600#undef G_UNARY_FUNCTION
603template<
template<
class>
class Field,
class Type>
623 <<
"empty fieldField, returning zero" <<
endl;
630#undef TMP_UNARY_FUNCTION
662#define PRODUCT_OPERATOR(product, op, opFunc) \
666 template<class> class Field1, \
667 template<class> class Field2, \
673 FieldField<Field1, typename product<Type1, Type2>::type>& f, \
674 const FieldField<Field1, Type1>& f1, \
675 const FieldField<Field2, Type2>& f2 \
680 opFunc(f[i], f1[i], f2[i]); \
686 template<class> class Field1, \
687 template<class> class Field2, \
691tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
694 const FieldField<Field1, Type1>& f1, \
695 const FieldField<Field2, Type2>& f2 \
698 typedef typename product<Type1, Type2>::type productType; \
699 tmp<FieldField<Field1, productType>> tres \
701 FieldField<Field1, productType>::NewCalculatedType(f1) \
703 opFunc(tres.ref(), f1, f2); \
707template<template<class> class Field, class Type1, class Type2> \
708tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
711 const FieldField<Field, Type1>& f1, \
712 const tmp<FieldField<Field, Type2>>& tf2 \
715 typedef typename product<Type1, Type2>::type productType; \
716 tmp<FieldField<Field, productType>> tres \
718 reuseTmpFieldField<Field, productType, Type2>::New(tf2) \
720 opFunc(tres.ref(), f1, tf2()); \
727 template<class> class Field1, \
728 template<class> class Field2, \
732tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
735 const FieldField<Field1, Type1>& f1, \
736 const tmp<FieldField<Field2, Type2>>& tf2 \
739 typedef typename product<Type1, Type2>::type productType; \
740 tmp<FieldField<Field1, productType>> tres \
742 FieldField<Field1, productType>::NewCalculatedType(f1) \
744 opFunc(tres.ref(), f1, tf2()); \
751 template<class> class Field1, \
752 template<class> class Field2, \
756tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
759 const tmp<FieldField<Field1, Type1>>& tf1, \
760 const FieldField<Field2, Type2>& f2 \
763 typedef typename product<Type1, Type2>::type productType; \
764 tmp<FieldField<Field1, productType>> tres \
766 reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \
768 opFunc(tres.ref(), tf1(), f2); \
775 template<class> class Field1, \
776 template<class> class Field2, \
780tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
783 const tmp<FieldField<Field1, Type1>>& tf1, \
784 const tmp<FieldField<Field2, Type2>>& tf2 \
787 typedef typename product<Type1, Type2>::type productType; \
788 tmp<FieldField<Field1, productType>> tres \
790 reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \
793 opFunc(tres.ref(), tf1(), tf2()); \
801 template<class> class Field, \
809 FieldField<Field, typename product<Type, Form>::type>& f, \
810 const FieldField<Field, Type>& f1, \
811 const VectorSpace<Form,Cmpt,nCmpt>& vs \
816 opFunc(f[i], f1[i], vs); \
822 template<class> class Field, \
828tmp<FieldField<Field, typename product<Type, Form>::type>> \
831 const FieldField<Field, Type>& f1, \
832 const VectorSpace<Form,Cmpt,nCmpt>& vs \
835 typedef typename product<Type, Form>::type productType; \
836 tmp<FieldField<Field, productType>> tres \
838 FieldField<Field, productType>::NewCalculatedType(f1) \
840 opFunc(tres.ref(), f1, static_cast<const Form&>(vs)); \
846 template<class> class Field, \
852tmp<FieldField<Field, typename product<Type, Form>::type>> \
855 const tmp<FieldField<Field, Type>>& tf1, \
856 const VectorSpace<Form,Cmpt,nCmpt>& vs \
859 typedef typename product<Type, Form>::type productType; \
860 tmp<FieldField<Field, productType>> tres \
862 reuseTmpFieldField<Field, productType, Type>::New(tf1) \
864 opFunc(tres.ref(), tf1(), static_cast<const Form&>(vs)); \
871 template<class> class Field, \
879 FieldField<Field, typename product<Form, Type>::type>& f, \
880 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
881 const FieldField<Field, Type>& f1 \
886 opFunc(f[i], vs, f1[i]); \
892 template<class> class Field, \
898tmp<FieldField<Field, typename product<Form, Type>::type>> \
901 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
902 const FieldField<Field, Type>& f1 \
905 typedef typename product<Form, Type>::type productType; \
906 tmp<FieldField<Field, productType>> tres \
908 FieldField<Field, productType>::NewCalculatedType(f1) \
910 opFunc(tres.ref(), static_cast<const Form&>(vs), f1); \
916 template<class> class Field, \
922tmp<FieldField<Field, typename product<Form, Type>::type>> \
925 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
926 const tmp<FieldField<Field, Type>>& tf1 \
929 typedef typename product<Form, Type>::type productType; \
930 tmp<FieldField<Field, productType>> tres \
932 reuseTmpFieldField<Field, productType, Type>::New(tf1) \
934 opFunc(tres.ref(), static_cast<const Form&>(vs), tf1()); \
947#undef PRODUCT_OPERATOR
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
#define BINARY_TYPE_FUNCTION_FS(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 G_UNARY_FUNCTION(ReturnType, gFunc, func, rFunc)
#define TMP_UNARY_FUNCTION(returnType, func)
Inter-processor communication reduction functions.
A field of fields is a PtrList of fields with reference counting.
pTraits< Type >::cmptType cmptType
Component type.
Generic templated field type.
A min/max value pair with additional methods. In addition to conveniently storing values,...
void size(const label n)
Older name for setAddressableSize.
A traits class, which is primarily used for primitives.
A class for managing temporary objects.
The magnitude type for given argument.
pTraits< typenamepTraits< arg1 >::cmptType >::magType type
type
Volume classification types.
#define PRODUCT_OPERATOR(product, op, opFunc)
#define WarningInFunction
Report a warning using Foam::Warning.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionSet clip(const dimensionSet &ds1, const dimensionSet &ds2)
Type gSum(const FieldField< Field, Type > &f)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
scalarMinMax gMinMaxMag(const FieldField< Field, Type > &f)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Type gAverage(const FieldField< Field, Type > &f)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Type gMin(const FieldField< Field, Type > &f)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh > > cmptAv(const DimensionedField< Type, GeoMesh > &df)
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &df)
Type gMax(const FieldField< Field, Type > &f)
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
#define forAll(list, i)
Loop across all elements in list.