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) +
')',
58 pow<Type, r, GeoMesh>(tPow.ref().field(), df.
field());
64 template<
class Type,
class GeoMesh, direction r>
80 "pow(" + df.
name() +
',' +
name(r) +
')',
84 pow<Type, r, GeoMesh>(tPow.
ref().field(), df.
field());
91 template<
class Type,
class GeoMesh>
101 "sqr(" + df.
name() +
')',
107 sqr(tSqr.ref().field(), df.
field());
112 template<
class Type,
class 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>
230 <
typename DimensionedField<Type, GeoMesh>::cmptType,
GeoMesh>
234 typedef typename DimensionedField<Type, GeoMesh>::cmptType cmptType;
240 "cmptAv(" + df.
name() +
')',
251 template<
class Type,
class GeoMesh>
255 <
typename DimensionedField<Type, GeoMesh>::cmptType,
GeoMesh>
259 typedef typename DimensionedField<Type, GeoMesh>::cmptType
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() + ')', \ 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() \ 366 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 371 template<class Type1, class Type2, class GeoMesh> \ 372 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 375 const DimensionedField<Type1, GeoMesh>& df1, \ 376 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \ 379 typedef typename product<Type1, Type2>::type productType; \ 381 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \ 383 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 384 reuseTmpDimensionedField<productType, Type2, GeoMesh>::New \ 387 '(' + df1.name() + #op + df2.name() + ')', \ 388 df1.dimensions() op df2.dimensions() \ 391 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 398 template<class Type1, class Type2, class GeoMesh> \ 399 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 402 const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \ 403 const DimensionedField<Type2, GeoMesh>& df2 \ 406 typedef typename product<Type1, Type2>::type productType; \ 408 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \ 410 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 411 reuseTmpDimensionedField<productType, Type1, GeoMesh>::New \ 414 '(' + df1.name() + #op + df2.name() + ')', \ 415 df1.dimensions() op df2.dimensions() \ 418 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 425 template<class Type1, class Type2, class GeoMesh> \ 426 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 429 const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \ 430 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \ 433 typedef typename product<Type1, Type2>::type productType; \ 435 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \ 436 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \ 438 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 439 reuseTmpTmpDimensionedField<productType, Type1, Type2, GeoMesh>::New \ 443 '(' + df1.name() + #op + df2.name() + ')', \ 444 df1.dimensions() op df2.dimensions() \ 447 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 455 template<class Form, class Type, class GeoMesh> \ 456 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \ 459 const DimensionedField<Type, GeoMesh>& df1, \ 460 const dimensioned<Form>& dvs \ 463 typedef typename product<Type, Form>::type productType; \ 465 tmp<DimensionedField<productType, GeoMesh>> tRes \ 467 DimensionedField<productType, GeoMesh>::New \ 469 '(' + df1.name() + #op + dvs.name() + ')', \ 471 df1.dimensions() op dvs.dimensions() \ 475 Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ 480 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 481 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 484 const DimensionedField<Type, GeoMesh>& df1, \ 485 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 488 return df1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 492 template<class Form, class Type, class GeoMesh> \ 493 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \ 496 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \ 497 const dimensioned<Form>& dvs \ 500 typedef typename product<Type, Form>::type productType; \ 502 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \ 504 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 505 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \ 508 '(' + df1.name() + #op + dvs.name() + ')', \ 509 df1.dimensions() op dvs.dimensions() \ 512 Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ 519 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 520 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 523 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \ 524 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 527 return tdf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 531 template<class Form, class Type, class GeoMesh> \ 532 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 535 const dimensioned<Form>& dvs, \ 536 const DimensionedField<Type, GeoMesh>& df1 \ 539 typedef typename product<Form, Type>::type productType; \ 540 tmp<DimensionedField<productType, GeoMesh>> tRes \ 542 DimensionedField<productType, GeoMesh>::New \ 544 '(' + dvs.name() + #op + df1.name() + ')', \ 546 dvs.dimensions() op df1.dimensions() \ 550 Foam::opFunc(tRes.ref().field(), dvs.value(), df1.field()); \ 555 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 556 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 559 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 560 const DimensionedField<Type, GeoMesh>& df1 \ 563 return dimensioned<Form>(static_cast<const Form&>(vs)) op df1; \ 566 template<class Form, class Type, class GeoMesh> \ 567 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 570 const dimensioned<Form>& dvs, \ 571 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 574 typedef typename product<Form, Type>::type productType; \ 576 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \ 578 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 579 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \ 582 '(' + dvs.name() + #op + df1.name() + ')', \ 583 dvs.dimensions() op df1.dimensions() \ 586 Foam::opFunc(tRes.ref().field(), dvs.value(), df1.field()); \ 593 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 594 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 597 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 598 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 601 return dimensioned<Form>(static_cast<const Form&>(vs)) op tdf1; \ 612 #undef PRODUCT_OPERATOR void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
scalar gSumMag(const FieldField< Field, Type > &f)
#define PRODUCT_OPERATOR(product, op, opFunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
const word & name() const
Return name.
Type gMin(const FieldField< Field, Type > &f)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#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)
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)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
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 > &)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
const dimensionSet & dimensions() const
Return dimensions.
Type gSum(const FieldField< Field, Type > &f)
dimensionSet cmptMag(const dimensionSet &)
#define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
const Mesh & mesh() const
Return mesh.
Type gMax(const FieldField< Field, Type > &f)
const Field< Type > & field() const
word name(const complex &)
Return a string representation of a complex.
UNARY_FUNCTION(Type, Type, cmptMag, cmptMag)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
Type gAverage(const FieldField< Field, Type > &f)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
A class for managing temporary objects.
dimensionSet transform(const dimensionSet &)
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< Type1, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)