Go to the documentation of this file.
32 template<class Type, template<class> class PatchField, class GeoMesh>
42 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
57 gcf.oriented() = gf.oriented();
61 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
70 gf.oriented() = gf1.oriented();
77 template<
class>
class PatchField,
89 gf.oriented() =
pow(gf1.oriented(), r);
96 template<
class>
class PatchField,
114 "pow(" + gf.name() +
',' +
name(r) +
')',
121 pow(gf.dimensions(), r)
124 pow<Type, r, PatchField, GeoMesh>(tres.ref(), gf);
133 template<
class>
class PatchField,
153 "pow(" + gf.name() +
',' +
name(r) +
')',
160 pow(gf.dimensions(), r)
163 pow<Type, r, PatchField, GeoMesh>(tres.ref(), gf);
170 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
180 gf.oriented() =
sqr(gf1.oriented());
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>
267 gsf.oriented() =
magSqr(gf.oriented());
271 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
285 "magSqr(" + gf.name() +
')',
300 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
307 auto tres =
magSqr(tgf.cref());
314 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
323 gsf.oriented() =
mag(gf.oriented());
327 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
341 "mag(" + gf.name() +
')',
356 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
363 auto tres =
mag(tgf.cref());
370 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
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
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
A class for managing temporary objects.
Type gAverage(const FieldField< Field, Type > &f)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
Type gSum(const FieldField< Field, Type > &f)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Field< Type >::cmptType cmptType
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
#define UNARY_REDUCTION_FUNCTION(returnType, func, gFunc)
word name(const complex &c)
Return string representation of complex.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
The magnitude type for given argument.
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
Scalar combine the magitude of a value.
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &df)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
#define PRODUCT_OPERATOR(product, op, opFunc)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Combine values and/or MinMax ranges.
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Generic GeometricField class.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
pTraits< typename pTraits< arg1 >::cmptType >::magType type
A min/max value pair with additional methods. In addition to conveniently storing values,...
const Boundary & boundaryField() const
Return const-reference to the boundary field.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
#define UNARY_REDUCTION_FUNCTION_WITH_BOUNDARY(returnType, func, binaryOp)
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)