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() +
')',
428 #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, gFunc) \ 430 template<class Type, template<class> class PatchField, class GeoMesh> \ 431 dimensioned<returnType> func \ 433 const GeometricField<Type, PatchField, GeoMesh>& gf \ 436 return dimensioned<Type> \ 438 #func "(" + gf.name() + ')', \ 440 Foam::func(gFunc(gf.primitiveField()), gFunc(gf.boundaryField())) \ 444 template<class Type, template<class> class PatchField, class GeoMesh> \ 445 dimensioned<returnType> func \ 447 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 450 dimensioned<returnType> res = func(tgf1()); \ 458 #undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY 461 #define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \ 463 template<class Type, template<class> class PatchField, class GeoMesh> \ 464 dimensioned<returnType> func \ 466 const GeometricField<Type, PatchField, GeoMesh>& gf \ 469 return dimensioned<Type> \ 471 #func "(" + gf.name() + ')', \ 473 gFunc(gf.primitiveField()) \ 477 template<class Type, template<class> class PatchField, class GeoMesh> \ 478 dimensioned<returnType> func \ 480 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 483 dimensioned<returnType> res = func(tgf1()); \ 492 #undef UNARY_REDUCTION_FUNCTION 522 #define PRODUCT_OPERATOR(product, op, opFunc) \ 525 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 529 <typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \ 530 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 531 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 536 gf.primitiveFieldRef(), \ 537 gf1.primitiveField(), \ 538 gf2.primitiveField() \ 542 gf.boundaryFieldRef(), \ 543 gf1.boundaryField(), \ 544 gf2.boundaryField() \ 549 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 552 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 556 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 557 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 560 typedef typename product<Type1, Type2>::type productType; \ 561 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 563 GeometricField<productType, PatchField, GeoMesh>::New \ 565 '(' + gf1.name() + #op + gf2.name() + ')', \ 567 gf1.dimensions() op gf2.dimensions() \ 571 Foam::opFunc(tRes.ref(), gf1, gf2); \ 577 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 580 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 584 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 585 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 588 typedef typename product<Type1, Type2>::type productType; \ 590 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 592 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 593 reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh>::New \ 596 '(' + gf1.name() + #op + gf2.name() + ')', \ 597 gf1.dimensions() op gf2.dimensions() \ 600 Foam::opFunc(tRes.ref(), gf1, gf2); \ 608 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 611 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 615 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 616 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 619 typedef typename product<Type1, Type2>::type productType; \ 621 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 623 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 624 reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh>::New \ 627 '(' + gf1.name() + #op + gf2.name() + ')', \ 628 gf1.dimensions() op gf2.dimensions() \ 631 Foam::opFunc(tRes.ref(), gf1, gf2); \ 639 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 642 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 646 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 647 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 650 typedef typename product<Type1, Type2>::type productType; \ 652 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 653 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 655 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 656 reuseTmpTmpGeometricField \ 657 <productType, Type1, Type2, PatchField, GeoMesh>::New \ 661 '(' + gf1.name() + #op + gf2.name() + ')', \ 662 gf1.dimensions() op gf2.dimensions() \ 665 Foam::opFunc(tRes.ref(), gf1, gf2); \ 674 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 678 <typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \ 679 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 680 const dimensioned<Form>& dvs \ 683 Foam::opFunc(gf.primitiveFieldRef(), gf1.primitiveField(), dvs.value()); \ 684 Foam::opFunc(gf.boundaryFieldRef(), gf1.boundaryField(), dvs.value()); \ 688 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 689 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 692 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 693 const dimensioned<Form>& dvs \ 696 typedef typename product<Type, Form>::type productType; \ 698 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 700 GeometricField<productType, PatchField, GeoMesh>::New \ 702 '(' + gf1.name() + #op + dvs.name() + ')', \ 704 gf1.dimensions() op dvs.dimensions() \ 708 Foam::opFunc(tRes.ref(), gf1, dvs); \ 718 class Type, template<class> class PatchField, \ 721 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 724 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 725 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 728 return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 733 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 734 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 737 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 738 const dimensioned<Form>& dvs \ 741 typedef typename product<Type, Form>::type productType; \ 743 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 745 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 746 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 749 '(' + gf1.name() + #op + dvs.name() + ')', \ 750 gf1.dimensions() op dvs.dimensions() \ 753 Foam::opFunc(tRes.ref(), gf1, dvs); \ 765 class Type, template<class> class PatchField, \ 768 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 771 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 772 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 775 return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 780 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 784 <typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \ 785 const dimensioned<Form>& dvs, \ 786 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 789 Foam::opFunc(gf.primitiveFieldRef(), dvs.value(), gf1.primitiveField()); \ 790 Foam::opFunc(gf.boundaryFieldRef(), dvs.value(), gf1.boundaryField()); \ 794 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 795 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 798 const dimensioned<Form>& dvs, \ 799 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 802 typedef typename product<Form, Type>::type productType; \ 803 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes \ 805 GeometricField<productType, PatchField, GeoMesh>::New \ 807 '(' + dvs.name() + #op + gf1.name() + ')', \ 809 dvs.dimensions() op gf1.dimensions() \ 813 Foam::opFunc(tRes.ref(), dvs, gf1); \ 823 class Type, template<class> class PatchField, \ 826 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 829 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 830 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 833 return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \ 837 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 838 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 841 const dimensioned<Form>& dvs, \ 842 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 845 typedef typename product<Form, Type>::type productType; \ 847 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 849 tmp<GeometricField<productType, PatchField, GeoMesh>> tRes = \ 850 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 853 '(' + dvs.name() + #op + gf1.name() + ')', \ 854 dvs.dimensions() op gf1.dimensions() \ 857 Foam::opFunc(tRes.ref(), dvs, gf1); \ 869 class Type, template<class> class PatchField, \ 872 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 875 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 876 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 879 return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \ 890 #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)
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.
void clear() const
If object pointer points to valid object:
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc)
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)
dimensionSet cmptMag(const dimensionSet &)
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.
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)
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 &)