Go to the documentation of this file.
31 #define TEMPLATE template<template<class> class Field, class Type>
41 template<
template<
class>
class Field,
class Type>
56 template<
template<
class>
class Field,
class Type>
66 template<
template<
class>
class Field,
class Type,
direction r>
79 template<
template<
class>
class Field,
class Type,
direction r>
93 pow<Type, r>(tres.ref(),
f);
97 template<
template<
class>
class Field,
class Type,
direction r>
111 pow<Type, r>(tres.ref(), tf());
117 template<
template<
class>
class Field,
class Type>
130 template<
template<
class>
class Field,
class Type>
143 template<
template<
class>
class Field,
class Type>
154 sqr(tres.ref(), tf());
160 template<
template<
class>
class Field,
class Type>
173 template<
template<
class>
class Field,
class Type>
188 template<
template<
class>
class Field,
class Type>
205 template<
template<
class>
class Field,
class Type>
218 template<
template<
class>
class Field,
class Type>
233 template<
template<
class>
class Field,
class Type>
244 mag(tres.ref(), tf());
250 template<
template<
class>
class Field,
class Type>
263 template<
template<
class>
class Field,
class Type>
264 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMax
280 template<
template<
class>
class Field,
class Type>
281 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMax
299 template<
template<
class>
class Field,
class Type>
312 template<
template<
class>
class Field,
class Type>
313 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMin
329 template<
template<
class>
class Field,
class Type>
330 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptMin
348 template<
template<
class>
class Field,
class Type>
361 template<
template<
class>
class Field,
class Type>
362 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptAv
378 template<
template<
class>
class Field,
class Type>
379 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
cmptAv
397 template<
template<
class>
class Field,
class Type>
410 template<
template<
class>
class Field,
class Type>
411 tmp<FieldField<Field, Type>>
cmptMag
425 template<
template<
class>
class Field,
class Type>
426 tmp<FieldField<Field, Type>>
cmptMag
438 #define TMP_UNARY_FUNCTION(returnType, func) \
440 template<template<class> class Field, class Type> \
441 returnType func(const tmp<FieldField<Field, Type>>& tf1) \
443 returnType res = func(tf1()); \
448 template<
template<
class>
class Field,
class Type>
457 result =
max(
max(
f[i]), result);
468 template<
template<
class>
class Field,
class Type>
477 result =
min(
min(
f[i]), result);
487 template<
template<
class>
class Field,
class Type>
502 template<
template<
class>
class Field,
class Type>
507 magType result =
Zero;
519 template<
template<
class>
class Field,
class Type>
533 Type avrg =
sum(
f)/
n;
540 <<
"empty fieldField, returning zero" <<
endl;
548 template<
template<
class>
class Field,
class Type>
563 template<
template<
class>
class Field,
class Type>
580 #define G_UNARY_FUNCTION(ReturnType, gFunc, func, rFunc) \
582 template<template<class> class Field, class Type> \
583 ReturnType gFunc(const FieldField<Field, Type>& f) \
585 ReturnType res = func(f); \
586 reduce(res, rFunc##Op<ReturnType>()); \
589 TMP_UNARY_FUNCTION(ReturnType, gFunc)
599 #undef G_UNARY_FUNCTION
602 template<
template<
class>
class Field,
class Type>
622 <<
"empty fieldField, returning zero" <<
endl;
629 #undef TMP_UNARY_FUNCTION
661 #define PRODUCT_OPERATOR(product, op, opFunc) \
665 template<class> class Field1, \
666 template<class> class Field2, \
672 FieldField<Field1, typename product<Type1, Type2>::type>& f, \
673 const FieldField<Field1, Type1>& f1, \
674 const FieldField<Field2, Type2>& f2 \
679 opFunc(f[i], f1[i], f2[i]); \
685 template<class> class Field1, \
686 template<class> class Field2, \
690 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
693 const FieldField<Field1, Type1>& f1, \
694 const FieldField<Field2, Type2>& f2 \
697 typedef typename product<Type1, Type2>::type productType; \
698 tmp<FieldField<Field1, productType>> tres \
700 FieldField<Field1, productType>::NewCalculatedType(f1) \
702 opFunc(tres.ref(), f1, f2); \
706 template<template<class> class Field, class Type1, class Type2> \
707 tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
710 const FieldField<Field, Type1>& f1, \
711 const tmp<FieldField<Field, Type2>>& tf2 \
714 typedef typename product<Type1, Type2>::type productType; \
715 tmp<FieldField<Field, productType>> tres \
717 reuseTmpFieldField<Field, productType, Type2>::New(tf2) \
719 opFunc(tres.ref(), f1, tf2()); \
726 template<class> class Field1, \
727 template<class> class Field2, \
731 tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
734 const FieldField<Field1, Type1>& f1, \
735 const tmp<FieldField<Field2, Type2>>& tf2 \
738 typedef typename product<Type1, Type2>::type productType; \
739 tmp<FieldField<Field1, productType>> tres \
741 FieldField<Field1, productType>::NewCalculatedType(f1) \
743 opFunc(tres.ref(), f1, tf2()); \
750 template<class> class Field1, \
751 template<class> class Field2, \
755 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
758 const tmp<FieldField<Field1, Type1>>& tf1, \
759 const FieldField<Field2, Type2>& f2 \
762 typedef typename product<Type1, Type2>::type productType; \
763 tmp<FieldField<Field1, productType>> tres \
765 reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \
767 opFunc(tres.ref(), tf1(), f2); \
774 template<class> class Field1, \
775 template<class> class Field2, \
779 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
782 const tmp<FieldField<Field1, Type1>>& tf1, \
783 const tmp<FieldField<Field2, Type2>>& tf2 \
786 typedef typename product<Type1, Type2>::type productType; \
787 tmp<FieldField<Field1, productType>> tres \
789 reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \
792 opFunc(tres.ref(), tf1(), tf2()); \
800 template<class> class Field, \
808 FieldField<Field, typename product<Type, Form>::type>& f, \
809 const FieldField<Field, Type>& f1, \
810 const VectorSpace<Form,Cmpt,nCmpt>& vs \
815 opFunc(f[i], f1[i], vs); \
821 template<class> class Field, \
827 tmp<FieldField<Field, typename product<Type, Form>::type>> \
830 const FieldField<Field, Type>& f1, \
831 const VectorSpace<Form,Cmpt,nCmpt>& vs \
834 typedef typename product<Type, Form>::type productType; \
835 tmp<FieldField<Field, productType>> tres \
837 FieldField<Field, productType>::NewCalculatedType(f1) \
839 opFunc(tres.ref(), f1, static_cast<const Form&>(vs)); \
845 template<class> class Field, \
851 tmp<FieldField<Field, typename product<Type, Form>::type>> \
854 const tmp<FieldField<Field, Type>>& tf1, \
855 const VectorSpace<Form,Cmpt,nCmpt>& vs \
858 typedef typename product<Type, Form>::type productType; \
859 tmp<FieldField<Field, productType>> tres \
861 reuseTmpFieldField<Field, productType, Type>::New(tf1) \
863 opFunc(tres.ref(), tf1(), static_cast<const Form&>(vs)); \
870 template<class> class Field, \
878 FieldField<Field, typename product<Form, Type>::type>& f, \
879 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
880 const FieldField<Field, Type>& f1 \
885 opFunc(f[i], vs, f1[i]); \
891 template<class> class Field, \
897 tmp<FieldField<Field, typename product<Form, Type>::type>> \
900 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
901 const FieldField<Field, Type>& f1 \
904 typedef typename product<Form, Type>::type productType; \
905 tmp<FieldField<Field, productType>> tres \
907 FieldField<Field, productType>::NewCalculatedType(f1) \
909 opFunc(tres.ref(), static_cast<const Form&>(vs), f1); \
915 template<class> class Field, \
921 tmp<FieldField<Field, typename product<Form, Type>::type>> \
924 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
925 const tmp<FieldField<Field, Type>>& tf1 \
928 typedef typename product<Form, Type>::type productType; \
929 tmp<FieldField<Field, productType>> tres \
931 reuseTmpFieldField<Field, productType, Type>::New(tf1) \
933 opFunc(tres.ref(), static_cast<const Form&>(vs), tf1()); \
946 #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
Type gAverage(const FieldField< Field, Type > &f)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
dimensioned< MinMax< Type > > minMax(const DimensionedField< Type, GeoMesh > &df)
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)
#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)
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)
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)
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 > 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)
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)
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)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#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)