32 template<class Type, template<class> class PatchField, class GeoMesh> 42 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
61 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
64 GeometricField<Type, PatchField, GeoMesh>& gf,
65 const GeometricField<Type, PatchField, GeoMesh>& gf1
68 T(gf.primitiveFieldRef(), gf1.primitiveField());
69 T(gf.boundaryFieldRef(), gf1.boundaryField());
70 gf.oriented() = gf1.oriented();
77 template<
class>
class PatchField,
96 template<
class>
class PatchField,
114 "pow(" + gf.
name() +
',' +
name(r) +
')',
124 pow<Type, r, PatchField, GeoMesh>(tres.ref(), gf);
133 template<
class>
class PatchField,
153 "pow(" + gf.
name() +
',' +
name(r) +
')',
163 pow<Type, r, PatchField, GeoMesh>(tres.ref(), gf);
170 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
175 const GeometricField<Type, PatchField, GeoMesh>& gf1
184 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
203 "sqr(" + gf.
name() +
')',
219 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
240 "sqr(" + gf.
name() +
')',
258 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
262 const GeometricField<Type, PatchField, GeoMesh>& gf
265 magSqr(gsf.primitiveFieldRef(), gf.primitiveField());
266 magSqr(gsf.boundaryFieldRef(), gf.boundaryField());
271 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
275 const GeometricField<Type, PatchField, GeoMesh>& gf
281 tmp<GeometricField<magType, PatchField, GeoMesh>>
::New 285 "magSqr(" + gf.name() +
')',
300 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
304 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
307 auto tres =
magSqr(tgf.cref());
314 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
318 const GeometricField<Type, PatchField, GeoMesh>& gf
321 mag(gsf.primitiveFieldRef(), gf.primitiveField());
322 mag(gsf.boundaryFieldRef(), gf.boundaryField());
323 gsf.oriented() =
mag(gf.oriented());
327 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
331 const GeometricField<Type, PatchField, GeoMesh>& gf
337 tmp<GeometricField<magType, PatchField, GeoMesh>>
::New 341 "mag(" + gf.name() +
')',
356 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
360 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
363 auto tres =
mag(tgf.cref());
370 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
379 const GeometricField<Type, PatchField, GeoMesh>& gf
382 cmptAv(gcf.primitiveFieldRef(), gf.primitiveField());
383 cmptAv(gcf.boundaryFieldRef(), gf.boundaryField());
384 gcf.oriented() =
cmptAv(gf.oriented());
387 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
407 "cmptAv(" + gf.
name() +
')',
423 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
445 "cmptAv(" + gf.
name() +
')',
463 #define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, binaryOp) \ 465 template<class Type, template<class> class PatchField, class GeoMesh> \ 466 dimensioned<returnType> func \ 468 const GeometricField<Type, PatchField, GeoMesh>& gf \ 471 return dimensioned<returnType> \ 473 #func "(" + gf.name() + ')', \ 479 Foam::func(gf.primitiveField()), \ 480 Foam::func(gf.boundaryField()) \ 482 binaryOp<returnType>() \ 487 template<class Type, template<class> class PatchField, class GeoMesh> \ 488 dimensioned<returnType> func \ 490 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 493 dimensioned<returnType> res = func(tgf1()); \ 503 #undef UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY 506 #define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc) \ 508 template<class Type, template<class> class PatchField, class GeoMesh> \ 509 dimensioned<returnType> func \ 511 const GeometricField<Type, PatchField, GeoMesh>& gf \ 514 return dimensioned<returnType> \ 516 #func "(" + gf.name() + ')', \ 518 gFunc(gf.primitiveField()) \ 522 template<class Type, template<class> class PatchField, class GeoMesh> \ 523 dimensioned<returnType> func \ 525 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 528 dimensioned<returnType> res = func(tgf1()); \ 537 #undef UNARY_REDUCTION_FUNCTION 567 #define PRODUCT_OPERATOR(product, op, opFunc) \ 570 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 574 <typename product<Type1, Type2>::type, PatchField, GeoMesh>& gf, \ 575 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 576 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 581 gf.primitiveFieldRef(), \ 582 gf1.primitiveField(), \ 583 gf2.primitiveField() \ 587 gf.boundaryFieldRef(), \ 588 gf1.boundaryField(), \ 589 gf2.boundaryField() \ 592 gf.oriented() = gf1.oriented() op gf2.oriented(); \ 596 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 599 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 603 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 604 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 607 typedef typename product<Type1, Type2>::type productType; \ 610 tmp<GeometricField<productType, PatchField, GeoMesh>>::New \ 614 '(' + gf1.name() + #op + gf2.name() + ')', \ 621 gf1.dimensions() op gf2.dimensions() \ 624 Foam::opFunc(tres.ref(), gf1, gf2); \ 631 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 634 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 638 const GeometricField<Type1, PatchField, GeoMesh>& gf1, \ 639 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 642 typedef typename product<Type1, Type2>::type productType; \ 644 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 647 reuseTmpGeometricField<productType, Type2, PatchField, GeoMesh>::New \ 650 '(' + gf1.name() + #op + gf2.name() + ')', \ 651 gf1.dimensions() op gf2.dimensions() \ 654 Foam::opFunc(tres.ref(), gf1, gf2); \ 662 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 665 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 669 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 670 const GeometricField<Type2, PatchField, GeoMesh>& gf2 \ 673 typedef typename product<Type1, Type2>::type productType; \ 675 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 678 reuseTmpGeometricField<productType, Type1, PatchField, GeoMesh>::New \ 681 '(' + gf1.name() + #op + gf2.name() + ')', \ 682 gf1.dimensions() op gf2.dimensions() \ 685 Foam::opFunc(tres.ref(), gf1, gf2); \ 693 <class Type1, class Type2, template<class> class PatchField, class GeoMesh> \ 696 GeometricField<typename product<Type1, Type2>::type, PatchField, GeoMesh> \ 700 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1, \ 701 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2 \ 704 typedef typename product<Type1, Type2>::type productType; \ 706 const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1(); \ 707 const GeometricField<Type2, PatchField, GeoMesh>& gf2 = tgf2(); \ 710 reuseTmpTmpGeometricField \ 711 <productType, Type1, Type1, Type2, PatchField, GeoMesh>::New \ 715 '(' + gf1.name() + #op + gf2.name() + ')', \ 716 gf1.dimensions() op gf2.dimensions() \ 719 Foam::opFunc(tres.ref(), gf1, gf2); \ 728 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 732 <typename product<Type, Form>::type, PatchField, GeoMesh>& gf, \ 733 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 734 const dimensioned<Form>& dvs \ 737 Foam::opFunc(gf.primitiveFieldRef(), gf1.primitiveField(), dvs.value()); \ 738 Foam::opFunc(gf.boundaryFieldRef(), gf1.boundaryField(), dvs.value()); \ 739 gf.oriented() = gf1.oriented(); \ 743 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 744 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 747 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 748 const dimensioned<Form>& dvs \ 751 typedef typename product<Type, Form>::type productType; \ 754 tmp<GeometricField<productType, PatchField, GeoMesh>>::New \ 758 '(' + gf1.name() + #op + dvs.name() + ')', \ 765 gf1.dimensions() op dvs.dimensions() \ 768 Foam::opFunc(tres.ref(), gf1, dvs); \ 778 class Type, template<class> class PatchField, \ 781 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 784 const GeometricField<Type, PatchField, GeoMesh>& gf1, \ 785 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 788 return gf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 793 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 794 tmp<GeometricField<typename product<Type, Form>::type, PatchField, GeoMesh>> \ 797 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 798 const dimensioned<Form>& dvs \ 801 typedef typename product<Type, Form>::type productType; \ 803 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 806 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 809 '(' + gf1.name() + #op + dvs.name() + ')', \ 810 gf1.dimensions() op dvs.dimensions() \ 813 Foam::opFunc(tres.ref(), gf1, dvs); \ 825 class Type, template<class> class PatchField, \ 828 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 831 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1, \ 832 const VectorSpace<Form,Cmpt,nCmpt>& vs \ 835 return tgf1 op dimensioned<Form>(static_cast<const Form&>(vs)); \ 840 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 844 <typename product<Form, Type>::type, PatchField, GeoMesh>& gf, \ 845 const dimensioned<Form>& dvs, \ 846 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 849 Foam::opFunc(gf.primitiveFieldRef(), dvs.value(), gf1.primitiveField()); \ 850 Foam::opFunc(gf.boundaryFieldRef(), dvs.value(), gf1.boundaryField()); \ 851 gf.oriented() = gf1.oriented(); \ 855 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 856 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 859 const dimensioned<Form>& dvs, \ 860 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 863 typedef typename product<Form, Type>::type productType; \ 866 tmp<GeometricField<productType, PatchField, GeoMesh>>::New \ 870 '(' + dvs.name() + #op + gf1.name() + ')', \ 877 dvs.dimensions() op gf1.dimensions() \ 880 Foam::opFunc(tres.ref(), dvs, gf1); \ 890 class Type, template<class> class PatchField, \ 893 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 896 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 897 const GeometricField<Type, PatchField, GeoMesh>& gf1 \ 900 return dimensioned<Form>(static_cast<const Form&>(vs)) op gf1; \ 904 <class Form, class Type, template<class> class PatchField, class GeoMesh> \ 905 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 908 const dimensioned<Form>& dvs, \ 909 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 912 typedef typename product<Form, Type>::type productType; \ 914 const GeometricField<Type, PatchField, GeoMesh>& gf1 = tgf1(); \ 917 reuseTmpGeometricField<productType, Type, PatchField, GeoMesh>::New \ 920 '(' + dvs.name() + #op + gf1.name() + ')', \ 921 dvs.dimensions() op gf1.dimensions() \ 924 Foam::opFunc(tres.ref(), dvs, gf1); \ 936 class Type, template<class> class PatchField, \ 939 tmp<GeometricField<typename product<Form, Type>::type, PatchField, GeoMesh>> \ 942 const VectorSpace<Form,Cmpt,nCmpt>& vs, \ 943 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf1 \ 946 return dimensioned<Form>(static_cast<const Form&>(vs)) op tgf1; \ 957 #undef PRODUCT_OPERATOR void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
#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 Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
MinMax< scalar > scalarMinMax
A scalar min/max range.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc)
const word & name() const noexcept
Return the object name.
Field< Type >::cmptType cmptType
Component type of the field elements.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
orientedType oriented() const noexcept
Return oriented type.
#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
Generic GeometricField class.
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
Ignore writing from objectRegistry::writeObject()
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
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)
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
#define PRODUCT_OPERATOR(product, op, opFunc)
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
const Mesh & mesh() const noexcept
Return mesh.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const fileName & instance() const noexcept
Read access to instance path component.
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
Type gAverage(const FieldField< Field, Type > &f)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
#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 &ds)
Return the argument; transformations do not change the dimensions.
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, binaryOp)
Defines the attributes of an object for which implicit objectRegistry management is supported...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &df)
const dimensionSet & dimensions() const noexcept
Return dimensions.
pTraits< typename pTraits< arg1 >::cmptType >::magType type