Go to the documentation of this file.
32 #define TEMPLATE template<template<class> class Field, class Type>
42 template<
template<
class>
class Field,
class Type>
57 template<
template<
class>
class Field,
class Type>
67 template<
template<
class>
class Field,
class Type,
direction r>
80 template<
template<
class>
class Field,
class Type,
direction r>
94 pow<Type, r>(tres.ref(),
f);
98 template<
template<
class>
class Field,
class Type,
direction r>
112 pow<Type, r>(tres.ref(), tf());
118 template<
template<
class>
class Field,
class Type>
131 template<
template<
class>
class Field,
class Type>
144 template<
template<
class>
class Field,
class Type>
155 sqr(tres.ref(), tf());
161 template<
template<
class>
class Field,
class Type>
174 template<
template<
class>
class Field,
class Type>
189 template<
template<
class>
class Field,
class Type>
206 template<
template<
class>
class Field,
class Type>
219 template<
template<
class>
class Field,
class Type>
234 template<
template<
class>
class Field,
class Type>
245 mag(tres.ref(), tf());
251 template<
template<
class>
class Field,
class Type>
264 template<
template<
class>
class Field,
class Type>
265 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMax
281 template<
template<
class>
class Field,
class Type>
282 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMax
300 template<
template<
class>
class Field,
class Type>
313 template<
template<
class>
class Field,
class Type>
314 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMin
330 template<
template<
class>
class Field,
class Type>
331 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMin
349 template<
template<
class>
class Field,
class Type>
362 template<
template<
class>
class Field,
class Type>
363 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptAv
379 template<
template<
class>
class Field,
class Type>
380 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptAv
398 template<
template<
class>
class Field,
class Type>
411 template<
template<
class>
class Field,
class Type>
412 tmp<FieldField<Field, Type>>
cmptMag
426 template<
template<
class>
class Field,
class Type>
427 tmp<FieldField<Field, Type>>
cmptMag
439 #define TMP_UNARY_FUNCTION(returnType, func) \
441 template<template<class> class Field, class Type> \
442 returnType func(const tmp<FieldField<Field, Type>>& tf1) \
444 returnType res = func(tf1()); \
449 template<
template<
class>
class Field,
class Type>
458 result =
max(
max(
f[i]), result);
469 template<
template<
class>
class Field,
class Type>
478 result =
min(
min(
f[i]), result);
488 template<
template<
class>
class Field,
class Type>
503 template<
template<
class>
class Field,
class Type>
508 magType result =
Zero;
520 template<
template<
class>
class Field,
class Type>
534 Type avrg =
sum(
f)/
n;
541 <<
"empty fieldField, returning zero" <<
endl;
549 template<
template<
class>
class Field,
class Type>
564 template<
template<
class>
class Field,
class Type>
581 #define G_UNARY_FUNCTION(ReturnType, gFunc, func, rFunc) \
583 template<template<class> class Field, class Type> \
584 ReturnType gFunc(const FieldField<Field, Type>& f) \
586 ReturnType res = func(f); \
587 reduce(res, rFunc##Op<ReturnType>()); \
590 TMP_UNARY_FUNCTION(ReturnType, gFunc)
600 #undef G_UNARY_FUNCTION
603 template<
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, \
691 tmp<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); \
707 template<template<class> class Field, class Type1, class Type2> \
708 tmp<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, \
732 tmp<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, \
756 tmp<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, \
780 tmp<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, \
828 tmp<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, \
852 tmp<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, \
898 tmp<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, \
922 tmp<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_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)
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A field of fields is a PtrList of fields with reference counting.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
Type gAverage(const FieldField< Field, Type > &f)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(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)
#define G_UNARY_FUNCTION(ReturnType, gFunc, func, rFunc)
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
scalarMinMax gMinMaxMag(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
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)
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
#define TMP_UNARY_FUNCTION(returnType, func)
Generic templated field type.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
The magnitude type for given argument.
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &df)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
Inter-processor communication reduction functions.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
pTraits< Type >::cmptType cmptType
Component type.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionSet clip(const dimensionSet &ds1, const dimensionSet &ds2)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
Traits class for primitives.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
#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)
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
Type gMin(const FieldField< Field, Type > &f)
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
#define WarningInFunction
Report a warning using Foam::Warning.
pTraits< typename pTraits< arg1 >::cmptType >::magType type
A min/max value pair with additional methods. In addition to conveniently storing values,...
Type gMax(const FieldField< Field, Type > &f)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
MinMax< Type > gMinMax(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)