28 #define TEMPLATE template<class Type, class GeoMesh>
38 template<
class Type,
class GeoMesh, direction r>
39 tmp<DimensionedField<typename powProduct<Type, r>::type, GeoMesh>>
52 "pow(" + df.
name() +
',' +
name(r) +
')',
64 template<
class Type,
class GeoMesh, direction r>
65 tmp<DimensionedField<typename powProduct<Type, r>::type, GeoMesh>>
80 "pow(" + df.
name() +
',' +
name(r) +
')',
91 template<
class Type,
class GeoMesh>
92 tmp<DimensionedField<typename outerProduct<Type, Type>::type, GeoMesh>>
101 "sqr(" + df.
name() +
')',
112 template<
class Type,
class GeoMesh>
113 tmp<DimensionedField<typename outerProduct<Type, Type>::type, GeoMesh>>
124 "sqr(" + df.
name() +
')',
136 template<
class Type,
class GeoMesh>
146 "magSqr(" + df.
name() +
')',
157 template<
class Type,
class GeoMesh>
169 "magSqr(" + df.
name() +
')',
181 template<
class Type,
class GeoMesh>
191 "mag(" + df.
name() +
')',
202 template<
class Type,
class GeoMesh>
214 "mag(" + df.
name() +
')',
226 template<
class Type,
class GeoMesh>
240 "cmptAv(" + df.
name() +
')',
251 template<
class Type,
class GeoMesh>
268 "cmptAv(" + df.
name() +
')',
282 #define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \
284 template<class Type, class GeoMesh> \
285 dimensioned<returnType> func \
287 const DimensionedField<Type, GeoMesh>& df \
290 return dimensioned<Type> \
292 #func "(" + df.name() + ')', \
294 dfunc(df.primitiveField()) \
298 template<class Type, class GeoMesh> \
299 dimensioned<returnType> func \
301 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
304 dimensioned<returnType> res = func(tdf1()); \
315 #undef UNARY_REDUCTION_FUNCTION
345 #define PRODUCT_OPERATOR(product, op, opFunc) \
347 template<class Type1, class Type2, class GeoMesh> \
348 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
351 const DimensionedField<Type1, GeoMesh>& df1, \
352 const DimensionedField<Type2, GeoMesh>& df2 \
355 typedef typename product<Type1, Type2>::type productType; \
356 tmp<DimensionedField<productType, GeoMesh>> tRes \
358 DimensionedField<productType, GeoMesh>::New \
360 '(' + df1.name() + #op + df2.name() + ')', \
362 df1.dimensions() op df2.dimensions() \
368 tRes.ref().primitiveFieldRef(), \
369 df1.primitiveField(), \
370 df2.primitiveField() \
376 template<class Type1, class Type2, class GeoMesh> \
377 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
380 const DimensionedField<Type1, GeoMesh>& df1, \
381 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
384 typedef typename product<Type1, Type2>::type productType; \
386 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \
388 tmp<DimensionedField<productType, GeoMesh>> tRes = \
389 reuseTmpDimensionedField<productType, Type2, GeoMesh>::New \
392 '(' + df1.name() + #op + df2.name() + ')', \
393 df1.dimensions() op df2.dimensions() \
398 tRes.ref().primitiveFieldRef(), \
399 df1.primitiveField(), \
400 df2.primitiveField() \
408 template<class Type1, class Type2, class GeoMesh> \
409 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
412 const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
413 const DimensionedField<Type2, GeoMesh>& df2 \
416 typedef typename product<Type1, Type2>::type productType; \
418 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \
420 tmp<DimensionedField<productType, GeoMesh>> tRes = \
421 reuseTmpDimensionedField<productType, Type1, GeoMesh>::New \
424 '(' + df1.name() + #op + df2.name() + ')', \
425 df1.dimensions() op df2.dimensions() \
430 tRes.ref().primitiveFieldRef(), \
431 df1.primitiveField(), \
432 df2.primitiveField() \
440 template<class Type1, class Type2, class GeoMesh> \
441 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
444 const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \
445 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \
448 typedef typename product<Type1, Type2>::type productType; \
450 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \
451 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \
453 tmp<DimensionedField<productType, GeoMesh>> tRes = \
454 reuseTmpTmpDimensionedField<productType, Type1, Type2, GeoMesh>::New \
458 '(' + df1.name() + #op + df2.name() + ')', \
459 df1.dimensions() op df2.dimensions() \
464 tRes.ref().primitiveFieldRef(), \
465 df1.primitiveField(), \
466 df2.primitiveField() \
475 template<class Form, class Type, class GeoMesh> \
476 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
479 const DimensionedField<Type, GeoMesh>& df1, \
480 const dimensioned<Form>& dvs \
483 typedef typename product<Type, Form>::type productType; \
485 tmp<DimensionedField<productType, GeoMesh>> tRes \
487 DimensionedField<productType, GeoMesh>::New \
489 '(' + df1.name() + #op + dvs.name() + ')', \
491 df1.dimensions() op dvs.dimensions() \
497 tRes.ref().primitiveFieldRef(), \
498 df1.primitiveField(), \
505 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
506 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
509 const DimensionedField<Type, GeoMesh>& df1, \
510 const VectorSpace<Form,Cmpt,nCmpt>& vs \
513 return df1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
517 template<class Form, class Type, class GeoMesh> \
518 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
521 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
522 const dimensioned<Form>& dvs \
525 typedef typename product<Type, Form>::type productType; \
527 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \
529 tmp<DimensionedField<productType, GeoMesh>> tRes = \
530 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \
533 '(' + df1.name() + #op + dvs.name() + ')', \
534 df1.dimensions() op dvs.dimensions() \
539 tRes.ref().primitiveFieldRef(), \
540 df1.primitiveField(), \
549 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
550 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
553 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \
554 const VectorSpace<Form,Cmpt,nCmpt>& vs \
557 return tdf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \
561 template<class Form, class Type, class GeoMesh> \
562 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
565 const dimensioned<Form>& dvs, \
566 const DimensionedField<Type, GeoMesh>& df1 \
569 typedef typename product<Form, Type>::type productType; \
570 tmp<DimensionedField<productType, GeoMesh>> tRes \
572 DimensionedField<productType, GeoMesh>::New \
574 '(' + dvs.name() + #op + df1.name() + ')', \
576 dvs.dimensions() op df1.dimensions() \
582 tRes.ref().primitiveFieldRef(), \
584 df1.primitiveField() \
590 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
591 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
594 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
595 const DimensionedField<Type, GeoMesh>& df1 \
598 return dimensioned<Form>(static_cast<const Form&>(vs)) op df1; \
601 template<class Form, class Type, class GeoMesh> \
602 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
605 const dimensioned<Form>& dvs, \
606 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
609 typedef typename product<Form, Type>::type productType; \
611 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \
613 tmp<DimensionedField<productType, GeoMesh>> tRes = \
614 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \
617 '(' + dvs.name() + #op + df1.name() + ')', \
618 dvs.dimensions() op df1.dimensions() \
623 tRes.ref().primitiveFieldRef(), \
625 df1.primitiveField() \
633 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
634 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
637 const VectorSpace<Form,Cmpt,nCmpt>& vs, \
638 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \
641 return dimensioned<Form>(static_cast<const Form&>(vs)) op tdf1; \
652 #undef PRODUCT_OPERATOR
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#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 UNARY_REDUCTION_FUNCTION(returnType, func, dfunc)
#define PRODUCT_OPERATOR(product, op, opFunc)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet & dimensions() const
Return dimensions.
const Field< Type > & primitiveField() const
Return a const-reference to the primitive field.
const Mesh & mesh() const
Return mesh.
Field< Type >::cmptType cmptType
Component type of the elements of the field.
const word & name() const
Return name.
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
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< Type1, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
Type gSum(const FieldField< Field, Type > &f)
scalar gSumMag(const FieldField< Field, Type > &f)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
word name(const bool)
Return a word representation of a bool.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
UNARY_FUNCTION(Type, Type, cmptMag, cmptMag)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionSet transform(const dimensionSet &)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionSet cmptMag(const dimensionSet &)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Type gAverage(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 cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Type gMax(const FieldField< Field, Type > &f)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh > &df)