36 #define G_REDUCTION_FUNCTION(ReturnType, gFunc, Func, rFunc) \
38 template<class Type> \
41 const UList<Type>& f, \
45 ReturnType res = Func(f); \
46 reduce(res, rFunc##Op<Type>(), Pstream::msgType(), comm); \
50 #define TMP_REDUCTION_FUNCTION(ReturnType, Func) \
52 template<class Type> \
53 ReturnType Func(const tmp<Field<Type>>& tf1) \
55 ReturnType res = Func(tf1()); \
180 if (f1.size() && (f1.size() == f2.size()))
200 scalar SumProd =
sumProd(f1, f2);
312 <<
"empty field, returning zero" <<
endl;
338 <<
"empty field, returning zero." <<
endl;
349 #undef G_REDUCTION_FUNCTION
350 #undef TMP_REDUCTION_FUNCTION
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
#define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2)
#define TFOR_ALL_S_OP_F(typeS, s, OP, typeF, f)
#define TFOR_ALL_S_OP_FUNC_F(typeS, s, OP, FUNC, typeF, f)
#define TFOR_ALL_S_OP_FUNC_F_S(typeS1, s1, OP, FUNC, typeF, f, typeS2, s2)
#define TFOR_ALL_S_OP_FUNC_F_F(typeS, s, OP, FUNC, typeF1, f1, typeF2, f2)
#define TMP_REDUCTION_FUNCTION(ReturnType, Func)
#define G_REDUCTION_FUNCTION(ReturnType, gFunc, Func, rFunc)
Inter-processor communication reduction functions.
void size(const label)
Override size to be inconsistent with allocated storage.
label size() const
Return the number of elements in the UList.
static int & msgType()
Message tag of standard messages.
Traits class for primitives.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define WarningInFunction
Report a warning using Foam::Warning.
Type gMin(const UList< Type > &f, const label comm)
Type gAverage(const UList< Type > &f, 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.
scalar gSumSqr(const UList< Type > &f, const label comm)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMultiply(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
scalar gSumProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Type sumCmptProd(const UList< Type > &f1, const UList< Type > &f2)
Type maxMagSqr(const UList< Type > &f)
Type gSum(const UList< Type > &f, const label comm)
Type gMaxMagSqr(const UList< Type > &f, const label comm)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
scalar gSumMag(const UList< Type > &f, const label comm)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
scalar sumProd(const UList< Type > &f1, const UList< Type > &f2)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Type gMax(const UList< Type > &f, const label comm)
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Type minMagSqr(const UList< Type > &f)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
scalar sumSqr(const UList< Type > &f)
Type gMinMagSqr(const UList< Type > &f, const label comm)
Type gSumCmptMag(const UList< Type > &f, const label comm)
Type sumCmptMag(const UList< Type > &f)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void sumReduce(T &Value, label &Count, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Type gSumCmptProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)