29 #define TEMPLATE template<class Type> 51 void T(Field<Type>& res,
const UList<Type>&
f);
54 template<
class Type, direction r>
62 template<
class Type, direction r>
71 template<
class Type, direction r>
75 const tmp<Field<Type>>& tf,
90 sqr(
const UList<Type>&
f);
94 sqr(
const tmp<Field<Type>>& tf);
110 magSqr(
const tmp<Field<Type>>& tf);
122 mag(
const UList<Type>&
f);
126 mag(
const tmp<Field<Type>>& tf);
133 tmp<Field<typename Field<Type>::cmptType>>
cmptMax(
const UList<Type>&
f);
136 tmp<Field<typename Field<Type>::cmptType>>
137 cmptMax(
const tmp<Field<Type>>& tf);
144 tmp<Field<typename Field<Type>::cmptType>>
cmptMin(
const UList<Type>&
f);
147 tmp<Field<typename Field<Type>::cmptType>>
148 cmptMin(
const tmp<Field<Type>>& tf);
155 tmp<Field<typename Field<Type>::cmptType>>
cmptAv(
const UList<Type>&
f);
158 tmp<Field<typename Field<Type>::cmptType>>
cmptAv(
const tmp<Field<Type>>& tf);
162 void cmptMag(Field<Type>& res,
const UList<Type>&
f);
165 tmp<Field<Type>>
cmptMag(
const UList<Type>&
f);
168 tmp<Field<Type>>
cmptMag(
const tmp<Field<Type>>& tf);
172 void cmptMagSqr(Field<Type>& res,
const UList<Type>&
f);
178 tmp<Field<Type>>
cmptMagSqr(
const tmp<Field<Type>>& tf);
181 #define TMP_UNARY_FUNCTION(ReturnType, Func) \ 184 template<class Type> \ 185 ReturnType Func(const tmp<Field<Type>>& tf1); 188 Type
max(
const UList<Type>&
f);
193 Type
min(
const UList<Type>&
f);
198 Type
sum(
const UList<Type>&
f);
226 const UList<Type>& f1,
227 const UList<Type>& f2
231 Type
sumCmptProd(
const UList<Type>& f1,
const UList<Type>& f2);
256 #define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \ 258 template<class Type> \ 259 ReturnType gFunc(const UList<Type>& f, const label comm = UPstream::worldComm);\ 260 TMP_UNARY_FUNCTION(ReturnType, gFunc) 275 #undef G_UNARY_FUNCTION 281 const UList<Type>& f1,
282 const UList<Type>& f2,
289 const UList<Type>& f1,
290 const UList<Type>& f2,
297 const UList<Type>&
f,
303 #undef TMP_UNARY_FUNCTION 342 #define PRODUCT_OPERATOR(product, Op, OpFunc) \ 344 template<class Type1, class Type2> \ 347 Field<typename product<Type1, Type2>::type>& res, \ 348 const UList<Type1>& f1, \ 349 const UList<Type2>& f2 \ 352 template<class Type1, class Type2> \ 353 tmp<Field<typename product<Type1, Type2>::type>> \ 354 operator Op(const UList<Type1>& f1, const UList<Type2>& f2); \ 356 template<class Type1, class Type2> \ 357 tmp<Field<typename product<Type1, Type2>::type>> \ 358 operator Op(const UList<Type1>& f1, const tmp<Field<Type2>>& tf2); \ 360 template<class Type1, class Type2> \ 361 tmp<Field<typename product<Type1, Type2>::type>> \ 362 operator Op(const tmp<Field<Type1>>& tf1, const UList<Type2>& f2); \ 364 template<class Type1, class Type2> \ 365 tmp<Field<typename product<Type1, Type2>::type>> \ 366 operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2); \ 368 template<class Type, class Form, class Cmpt, direction nCmpt> \ 371 Field<typename product<Type, Form>::type>& res, \ 372 const UList<Type>& f1, \ 373 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 376 template<class Type, class Form, class Cmpt, direction nCmpt> \ 377 tmp<Field<typename product<Type, Form>::type>> \ 378 operator Op(const UList<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs); \ 380 template<class Type, class Form, class Cmpt, direction nCmpt> \ 381 tmp<Field<typename product<Type, Form>::type>> \ 382 operator Op(const tmp<Field<Type>>&tf1,const VectorSpace<Form,Cmpt,nCmpt>&vs); \ 384 template<class Form, class Cmpt, direction nCmpt, class Type> \ 387 Field<typename product<Form, Type>::type>& res, \ 388 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 389 const UList<Type>& f1 \ 392 template<class Form, class Cmpt, direction nCmpt, class Type> \ 393 tmp<Field<typename product<Form, Type>::type>> \ 394 operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const UList<Type>& f1); \ 396 template<class Form, class Cmpt, direction nCmpt, class Type> \ 397 tmp<Field<typename product<Form, Type>::type>> \ 398 operator Op(const VectorSpace<Form,Cmpt,nCmpt>&vs,const tmp<Field<Type>>&tf1); 408 #undef PRODUCT_OPERATOR dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &f1)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void divide(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
MinMax< scalar > scalarMinMax
A scalar min/max range.
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Type gMin(const FieldField< Field, Type > &f)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
pTraits< Type >::cmptType cmptType
Component type.
Type minMagSqr(const UList< Type > &f1)
scalarProduct< Type, Type >::type gSumProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Type gSumCmptMag(const UList< Type > &f, const label comm)
void clip(Field< Type > &result, const UList< Type > &f1, const MinMax< Type > &s2)
#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)
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
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)
Type sumCmptProd(const UList< Type > &f1, const UList< Type > &f2)
Type maxMagSqr(const UList< Type > &f1)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc)
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 > &)
complex sumProd(const UList< complex > &f1, const UList< complex > &f2)
Sum product.
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
Type gMaxMagSqr(const UList< Type > &f, const label comm)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
Type gMinMagSqr(const UList< Type > &f, const label comm)
outerProduct1< Type >::type sumSqr(const UList< Type > &f1)
Type gSumCmptProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)
Type gSum(const FieldField< Field, Type > &f)
void cmptMagSqr(Field< Type > &result, const UList< Type > &f1)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
pTraits< arg1 >::cmptType type
Type sumCmptMag(const UList< Type > &f1)
void negate(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
Macro functions for Field<Type> algebra.
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)
outerProduct1< Type >::type gSumSqr(const UList< Type > &f, const label comm)
scalarMinMax gMinMaxMag(const FieldField< Field, Type > &f)
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &f1)
Type gAverage(const FieldField< Field, Type > &f)
BINARY_TYPE_FUNCTION_FS(Type, Type, MinMax< Type >, clip)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
#define TERNARY_TYPE_FUNCTION_FFS(ReturnType, Type1, Type2, Type3, Func)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
void multiply(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
#define TERNARY_FUNCTION(ReturnType, Type1, Type2, Type3, Func)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
#define PRODUCT_OPERATOR(product, Op, OpFunc)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
pTraits< typename pTraits< arg1 >::cmptType >::magType type
#define TMP_UNARY_FUNCTION(ReturnType, Func)