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>>
108 "pow(" + gf.
name() +
',' +
name(r) +
')',
119 pow<Type, r, PatchField, GeoMesh>(tPow.ref(), gf);
128 template<
class>
class PatchField,
132 tmp<GeometricField<typename powProduct<Type, r>::type, PatchField, GeoMesh>>
149 "pow(" + gf.
name() +
',' +
name(r) +
')',
160 pow<Type, r, PatchField, GeoMesh>(tPow.ref(), gf);
168 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
172 <
typename outerProduct<Type, Type>::type, PatchField, GeoMesh>& gf,
180 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
185 typename outerProduct<Type, Type>::type,
192 typedef typename outerProduct<Type, Type>::type outerProductType;
200 "sqr(" + gf.
name() +
')',
216 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
221 typename outerProduct<Type, Type>::type,
228 typedef typename outerProduct<Type, Type>::type outerProductType;
238 "sqr(" + gf.
name() +
')',
257 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
268 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
280 "magSqr(" + gf.
name() +
')',
291 magSqr(tMagSqr.ref(), gf);
296 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
310 "magSqr(" + gf.
name() +
')',
321 magSqr(tMagSqr.ref(), gf);
329 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
340 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
352 "mag(" + gf.
name() +
')',
368 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
382 "mag(" + gf.
name() +
')',
401 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
406 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
417 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
422 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
429 typedef typename GeometricField<Type, PatchField, GeoMesh>::cmptType
438 "cmptAv(" + gf.
name() +
')',
454 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
459 typename GeometricField<Type, PatchField, GeoMesh>::cmptType,
466 typedef typename GeometricField<Type, PatchField, GeoMesh>::cmptType
477 "cmptAv(" + gf.
name() +
')',
496 #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \ 498 template<class Type, template<class> class PatchField, class GeoMesh> \ 499 dimensioned<returnType> func \ 501 const GeometricField<Type, PatchField, GeoMesh>& gf \ 504 return dimensioned<Type> \ 506 #func "(" + gf.name() + ')', \ 508 Foam::func(gFunc(gf.primitiveField()), gFunc(gf.boundaryField())) \ 512 template<class Type, template<class> class PatchField, class GeoMesh> \ 513 dimensioned<returnType> func \ 515 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 518 dimensioned<returnType> res = func(tgf1()); \ 526 #undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY 529 #define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \ 531 template<class Type, template<class> class PatchField, class GeoMesh> \ 532 dimensioned<returnType> func \ 534 const GeometricField<Type, PatchField, GeoMesh>& gf \ 537 return dimensioned<Type> \ 539 #func "(" + gf.name() + ')', \ 541 gFunc(gf.primitiveField()) \ 545 template<class Type, template<class> class PatchField, class GeoMesh> \ 546 dimensioned<returnType> func \ 548 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 551 dimensioned<returnType> res = func(tgf1()); \ 560 #undef UNARY_REDUCTION_FUNCTION 590 #define PRODUCT_OPERATOR(product, op, opFunc) \ 593 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 597 <typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \ 598 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 599 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 604 gf.primitiveFieldRef(), \ 605 gf1.primitiveField(), \ 606 gf2.primitiveField() \ 610 gf.boundaryFieldRef(), \ 611 gf1.boundaryField(), \ 612 gf2.boundaryField() \ 617 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 620 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 624 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 625 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 628 typedef typename product<Type1, Type2>::type productType; \ 629 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 631 new GeometricField<productType, PatchField, GeoMesh> \ 635 '(' + gf1.name() + #op + gf2.name() + ')', \ 642 gf1.dimensions() op gf2.dimensions() \ 646 Foam::opFunc(tRes.ref(), gf1, gf2); \ 652 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 655 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 659 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 660 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 663 typedef typename product<Type1, Type2>::type productType; \ 665 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 667 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 668 reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh>::New \ 671 '(' + gf1.name() + #op + gf2.name() + ')', \ 672 gf1.dimensions() op gf2.dimensions() \ 675 Foam::opFunc(tRes.ref(), gf1, gf2); \ 683 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 686 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 690 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 691 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 694 typedef typename product<Type1, Type2>::type productType; \ 696 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 698 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 699 reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh>::New \ 702 '(' + gf1.name() + #op + gf2.name() + ')', \ 703 gf1.dimensions() op gf2.dimensions() \ 706 Foam::opFunc(tRes.ref(), gf1, gf2); \ 714 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 717 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 721 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 722 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 725 typedef typename product<Type1, Type2>::type productType; \ 727 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 728 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 730 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 731 reuseTmpTmpGeometricField \ 732 <productType, Type1, Type1, Type2, PatchField, GeoMesh>::New \ 736 '(' + gf1.name() + #op + gf2.name() + ')', \ 737 gf1.dimensions() op gf2.dimensions() \ 740 Foam::opFunc(tRes.ref(), gf1, gf2); \ 749 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 753 <typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \ 754 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 755 const dimensioned<Form>& dvs \ 758 Foam::opFunc(gf.primitiveFieldRef(), gf1.primitiveField(), dvs.value()); \ 759 Foam::opFunc(gf.boundaryFieldRef(), gf1.boundaryField(), dvs.value()); \ 763 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 764 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 767 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 768 const dimensioned<Form>& dvs \ 771 typedef typename product<Type, Form>::type productType; \ 773 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 775 new GeometricField<productType, PatchField, GeoMesh> \ 779 '(' + gf1.name() + #op + dvs.name() + ')', \ 786 gf1.dimensions() op dvs.dimensions() \ 790 Foam::opFunc(tRes.ref(), gf1, dvs); \ 800 class Type, template<class> class PatchField, \ 803 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 806 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 807 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 810 return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 815 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 816 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 819 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 820 const dimensioned<Form>& dvs \ 823 typedef typename product<Type, Form>::type productType; \ 825 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 827 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 828 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 831 '(' + gf1.name() + #op + dvs.name() + ')', \ 832 gf1.dimensions() op dvs.dimensions() \ 835 Foam::opFunc(tRes.ref(), gf1, dvs); \ 847 class Type, template<class> class PatchField, \ 850 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 853 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 854 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 857 return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 862 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 866 <typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \ 867 const dimensioned<Form>& dvs, \ 868 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 871 Foam::opFunc(gf.primitiveFieldRef(), dvs.value(), gf1.primitiveField()); \ 872 Foam::opFunc(gf.boundaryFieldRef(), dvs.value(), gf1.boundaryField()); \ 876 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 877 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 880 const dimensioned<Form>& dvs, \ 881 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 884 typedef typename product<Form, Type>::type productType; \ 885 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 887 new GeometricField<productType, PatchField, GeoMesh> \ 891 '(' + dvs.name() + #op + gf1.name() + ')', \ 898 dvs.dimensions() op gf1.dimensions() \ 902 Foam::opFunc(tRes.ref(), dvs, gf1); \ 912 class Type, template<class> class PatchField, \ 915 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 918 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 919 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 922 return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \ 926 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 927 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 930 const dimensioned<Form>& dvs, \ 931 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 934 typedef typename product<Form, Type>::type productType; \ 936 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 938 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 939 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 942 '(' + dvs.name() + #op + gf1.name() + ')', \ 943 dvs.dimensions() op gf1.dimensions() \ 946 Foam::opFunc(tRes.ref(), dvs, gf1); \ 958 class Type, template<class> class PatchField, \ 961 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 964 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 965 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 968 return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \ 979 #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)
const fileName & instance() const
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.
const objectRegistry & db() const
Return the local objectRegistry.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensionSet transform(const dimensionSet &)