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>
89 pow<Type, r>(tRes.
ref(),
f);
105 pow<Type, r>(tRes.
ref(),
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>
250 template<
template<
class>
class Field,
class Type>
267 template<
template<
class>
class Field,
class Type>
280 template<
template<
class>
class Field,
class Type>
295 template<
template<
class>
class Field,
class Type>
312 template<
template<
class>
class Field,
class Type>
325 template<
template<
class>
class Field,
class Type>
340 template<
template<
class>
class Field,
class Type>
357 template<
template<
class>
class Field,
class Type>
370 template<
template<
class>
class Field,
class Type>
384 template<
template<
class>
class Field,
class Type>
397 #define TMP_UNARY_FUNCTION(returnType, func) \ 399 template<template<class> class Field, class Type> \ 400 returnType func(const tmp<FieldField<Field, Type>>& tf1) \ 402 returnType res = func(tf1()); \ 407 template<
template<
class>
class Field,
class Type>
411 while (i < f.
size() && !f[i].
size()) i++;
421 Max =
max(
max(f[j]), Max);
435 template<
template<
class>
class Field,
class Type>
439 while (i < f.
size() && !f[i].
size()) i++;
444 while (!f[i].size()) i++;
452 Min =
min(
min(f[j]), Min);
466 template<
template<
class>
class Field,
class Type>
488 template<
template<
class>
class Field,
class Type>
510 template<
template<
class>
class Field,
class Type>
525 <<
"empty fieldField, returning zero" <<
endl;
530 Type avrg =
sum(f)/
n;
537 <<
"empty fieldField, returning zero" <<
endl;
546 #define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc) \ 548 template<template<class> class Field, class Type> \ 549 returnType gFunc(const FieldField<Field, Type>& f) \ 551 returnType res = func(f); \ 552 reduce(res, rFunc##Op<Type>()); \ 555 TMP_UNARY_FUNCTION(returnType, gFunc) 562 #undef G_UNARY_FUNCTION 565 template<
template<
class>
class Field,
class Type>
579 Type avrg =
gSum(f)/
n;
586 <<
"empty fieldField, returning zero" <<
endl;
594 #undef TMP_UNARY_FUNCTION 624 #define PRODUCT_OPERATOR(product, op, opFunc) \ 628 template<class> class Field1, \ 629 template<class> class Field2, \ 635 FieldField<Field1, typename product<Type1, Type2>::type>& f, \ 636 const FieldField<Field1, Type1>& f1, \ 637 const FieldField<Field2, Type2>& f2 \ 642 opFunc(f[i], f1[i], f2[i]); \ 648 template<class> class Field1, \ 649 template<class> class Field2, \ 653 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \ 656 const FieldField<Field1, Type1>& f1, \ 657 const FieldField<Field2, Type2>& f2 \ 660 typedef typename product<Type1, Type2>::type productType; \ 661 tmp<FieldField<Field1, productType>> tRes \ 663 FieldField<Field1, productType>::NewCalculatedType(f1) \ 665 opFunc(tRes.ref(), f1, f2); \ 669 template<template<class> class Field, class Type1, class Type2> \ 670 tmp<FieldField<Field, typename product<Type1, Type2>::type>> \ 673 const FieldField<Field, Type1>& f1, \ 674 const tmp<FieldField<Field, Type2>>& tf2 \ 677 typedef typename product<Type1, Type2>::type productType; \ 678 tmp<FieldField<Field, productType>> tRes \ 680 reuseTmpFieldField<Field, productType, Type2>::New(tf2) \ 682 opFunc(tRes.ref(), f1, tf2()); \ 689 template<class> class Field1, \ 690 template<class> class Field2, \ 694 tmp<FieldField<Field, typename product<Type1, Type2>::type>> \ 697 const FieldField<Field1, Type1>& f1, \ 698 const tmp<FieldField<Field2, Type2>>& tf2 \ 701 typedef typename product<Type1, Type2>::type productType; \ 702 tmp<FieldField<Field1, productType>> tRes \ 704 FieldField<Field1, productType>::NewCalculatedType(f1) \ 706 opFunc(tRes.ref(), f1, tf2()); \ 713 template<class> class Field1, \ 714 template<class> class Field2, \ 718 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \ 721 const tmp<FieldField<Field1, Type1>>& tf1, \ 722 const FieldField<Field2, Type2>& f2 \ 725 typedef typename product<Type1, Type2>::type productType; \ 726 tmp<FieldField<Field1, productType>> tRes \ 728 reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \ 730 opFunc(tRes.ref(), tf1(), f2); \ 737 template<class> class Field1, \ 738 template<class> class Field2, \ 742 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \ 745 const tmp<FieldField<Field1, Type1>>& tf1, \ 746 const tmp<FieldField<Field2, Type2>>& tf2 \ 749 typedef typename product<Type1, Type2>::type productType; \ 750 tmp<FieldField<Field1, productType>> tRes \ 752 reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \ 755 opFunc(tRes.ref(), tf1(), tf2()); \ 763 template<class> class Field, \ 771 FieldField<Field, typename product<Type, Form>::type>& f, \ 772 const FieldField<Field, Type>& f1, \ 773 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 778 opFunc(f[i], f1[i], vs); \ 784 template<class> class Field, \ 790 tmp<FieldField<Field, typename product<Type, Form>::type>> \ 793 const FieldField<Field, Type>& f1, \ 794 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 797 typedef typename product<Type, Form>::type productType; \ 798 tmp<FieldField<Field, productType>> tRes \ 800 FieldField<Field, productType>::NewCalculatedType(f1) \ 802 opFunc(tRes.ref(), f1, static_cast<const Form&>(vs)); \ 808 template<class> class Field, \ 814 tmp<FieldField<Field, typename product<Type, Form>::type>> \ 817 const tmp<FieldField<Field, Type>>& tf1, \ 818 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 821 typedef typename product<Type, Form>::type productType; \ 822 tmp<FieldField<Field, productType>> tRes \ 824 reuseTmpFieldField<Field, productType, Type>::New(tf1) \ 826 opFunc(tRes.ref(), tf1(), static_cast<const Form&>(vs)); \ 833 template<class> class Field, \ 841 FieldField<Field, typename product<Form, Type>::type>& f, \ 842 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 843 const FieldField<Field, Type>& f1 \ 848 opFunc(f[i], vs, f1[i]); \ 854 template<class> class Field, \ 860 tmp<FieldField<Field, typename product<Form, Type>::type>> \ 863 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 864 const FieldField<Field, Type>& f1 \ 867 typedef typename product<Form, Type>::type productType; \ 868 tmp<FieldField<Field, productType>> tRes \ 870 FieldField<Field, productType>::NewCalculatedType(f1) \ 872 opFunc(tRes.ref(), static_cast<const Form&>(vs), f1); \ 878 template<class> class Field, \ 884 tmp<FieldField<Field, typename product<Form, Type>::type>> \ 887 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 888 const tmp<FieldField<Field, Type>>& tf1 \ 891 typedef typename product<Form, Type>::type productType; \ 892 tmp<FieldField<Field, productType>> tRes \ 894 reuseTmpFieldField<Field, productType, Type>::New(tf1) \ 896 opFunc(tRes.ref(), static_cast<const Form&>(vs), tf1()); \ 909 #undef PRODUCT_OPERATOR void divide(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)
#define forAll(list, i)
Loop across all elements in list.
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Inter-processor communication reduction functions.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Traits class for primitives.
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
Type gSum(const FieldField< Field, Type > &f)
Pre-declare SubField and related Field type.
void clear()
Clear the list, i.e. set size to zero.
#define TMP_UNARY_FUNCTION(returnType, func)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Type gMax(const FieldField< Field, Type > &f)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
volScalarField sf(fieldObject, mesh)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
label size() const
Return the number of elements in the UPtrList.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
#define PRODUCT_OPERATOR(product, op, opFunc)
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
pTraits< Type >::cmptType cmptType
Component type.
#define WarningInFunction
Report a warning using Foam::Warning.
Type gAverage(const FieldField< Field, Type > &f)
dimensioned< scalar > mag(const dimensioned< Type > &)
#define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
A class for managing temporary objects.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh > &df)