29#define TEMPLATE template<class Type>
51void T(Field<Type>& res,
const UList<Type>&
f);
54template<
class Type, direction r>
62template<
class Type, direction r>
63tmp<Field<typename powProduct<Type, r>::type>>
71template<
class Type, direction r>
72tmp<Field<typename powProduct<Type, r>::type>>
75 const tmp<Field<Type>>& tf,
89tmp<Field<typename outerProduct<Type, Type>::type>>
90sqr(
const UList<Type>&
f);
93tmp<Field<typename outerProduct<Type, Type>::type>>
94sqr(
const tmp<Field<Type>>& tf);
105tmp<Field<typename typeOfMag<Type>::type>>
109tmp<Field<typename typeOfMag<Type>::type>>
110magSqr(
const tmp<Field<Type>>& tf);
121tmp<Field<typename typeOfMag<Type>::type>>
122mag(
const UList<Type>&
f);
125tmp<Field<typename typeOfMag<Type>::type>>
126mag(
const tmp<Field<Type>>& tf);
133tmp<Field<typename Field<Type>::cmptType>>
cmptMax(
const UList<Type>&
f);
136tmp<Field<typename Field<Type>::cmptType>>
137cmptMax(
const tmp<Field<Type>>& tf);
144tmp<Field<typename Field<Type>::cmptType>>
cmptMin(
const UList<Type>&
f);
147tmp<Field<typename Field<Type>::cmptType>>
148cmptMin(
const tmp<Field<Type>>& tf);
155tmp<Field<typename Field<Type>::cmptType>>
cmptAv(
const UList<Type>&
f);
158tmp<Field<typename Field<Type>::cmptType>>
cmptAv(
const tmp<Field<Type>>& tf);
162void cmptMag(Field<Type>& res,
const UList<Type>&
f);
165tmp<Field<Type>>
cmptMag(
const UList<Type>&
f);
168tmp<Field<Type>>
cmptMag(
const tmp<Field<Type>>& tf);
172void cmptMagSqr(Field<Type>& res,
const UList<Type>&
f);
178tmp<Field<Type>>
cmptMagSqr(
const tmp<Field<Type>>& tf);
181#define TMP_UNARY_FUNCTION(ReturnType, Func) \
184template<class Type> \
185ReturnType Func(const tmp<Field<Type>>& tf1);
188Type
max(
const UList<Type>&
f);
193Type
min(
const UList<Type>&
f);
198Type
sum(
const UList<Type>&
f);
226 const UList<Type>& f1,
227 const UList<Type>& f2
231Type
sumCmptProd(
const UList<Type>& f1,
const UList<Type>& f2);
257#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \
259template<class Type> \
260ReturnType gFunc(const UList<Type>& f, const label comm = UPstream::worldComm);\
261TMP_UNARY_FUNCTION(ReturnType, gFunc)
276#undef G_UNARY_FUNCTION
282 const UList<Type>& f1,
283 const UList<Type>& f2,
290 const UList<Type>& f1,
291 const UList<Type>& f2,
299 const UList<Type>&
f,
311 const UList<scalar>& weights,
312 const UList<Type>&
fld,
335 const UList<scalar>& weights,
336 const UList<Type>&
fld,
346 const UList<scalar>& weights,
347 const UList<Type>&
fld
355#undef TMP_UNARY_FUNCTION
393#define PRODUCT_OPERATOR(product, Op, OpFunc) \
395template<class Type1, class Type2> \
398 Field<typename product<Type1, Type2>::type>& res, \
399 const UList<Type1>& f1, \
400 const UList<Type2>& f2 \
403template<class Type1, class Type2> \
404tmp<Field<typename product<Type1, Type2>::type>> \
405operator Op(const UList<Type1>& f1, const UList<Type2>& f2); \
407template<class Type1, class Type2> \
408tmp<Field<typename product<Type1, Type2>::type>> \
409operator Op(const UList<Type1>& f1, const tmp<Field<Type2>>& tf2); \
411template<class Type1, class Type2> \
412tmp<Field<typename product<Type1, Type2>::type>> \
413operator Op(const tmp<Field<Type1>>& tf1, const UList<Type2>& f2); \
415template<class Type1, class Type2> \
416tmp<Field<typename product<Type1, Type2>::type>> \
417operator Op(const tmp<Field<Type1>>& tf1, const tmp<Field<Type2>>& tf2); \
419template<class Type, class Form, class Cmpt, direction nCmpt> \
422 Field<typename product<Type, Form>::type>& res, \
423 const UList<Type>& f1, \
424 const VectorSpace<Form,Cmpt,nCmpt>& vs \
427template<class Type, class Form, class Cmpt, direction nCmpt> \
428tmp<Field<typename product<Type, Form>::type>> \
429operator Op(const UList<Type>& f1, const VectorSpace<Form,Cmpt,nCmpt>& vs); \
431template<class Type, class Form, class Cmpt, direction nCmpt> \
432tmp<Field<typename product<Type, Form>::type>> \
433operator Op(const tmp<Field<Type>>&tf1,const VectorSpace<Form,Cmpt,nCmpt>&vs); \
435template<class Form, class Cmpt, direction nCmpt, class Type> \
438 Field<typename product<Form, Type>::type>& res, \
439 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
440 const UList<Type>& f1 \
443template<class Form, class Cmpt, direction nCmpt, class Type> \
444tmp<Field<typename product<Form, Type>::type>> \
445operator Op(const VectorSpace<Form,Cmpt,nCmpt>& vs, const UList<Type>& f1); \
447template<class Form, class Cmpt, direction nCmpt, class Type> \
448tmp<Field<typename product<Form, Type>::type>> \
449operator Op(const VectorSpace<Form,Cmpt,nCmpt>&vs,const tmp<Field<Type>>&tf1);
459#undef PRODUCT_OPERATOR
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define TERNARY_FUNCTION(ReturnType, Type1, Type2, Type3, Func)
#define TERNARY_TYPE_FUNCTION_FFS(ReturnType, Type1, Type2, Type3, Func)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc)
#define TMP_UNARY_FUNCTION(ReturnType, Func)
Macro functions for Field<Type> algebra.
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
pTraits< Type >::cmptType cmptType
Component type.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
symmTypeOfRank< typenamepTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank)>::type type
pTraits< arg1 >::cmptType type
pTraits< typenamepTraits< arg1 >::cmptType >::magType type
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
#define PRODUCT_OPERATOR(product, op, opFunc)
Type weightedSum(const UList< scalar > &weights, const UList< Type > &fld)
The local weighted sum (integral) of a field, using the mag() of the weights.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &f1, const label comm)
scalarProduct< Type, Type >::type gSumProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
Type gWeightedAverage(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted average of a field, using the mag() of the weights.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void subtract(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Type sumCmptMag(const UList< Type > &f1)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Type weightedAverage(const UList< scalar > &weights, const UList< Type > &fld)
The local weighted average of a field, using the mag() of the weights.
Type sumCmptProd(const UList< Type > &f1, const UList< Type > &f2)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
void divide(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
Type minMagSqr(const UList< Type > &f1)
MinMax< scalar > scalarMinMax
A scalar min/max range.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Type gWeightedSum(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted sum (integral) of a field, using the mag() of the weights.
scalarMinMax gMinMaxMag(const FieldField< Field, Type > &f)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Type gMaxMagSqr(const UList< Type > &f, const label comm)
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh > > cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
outerProduct1< Type >::type sumSqr(const UList< Type > &f1)
complex sumProd(const UList< complex > &f1, const UList< complex > &f2)
Sum product.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void cmptMagSqr(Field< Type > &result, const UList< Type > &f1)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
typeOfMag< Type >::type gSumMag(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)
Type gMin(const FieldField< Field, Type > &f)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
outerProduct1< Type >::type gSumSqr(const UList< Type > &f, const label comm)
void negate(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1)
Type gMinMagSqr(const UList< Type > &f, const label comm)
Type maxMagSqr(const UList< Type > &f1)
void multiply(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
Type gSumCmptMag(const UList< Type > &f, const label comm)
Type gMax(const FieldField< Field, Type > &f)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
Type gSumCmptProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &f1, const label comm)
dict add("bounds", meshBb)