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>>
54 "pow(" + df.
name() +
',' +
name(r) +
')',
63 pow<Type, r, GeoMesh>(tPow.ref().field(), df.
field());
69 template<
class Type,
class GeoMesh, direction r>
85 "pow(" + df.
name() +
',' +
name(r) +
')',
89 pow<Type, r, GeoMesh>(tPow.
ref().field(), df.
field());
96 template<
class Type,
class GeoMesh>
108 "sqr(" + df.
name() +
')',
117 sqr(tSqr.ref().field(), df.
field());
122 template<
class Type,
class GeoMesh>
134 "sqr(" + df.
name() +
')',
146 template<
class Type,
class GeoMesh>
158 "magSqr(" + df.
name() +
')',
172 template<
class Type,
class GeoMesh>
184 "magSqr(" + df.
name() +
')',
196 template<
class Type,
class GeoMesh>
208 "mag(" + df.
name() +
')',
222 template<
class Type,
class GeoMesh>
234 "mag(" + df.
name() +
')',
246 template<
class Type,
class GeoMesh>
250 <
typename DimensionedField<Type, GeoMesh>::cmptType,
GeoMesh>
254 typedef typename DimensionedField<Type, GeoMesh>::cmptType cmptType;
262 "cmptAv(" + df.
name() +
')',
276 template<
class Type,
class GeoMesh>
280 <
typename DimensionedField<Type, GeoMesh>::cmptType,
GeoMesh>
284 typedef typename DimensionedField<Type, GeoMesh>::cmptType
293 "cmptAv(" + df.
name() +
')',
304 #define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \ 306 template<class Type, class GeoMesh> \ 307 dimensioned<returnType> func \ 309 const DimensionedField<Type, GeoMesh>& df \ 312 return dimensioned<Type> \ 314 #func "(" + df.name() + ')', \ 320 template<class Type, class GeoMesh> \ 321 dimensioned<returnType> func \ 323 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 326 dimensioned<returnType> res = func(tdf1()); \ 337 #undef UNARY_REDUCTION_FUNCTION 367 #define PRODUCT_OPERATOR(product, op, opFunc) \ 369 template<class Type1, class Type2, class GeoMesh> \ 370 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 373 const DimensionedField<Type1, GeoMesh>& df1, \ 374 const DimensionedField<Type2, GeoMesh>& df2 \ 377 typedef typename product<Type1, Type2>::type productType; \ 378 tmp<DimensionedField<productType, GeoMesh>> tRes \ 380 new DimensionedField<productType, GeoMesh> \ 384 '(' + df1.name() + #op + df2.name() + ')', \ 389 df1.dimensions() op df2.dimensions() \ 393 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 DimensionedField<Type1, GeoMesh>& df1, \ 403 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \ 406 typedef typename product<Type1, Type2>::type productType; \ 408 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \ 410 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 411 reuseTmpDimensionedField<productType, Type2, 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 DimensionedField<Type2, GeoMesh>& df2 \ 433 typedef typename product<Type1, Type2>::type productType; \ 435 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \ 437 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 438 reuseTmpDimensionedField<productType, Type1, GeoMesh>::New \ 441 '(' + df1.name() + #op + df2.name() + ')', \ 442 df1.dimensions() op df2.dimensions() \ 445 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 452 template<class Type1, class Type2, class GeoMesh> \ 453 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 456 const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \ 457 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \ 460 typedef typename product<Type1, Type2>::type productType; \ 462 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \ 463 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \ 465 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 466 reuseTmpTmpDimensionedField \ 467 <productType, Type1, Type1, Type2, GeoMesh>::New \ 471 '(' + df1.name() + #op + df2.name() + ')', \ 472 df1.dimensions() op df2.dimensions() \ 475 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 483 template<class Form, class Type, class GeoMesh> \ 484 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \ 487 const DimensionedField<Type, GeoMesh>& df1, \ 488 const dimensioned<Form>& dvs \ 491 typedef typename product<Type, Form>::type productType; \ 493 tmp<DimensionedField<productType, GeoMesh>> tRes \ 495 new DimensionedField<productType, GeoMesh> \ 499 '(' + df1.name() + #op + dvs.name() + ')', \ 504 df1.dimensions() op dvs.dimensions() \ 508 Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ 513 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 514 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 517 const DimensionedField<Type, GeoMesh>& df1, \ 518 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 521 return df1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 525 template<class Form, class Type, class GeoMesh> \ 526 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \ 529 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \ 530 const dimensioned<Form>& dvs \ 533 typedef typename product<Type, Form>::type productType; \ 535 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \ 537 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 538 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \ 541 '(' + df1.name() + #op + dvs.name() + ')', \ 542 df1.dimensions() op dvs.dimensions() \ 545 Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ 552 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 553 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 556 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \ 557 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 560 return tdf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 564 template<class Form, class Type, class GeoMesh> \ 565 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 568 const dimensioned<Form>& dvs, \ 569 const DimensionedField<Type, GeoMesh>& df1 \ 572 typedef typename product<Form, Type>::type productType; \ 573 tmp<DimensionedField<productType, GeoMesh>> tRes \ 575 new DimensionedField<productType, GeoMesh> \ 579 '(' + dvs.name() + #op + df1.name() + ')', \ 584 dvs.dimensions() op df1.dimensions() \ 588 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 DimensionedField<Type, GeoMesh>& df1 \ 601 return dimensioned<Form>(static_cast<const Form&>(vs)) op df1; \ 604 template<class Form, class Type, class GeoMesh> \ 605 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 608 const dimensioned<Form>& dvs, \ 609 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 612 typedef typename product<Form, Type>::type productType; \ 614 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \ 616 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 617 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \ 620 '(' + dvs.name() + #op + df1.name() + ')', \ 621 dvs.dimensions() op df1.dimensions() \ 624 Foam::opFunc(tRes.ref().field(), dvs.value(), df1.field()); \ 631 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 632 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 635 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 636 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 639 return dimensioned<Form>(static_cast<const Form&>(vs)) op tdf1; \ 650 #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)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
const word & name() const
Return name.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
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)
#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.
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const fileName & instance() const
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.
const objectRegistry & db() const
Return the local objectRegistry.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
dimensionSet transform(const dimensionSet &)
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< Type1, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)