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() +
')',
279 #define UNARY_REDUCTION_FUNCTION(returnType, func, dfunc) \ 281 template<class Type, class GeoMesh> \ 282 dimensioned<returnType> func \ 284 const DimensionedField<Type, GeoMesh>& df \ 287 return dimensioned<Type> \ 289 #func "(" + df.name() + ')', \ 295 template<class Type, class GeoMesh> \ 296 dimensioned<returnType> func \ 298 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 301 dimensioned<returnType> res = func(tdf1()); \ 312 #undef UNARY_REDUCTION_FUNCTION 342 #define PRODUCT_OPERATOR(product, op, opFunc) \ 344 template<class Type1, class Type2, class GeoMesh> \ 345 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 348 const DimensionedField<Type1, GeoMesh>& df1, \ 349 const DimensionedField<Type2, GeoMesh>& df2 \ 352 typedef typename product<Type1, Type2>::type productType; \ 353 tmp<DimensionedField<productType, GeoMesh>> tRes \ 355 DimensionedField<productType, GeoMesh>::New \ 357 '(' + df1.name() + #op + df2.name() + ')', \ 359 df1.dimensions() op df2.dimensions() \ 363 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 368 template<class Type1, class Type2, class GeoMesh> \ 369 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 372 const DimensionedField<Type1, GeoMesh>& df1, \ 373 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \ 376 typedef typename product<Type1, Type2>::type productType; \ 378 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \ 380 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 381 reuseTmpDimensionedField<productType, Type2, GeoMesh>::New \ 384 '(' + df1.name() + #op + df2.name() + ')', \ 385 df1.dimensions() op df2.dimensions() \ 388 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 395 template<class Type1, class Type2, class GeoMesh> \ 396 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 399 const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \ 400 const DimensionedField<Type2, GeoMesh>& df2 \ 403 typedef typename product<Type1, Type2>::type productType; \ 405 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \ 407 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 408 reuseTmpDimensionedField<productType, Type1, GeoMesh>::New \ 411 '(' + df1.name() + #op + df2.name() + ')', \ 412 df1.dimensions() op df2.dimensions() \ 415 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 422 template<class Type1, class Type2, class GeoMesh> \ 423 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \ 426 const tmp<DimensionedField<Type1, GeoMesh>>& tdf1, \ 427 const tmp<DimensionedField<Type2, GeoMesh>>& tdf2 \ 430 typedef typename product<Type1, Type2>::type productType; \ 432 const DimensionedField<Type1, GeoMesh>& df1 = tdf1(); \ 433 const DimensionedField<Type2, GeoMesh>& df2 = tdf2(); \ 435 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 436 reuseTmpTmpDimensionedField<productType, Type1, Type2, GeoMesh>::New \ 440 '(' + df1.name() + #op + df2.name() + ')', \ 441 df1.dimensions() op df2.dimensions() \ 444 Foam::opFunc(tRes.ref().field(), df1.field(), df2.field()); \ 452 template<class Form, class Type, class GeoMesh> \ 453 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \ 456 const DimensionedField<Type, GeoMesh>& df1, \ 457 const dimensioned<Form>& dvs \ 460 typedef typename product<Type, Form>::type productType; \ 462 tmp<DimensionedField<productType, GeoMesh>> tRes \ 464 DimensionedField<productType, GeoMesh>::New \ 466 '(' + df1.name() + #op + dvs.name() + ')', \ 468 df1.dimensions() op dvs.dimensions() \ 472 Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ 477 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 478 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 481 const DimensionedField<Type, GeoMesh>& df1, \ 482 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 485 return df1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 489 template<class Form, class Type, class GeoMesh> \ 490 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \ 493 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \ 494 const dimensioned<Form>& dvs \ 497 typedef typename product<Type, Form>::type productType; \ 499 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \ 501 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 502 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \ 505 '(' + df1.name() + #op + dvs.name() + ')', \ 506 df1.dimensions() op dvs.dimensions() \ 509 Foam::opFunc(tRes.ref().field(), df1.field(), dvs.value()); \ 516 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 517 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 520 const tmp<DimensionedField<Type, GeoMesh>>& tdf1, \ 521 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 524 return tdf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 528 template<class Form, class Type, class GeoMesh> \ 529 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 532 const dimensioned<Form>& dvs, \ 533 const DimensionedField<Type, GeoMesh>& df1 \ 536 typedef typename product<Form, Type>::type productType; \ 537 tmp<DimensionedField<productType, GeoMesh>> tRes \ 539 DimensionedField<productType, GeoMesh>::New \ 541 '(' + dvs.name() + #op + df1.name() + ')', \ 543 dvs.dimensions() op df1.dimensions() \ 547 Foam::opFunc(tRes.ref().field(), dvs.value(), df1.field()); \ 552 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \ 553 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 556 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 557 const DimensionedField<Type, GeoMesh>& df1 \ 560 return dimensioned<Form>(static_cast<const Form&>(vs)) op df1; \ 563 template<class Form, class Type, class GeoMesh> \ 564 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \ 567 const dimensioned<Form>& dvs, \ 568 const tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 571 typedef typename product<Form, Type>::type productType; \ 573 const DimensionedField<Type, GeoMesh>& df1 = tdf1(); \ 575 tmp<DimensionedField<productType, GeoMesh>> tRes = \ 576 reuseTmpDimensionedField<productType, Type, GeoMesh>::New \ 579 '(' + dvs.name() + #op + df1.name() + ')', \ 580 dvs.dimensions() op df1.dimensions() \ 583 Foam::opFunc(tRes.ref().field(), dvs.value(), df1.field()); \ 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 tmp<DimensionedField<Type, GeoMesh>>& tdf1 \ 598 return dimensioned<Form>(static_cast<const Form&>(vs)) op tdf1; \ 609 #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)
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)