29 template<class Type, template<class> class PatchField, class GeoMesh> 39 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
44 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
57 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
72 template<
class>
class PatchField,
89 template<
class>
class PatchField,
93 tmp<GeometricField<typename powProduct<Type, r>::type, PatchField, GeoMesh>>
106 "pow(" + gf.
name() +
',' +
name(r) +
')',
112 pow<Type, r, PatchField, GeoMesh>(tPow.ref(), gf);
121 template<
class>
class PatchField,
125 tmp<GeometricField<typename powProduct<Type, r>::type, PatchField, GeoMesh>>
140 "pow(" + gf.
name() +
',' +
name(r) +
')',
146 pow<Type, r, PatchField, GeoMesh>(tPow.ref(), gf);
154 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
158 <
typename outerProduct<Type, Type>::type, PatchField, GeoMesh>& gf,
166 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
171 typename outerProduct<Type, Type>::type,
178 typedef typename outerProduct<Type, Type>::type outerProductType;
184 "sqr(" + gf.
name() +
')',
195 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
200 typename outerProduct<Type, Type>::type,
207 typedef typename outerProduct<Type, Type>::type outerProductType;
215 "sqr(" + gf.
name() +
')',
229 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
240 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
250 "magSqr(" + gf.
name() +
')',
256 magSqr(tMagSqr.ref(), gf);
261 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
273 "magSqr(" + gf.
name() +
')',
279 magSqr(tMagSqr.ref(), gf);
287 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
298 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
308 "mag(" + gf.
name() +
')',
319 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
331 "mag(" + gf.
name() +
')',
345 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
350 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
361 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
366 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
373 typedef typename GeometricField<Type, PatchField, GeoMesh>::cmptType
380 "cmptAv(" + gf.
name() +
')',
391 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
396 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
403 typedef typename GeometricField<Type, PatchField, GeoMesh>::cmptType
412 "cmptAv(" + gf.
name() +
')',
426 #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \ 428 template<class Type, template<class> class PatchField, class GeoMesh> \ 429 dimensioned<returnType> func \ 431 const GeometricField<Type, PatchField, GeoMesh>& gf \ 434 return dimensioned<Type> \ 436 #func "(" + gf.name() + ')', \ 438 Foam::func(gFunc(gf.primitiveField()), gFunc(gf.boundaryField())) \ 442 template<class Type, template<class> class PatchField, class GeoMesh> \ 443 dimensioned<returnType> func \ 445 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 448 dimensioned<returnType> res = func(tgf1()); \ 456 #undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY 459 #define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \ 461 template<class Type, template<class> class PatchField, class GeoMesh> \ 462 dimensioned<returnType> func \ 464 const GeometricField<Type, PatchField, GeoMesh>& gf \ 467 return dimensioned<Type> \ 469 #func "(" + gf.name() + ')', \ 471 gFunc(gf.primitiveField()) \ 475 template<class Type, template<class> class PatchField, class GeoMesh> \ 476 dimensioned<returnType> func \ 478 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 481 dimensioned<returnType> res = func(tgf1()); \ 490 #undef UNARY_REDUCTION_FUNCTION 520 #define PRODUCT_OPERATOR(product, op, opFunc) \ 523 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 527 <typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \ 528 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 529 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 534 gf.primitiveFieldRef(), \ 535 gf1.primitiveField(), \ 536 gf2.primitiveField() \ 540 gf.boundaryFieldRef(), \ 541 gf1.boundaryField(), \ 542 gf2.boundaryField() \ 547 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 550 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 554 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 555 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 558 typedef typename product<Type1, Type2>::type productType; \ 559 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 561 GeometricField<productType, PatchField, GeoMesh>::New \ 563 '(' + gf1.name() + #op + gf2.name() + ')', \ 565 gf1.dimensions() op gf2.dimensions() \ 569 Foam::opFunc(tRes.ref(), gf1, gf2); \ 575 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 578 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 582 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 583 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 586 typedef typename product<Type1, Type2>::type productType; \ 588 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 590 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 591 reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh>::New \ 594 '(' + gf1.name() + #op + gf2.name() + ')', \ 595 gf1.dimensions() op gf2.dimensions() \ 598 Foam::opFunc(tRes.ref(), gf1, gf2); \ 606 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 609 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 613 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 614 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 617 typedef typename product<Type1, Type2>::type productType; \ 619 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 621 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 622 reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh>::New \ 625 '(' + gf1.name() + #op + gf2.name() + ')', \ 626 gf1.dimensions() op gf2.dimensions() \ 629 Foam::opFunc(tRes.ref(), gf1, gf2); \ 637 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 640 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 644 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 645 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 648 typedef typename product<Type1, Type2>::type productType; \ 650 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 651 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 653 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 654 reuseTmpTmpGeometricField \ 655 <productType, Type1, Type2, PatchField, GeoMesh>::New \ 659 '(' + gf1.name() + #op + gf2.name() + ')', \ 660 gf1.dimensions() op gf2.dimensions() \ 663 Foam::opFunc(tRes.ref(), gf1, gf2); \ 672 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 676 <typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \ 677 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 678 const dimensioned<Form>& dvs \ 681 Foam::opFunc(gf.primitiveFieldRef(), gf1.primitiveField(), dvs.value()); \ 682 Foam::opFunc(gf.boundaryFieldRef(), gf1.boundaryField(), dvs.value()); \ 686 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 687 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 690 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 691 const dimensioned<Form>& dvs \ 694 typedef typename product<Type, Form>::type productType; \ 696 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 698 GeometricField<productType, PatchField, GeoMesh>::New \ 700 '(' + gf1.name() + #op + dvs.name() + ')', \ 702 gf1.dimensions() op dvs.dimensions() \ 706 Foam::opFunc(tRes.ref(), gf1, dvs); \ 716 class Type, template<class> class PatchField, \ 719 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 722 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 723 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 726 return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 731 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 732 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 735 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 736 const dimensioned<Form>& dvs \ 739 typedef typename product<Type, Form>::type productType; \ 741 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 743 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 744 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 747 '(' + gf1.name() + #op + dvs.name() + ')', \ 748 gf1.dimensions() op dvs.dimensions() \ 751 Foam::opFunc(tRes.ref(), gf1, dvs); \ 763 class Type, template<class> class PatchField, \ 766 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 769 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 770 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 773 return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 778 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 782 <typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \ 783 const dimensioned<Form>& dvs, \ 784 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 787 Foam::opFunc(gf.primitiveFieldRef(), dvs.value(), gf1.primitiveField()); \ 788 Foam::opFunc(gf.boundaryFieldRef(), dvs.value(), gf1.boundaryField()); \ 792 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 793 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 796 const dimensioned<Form>& dvs, \ 797 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 800 typedef typename product<Form, Type>::type productType; \ 801 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 803 GeometricField<productType, PatchField, GeoMesh>::New \ 805 '(' + dvs.name() + #op + gf1.name() + ')', \ 807 dvs.dimensions() op gf1.dimensions() \ 811 Foam::opFunc(tRes.ref(), dvs, gf1); \ 821 class Type, template<class> class PatchField, \ 824 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 827 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 828 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 831 return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \ 835 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 836 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 839 const dimensioned<Form>& dvs, \ 840 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 843 typedef typename product<Form, Type>::type productType; \ 845 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 847 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 848 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 851 '(' + dvs.name() + #op + gf1.name() + ')', \ 852 dvs.dimensions() op gf1.dimensions() \ 855 Foam::opFunc(tRes.ref(), dvs, gf1); \ 867 class Type, template<class> class PatchField, \ 870 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 873 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 874 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 877 return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \ 888 #undef PRODUCT_OPERATOR void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc)
scalar gSumMag(const FieldField< Field, Type > &f)
#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.
void clear() const
If object pointer points to valid object:
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc)
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)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
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)
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Generic GeometricField class.
#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 > &)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
#define PRODUCT_OPERATOR(product, op, opFunc)
const dimensionSet & dimensions() const
Return dimensions.
Type gSum(const FieldField< Field, Type > &f)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
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)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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)
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
Type gAverage(const FieldField< Field, Type > &f)
dimensioned< scalar > mag(const dimensioned< Type > &)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
A class for managing temporary objects.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensionSet transform(const dimensionSet &)