26 #define TEMPLATE template<class Type>
47 void T(Field<Type>& res,
const UList<Type>&
f);
50 template<
class Type, direction r>
58 template<
class Type, direction r>
59 tmp<Field<typename powProduct<Type, r>::type>>
67 template<
class Type, direction r>
68 tmp<Field<typename powProduct<Type, r>::type>>
71 const tmp<Field<Type>>&
tf,
85 tmp<Field<typename outerProduct<Type, Type>::type>>
86 sqr(
const UList<Type>&
f);
89 tmp<Field<typename outerProduct<Type, Type>::type>>
90 sqr(
const tmp<Field<Type>>&
tf);
94 void magSqr(Field<scalar>& res,
const UList<Type>&
f);
97 tmp<Field<scalar>>
magSqr(
const UList<Type>&
f);
100 tmp<Field<scalar>>
magSqr(
const tmp<Field<Type>>&
tf);
104 void mag(Field<scalar>& res,
const UList<Type>&
f);
107 tmp<Field<scalar>>
mag(
const UList<Type>&
f);
110 tmp<Field<scalar>>
mag(
const tmp<Field<Type>>&
tf);
117 tmp<Field<typename Field<Type>::cmptType>>
cmptMax(
const UList<Type>&
f);
120 tmp<Field<typename Field<Type>::cmptType>>
128 tmp<Field<typename Field<Type>::cmptType>>
cmptMin(
const UList<Type>&
f);
131 tmp<Field<typename Field<Type>::cmptType>>
139 tmp<Field<typename Field<Type>::cmptType>>
cmptAv(
const UList<Type>&
f);
142 tmp<Field<typename Field<Type>::cmptType>>
cmptAv(
const tmp<Field<Type>>&
tf);
146 void cmptMag(Field<Type>& res,
const UList<Type>&
f);
149 tmp<Field<Type>>
cmptMag(
const UList<Type>&
f);
152 tmp<Field<Type>>
cmptMag(
const tmp<Field<Type>>&
tf);
154 #define TMP_UNARY_FUNCTION(ReturnType, Func) \
156 template<class Type> \
157 ReturnType Func(const tmp<Field<Type>>& tf1);
160 Type
max(
const UList<Type>&
f);
165 Type
min(
const UList<Type>&
f);
170 Type
sum(
const UList<Type>&
f);
186 scalar
sumProd(
const UList<Type>& f1,
const UList<Type>& f2);
189 Type
sumCmptProd(
const UList<Type>& f1,
const UList<Type>& f2);
192 scalar
sumSqr(
const UList<Type>&
f);
197 scalar
sumMag(
const UList<Type>&
f);
212 #define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \
214 template<class Type> \
215 ReturnType gFunc(const UList<Type>& f, const label comm = UPstream::worldComm);\
216 TMP_UNARY_FUNCTION(ReturnType, gFunc)
227 #undef G_UNARY_FUNCTION
232 const UList<Type>& f1,
233 const UList<Type>& f2,
240 const UList<Type>& f1,
241 const UList<Type>& f2,
248 const UList<Type>&
f,
254 #undef TMP_UNARY_FUNCTION
284 #define PRODUCT_OPERATOR(product, Op, OpFunc) \
286 template<class Type1, class Type2> \
289 Field<typename product<Type1, Type2>::type>& res, \
290 const UList<Type1>& f1, \
291 const UList<Type2>& f2 \
294 template<class Type1, class Type2> \
295 tmp<Field<typename product<Type1, Type2>::type>> \
296 operator Op(const UList<Type1>& f1, const UList<Type2>& f2); \
298 template<class Type1, class Type2> \
299 tmp<Field<typename product<Type1, Type2>::type>> \
300 operator Op(const UList<Type1>& f1, const tmp<Field<Type2>>& tf2); \
302 template<class Type1, class Type2> \
303 tmp<Field<typename product<Type1, Type2>::type>> \
304 operator Op(const tmp<Field<Type1>>& tf1, const UList<Type2>& f2); \
306 template<class Type1, class Type2> \
307 tmp<Field<typename product<Type1, Type2>::type>> \
308 operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2); \
310 template<class Type, class Form, class Cmpt, direction nCmpt> \
313 Field<typename product<Type, Form>::type>& res, \
314 const UList<Type>& f1, \
315 const VectorSpace<Form,Cmpt,nCmpt>& vs \
318 template<class Type, class Form, class Cmpt, direction nCmpt> \
319 tmp<Field<typename product<Type, Form>::type>> \
320 operator Op(const UList<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs); \
322 template<class Type, class Form, class Cmpt, direction nCmpt> \
323 tmp<Field<typename product<Type, Form>::type>> \
324 operator Op(const tmp<Field<Type>>&tf1,const VectorSpace<Form,Cmpt,nCmpt>&vs); \
326 template<class Form, class Cmpt, direction nCmpt, class Type> \
329 Field<typename product<Form, Type>::type>& res, \
330 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
331 const UList<Type>& f1 \
334 template<class Form, class Cmpt, direction nCmpt, class Type> \
335 tmp<Field<typename product<Form, Type>::type>> \
336 operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const UList<Type>& f1); \
338 template<class Form, class Cmpt, direction nCmpt, class Type> \
339 tmp<Field<typename product<Form, Type>::type>> \
340 operator Op(const VectorSpace<Form,Cmpt,nCmpt>&vs,const tmp<Field<Type>>&tf1);
350 #undef PRODUCT_OPERATOR
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc)
#define PRODUCT_OPERATOR(product, Op, OpFunc)
#define TMP_UNARY_FUNCTION(ReturnType, Func)
#define BINARY_TYPE_OPERATOR_FS(TYPE, op, opFunc)
#define BINARY_FUNCTION(func)
#define BINARY_OPERATOR(Template, Type, Type1, Type2, op, opFunc)
#define UNARY_OPERATOR(op, opFunc)
#define BINARY_TYPE_OPERATOR_SF(TYPE, op, opFunc)
pTraits< Type >::cmptType cmptType
Component type.
static label worldComm
Default communicator (all processors)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
void subtract(LagrangianPatchField< typename typeOfSum< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void dot(LagrangianPatchField< typename innerProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void negate(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
void cmptMultiply(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< Type > &f2)
Type gSum(const FieldField< Field, Type > &f)
void outer(LagrangianPatchField< typename outerProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void divide(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< scalar > &f2)
void dotdot(LagrangianPatchField< typename scalarProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &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.
scalar gSumMag(const FieldField< Field, Type > &f)
void cmptDivide(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< Type > &f2)
scalar gSumSqr(const UList< Type > &f, const label comm)
scalar gSumProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
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)
void cross(LagrangianPatchField< typename crossProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Type gMaxMagSqr(const UList< Type > &f, const label comm)
void component(LagrangianPatchField< typename LagrangianPatchField< Type >::cmptType > &sf, const LagrangianPatchField< Type > &f, const direction d)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
void multiply(LagrangianPatchField< Type > &f, const LagrangianPatchField< scalar > &f1, const LagrangianPatchField< Type > &f2)
scalar sumProd(const UList< Type > &f1, const UList< Type > &f2)
void cmptAv(LagrangianPatchField< typename LagrangianPatchField< Type >::cmptType > &f, const LagrangianPatchField< Type > &f1)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Type gAverage(const FieldField< Field, Type > &f)
Type minMagSqr(const UList< Type > &f)
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
Type gMin(const FieldField< Field, Type > &f)
scalar sumSqr(const UList< Type > &f)
void add(LagrangianPatchField< typename typeOfSum< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
Type gMinMagSqr(const UList< Type > &f, const label comm)
Type gSumCmptMag(const UList< Type > &f, const label comm)
Type gMax(const FieldField< Field, Type > &f)
void cmptMag(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
Type sumCmptMag(const UList< Type > &f)
Type gSumCmptProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)