30 #define TEMPLATE template<template<class> class PatchField, class GeoMesh> 40 template<
template<
class>
class PatchField,
class GeoMesh>
53 template<
template<
class>
class PatchField,
class GeoMesh>
54 tmp<GeometricField<scalar, PatchField, GeoMesh>>
stabilise 56 const GeometricField<scalar, PatchField, GeoMesh>& gsf,
57 const dimensioned<scalar>& ds
60 tmp<GeometricField<scalar, PatchField, GeoMesh>> tRes
62 new GeometricField<scalar, PatchField, GeoMesh>
66 "stabilise(" + gsf.name() +
',' + ds.name() +
')',
73 ds.dimensions() + gsf.dimensions()
83 template<
template<
class>
class PatchField,
class GeoMesh>
84 tmp<GeometricField<scalar, PatchField, GeoMesh>>
stabilise 86 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf,
87 const dimensioned<scalar>& ds
90 const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf();
92 tmp<GeometricField<scalar, PatchField, GeoMesh>> tRes
97 "stabilise(" + gsf.name() +
',' + ds.name() +
')',
98 ds.dimensions() + gsf.dimensions()
123 template<template<class> class PatchField, class
GeoMesh>
131 pow(Pow.primitiveFieldRef(), gsf1.primitiveField(), gsf2.primitiveField());
132 pow(Pow.boundaryFieldRef(), gsf1.boundaryField(), gsf2.boundaryField());
136 template<
template<
class>
class PatchField,
class GeoMesh>
137 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 139 const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
140 const GeometricField<scalar, PatchField, GeoMesh>& gsf2
143 if (!gsf1.dimensions().dimensionless())
146 <<
"Base field is not dimensionless: " << gsf1.dimensions()
150 if (!gsf2.dimensions().dimensionless())
153 <<
"Exponent field is not dimensionless: " << gsf2.dimensions()
157 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
159 new GeometricField<scalar, PatchField, GeoMesh>
163 "pow(" + gsf1.name() +
',' + gsf2.name() +
')',
174 pow(tPow.
ref(), gsf1, gsf2);
180 template<
template<
class>
class PatchField,
class GeoMesh>
181 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 183 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf1,
184 const GeometricField<scalar, PatchField, GeoMesh>& gsf2
187 const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1();
189 if (!gsf1.dimensions().dimensionless())
192 <<
"Base field is not dimensionless: " << gsf1.dimensions()
196 if (!gsf2.dimensions().dimensionless())
199 <<
"Exponent field is not dimensionless: " << gsf2.dimensions()
203 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
208 "pow(" + gsf1.name() +
',' + gsf2.name() +
')',
213 pow(tPow.
ref(), gsf1, gsf2);
221 template<
template<
class>
class PatchField,
class GeoMesh>
222 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 224 const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
225 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf2
228 const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2();
230 if (!gsf1.dimensions().dimensionless())
233 <<
"Base field is not dimensionless: " << gsf1.dimensions()
237 if (!gsf2.dimensions().dimensionless())
240 <<
"Exponent field is not dimensionless: " << gsf2.dimensions()
244 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
249 "pow(" + gsf1.name() +
',' + gsf2.name() +
')',
254 pow(tPow.
ref(), gsf1, gsf2);
261 template<
template<
class>
class PatchField,
class GeoMesh>
262 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 264 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf1,
265 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf2
268 const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1();
269 const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2();
271 if (!gsf1.dimensions().dimensionless())
274 <<
"Base field is not dimensionless: " << gsf1.dimensions()
278 if (!gsf2.dimensions().dimensionless())
281 <<
"Exponent field is not dimensionless: " << gsf2.dimensions()
285 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
287 reuseTmpTmpGeometricField
288 <scalar, scalar, scalar, scalar, PatchField, GeoMesh>::
New 292 "pow(" + gsf1.name() +
',' + gsf2.name() +
')',
297 pow(tPow.
ref(), gsf1, gsf2);
306 template<
template<
class>
class PatchField,
class GeoMesh>
309 GeometricField<scalar, PatchField, GeoMesh>& tPow,
310 const GeometricField<scalar, PatchField, GeoMesh>& gsf,
311 const dimensioned<scalar>& ds
314 pow(tPow.primitiveFieldRef(), gsf.primitiveField(), ds.value());
315 pow(tPow.boundaryFieldRef(), gsf.boundaryField(), ds.value());
319 template<
template<
class>
class PatchField,
class GeoMesh>
320 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 322 const GeometricField<scalar, PatchField, GeoMesh>& gsf,
326 if (!ds.dimensions().dimensionless())
329 <<
"Exponent is not dimensionless: " << ds.dimensions()
333 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
335 new GeometricField<scalar, PatchField, GeoMesh>
339 "pow(" + gsf.name() +
',' + ds.name() +
')',
346 pow(gsf.dimensions(), ds)
355 template<
template<
class>
class PatchField,
class GeoMesh>
356 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 358 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf,
362 if (!ds.dimensions().dimensionless())
365 <<
"Exponent is not dimensionless: " << ds.dimensions()
369 const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf();
371 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
376 "pow(" + gsf.name() +
',' + ds.name() +
')',
377 pow(gsf.dimensions(), ds)
381 pow(tPow.ref(), gsf, ds);
388 template<
template<
class>
class PatchField,
class GeoMesh>
389 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 391 const GeometricField<scalar, PatchField, GeoMesh>& gsf,
398 template<
template<
class>
class PatchField,
class GeoMesh>
399 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 401 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf,
409 template<
template<
class>
class PatchField,
class GeoMesh>
412 GeometricField<scalar, PatchField, GeoMesh>& tPow,
413 const dimensioned<scalar>& ds,
414 const GeometricField<scalar, PatchField, GeoMesh>& gsf
417 pow(tPow.primitiveFieldRef(), ds.value(), gsf.primitiveField());
418 pow(tPow.boundaryFieldRef(), ds.value(), gsf.boundaryField());
422 template<
template<
class>
class PatchField,
class GeoMesh>
423 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 426 const GeometricField<scalar, PatchField, GeoMesh>& gsf
429 if (!ds.dimensions().dimensionless())
432 <<
"Base scalar is not dimensionless: " << ds.dimensions()
436 if (!gsf.dimensions().dimensionless())
439 <<
"Exponent field is not dimensionless: " << gsf.dimensions()
443 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
445 new GeometricField<scalar, PatchField, GeoMesh>
449 "pow(" + ds.name() +
',' + gsf.name() +
')',
460 pow(tPow.ref(), ds, gsf);
466 template<
template<
class>
class PatchField,
class GeoMesh>
467 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 470 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf
473 const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf();
475 if (!ds.dimensions().dimensionless())
478 <<
"Base scalar is not dimensionless: " << ds.dimensions()
482 if (!gsf.dimensions().dimensionless())
485 <<
"Exponent field is not dimensionless: " << gsf.dimensions()
489 tmp<GeometricField<scalar, PatchField, GeoMesh>> tPow
494 "pow(" + ds.name() +
',' + gsf.name() +
')',
499 pow(tPow.ref(), ds, gsf);
506 template<
template<
class>
class PatchField,
class GeoMesh>
507 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 510 const GeometricField<scalar, PatchField, GeoMesh>& gsf
516 template<
template<
class>
class PatchField,
class GeoMesh>
517 tmp<GeometricField<scalar, PatchField, GeoMesh>>
pow 520 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf
529 template<
template<
class>
class PatchField,
class GeoMesh>
532 GeometricField<scalar, PatchField, GeoMesh>& Atan2,
533 const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
534 const GeometricField<scalar, PatchField, GeoMesh>& gsf2
539 Atan2.primitiveFieldRef(),
540 gsf1.primitiveField(),
541 gsf2.primitiveField()
545 Atan2.boundaryFieldRef(),
546 gsf1.boundaryField(),
552 template<
template<
class>
class PatchField,
class GeoMesh>
553 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 555 const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
556 const GeometricField<scalar, PatchField, GeoMesh>& gsf2
559 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
561 new GeometricField<scalar, PatchField, GeoMesh>
565 "atan2(" + gsf1.name() +
',' + gsf2.name() +
')',
572 atan2(gsf1.dimensions(), gsf2.dimensions())
582 template<
template<
class>
class PatchField,
class GeoMesh>
583 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 585 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf1,
586 const GeometricField<scalar, PatchField, GeoMesh>& gsf2
589 const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1();
591 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
596 "atan2(" + gsf1.name() +
',' + gsf2.name() +
')',
597 atan2(gsf1.dimensions(), gsf2.dimensions())
609 template<
template<
class>
class PatchField,
class GeoMesh>
610 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 612 const GeometricField<scalar, PatchField, GeoMesh>& gsf1,
613 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf2
616 const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2();
618 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
623 "atan2(" + gsf1.name() +
',' + gsf2.name() +
')',
624 atan2( gsf1.dimensions(), gsf2.dimensions())
635 template<
template<
class>
class PatchField,
class GeoMesh>
636 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 638 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf1,
639 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf2
642 const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1();
643 const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2();
645 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
647 reuseTmpTmpGeometricField
648 <scalar, scalar, scalar, scalar, PatchField, GeoMesh>::
New 652 "atan2(" + gsf1.name() +
',' + gsf2.name() +
')',
653 atan2(gsf1.dimensions(), gsf2.dimensions())
666 template<
template<
class>
class PatchField,
class GeoMesh>
669 GeometricField<scalar, PatchField, GeoMesh>& tAtan2,
670 const GeometricField<scalar, PatchField, GeoMesh>& gsf,
671 const dimensioned<scalar>& ds
674 atan2(tAtan2.primitiveFieldRef(), gsf.primitiveField(), ds.value());
675 atan2(tAtan2.boundaryFieldRef(), gsf.boundaryField(), ds.value());
679 template<
template<
class>
class PatchField,
class GeoMesh>
680 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 682 const GeometricField<scalar, PatchField, GeoMesh>& gsf,
686 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
688 new GeometricField<scalar, PatchField, GeoMesh>
692 "atan2(" + gsf.name() +
',' + ds.name() +
')',
699 atan2(gsf.dimensions(), ds)
708 template<
template<
class>
class PatchField,
class GeoMesh>
709 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 711 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf,
715 const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf();
717 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
722 "atan2(" + gsf.name() +
',' + ds.name() +
')',
723 atan2(gsf.dimensions(), ds)
727 atan2(tAtan2.ref(), gsf, ds);
734 template<
template<
class>
class PatchField,
class GeoMesh>
735 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 737 const GeometricField<scalar, PatchField, GeoMesh>& gsf,
744 template<
template<
class>
class PatchField,
class GeoMesh>
745 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 747 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf,
755 template<
template<
class>
class PatchField,
class GeoMesh>
758 GeometricField<scalar, PatchField, GeoMesh>& tAtan2,
759 const dimensioned<scalar>& ds,
760 const GeometricField<scalar, PatchField, GeoMesh>& gsf
763 atan2(tAtan2.primitiveFieldRef(), ds.value(), gsf.primitiveField());
764 atan2(tAtan2.boundaryFieldRef(), ds.value(), gsf.boundaryField());
768 template<
template<
class>
class PatchField,
class GeoMesh>
769 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 772 const GeometricField<scalar, PatchField, GeoMesh>& gsf
775 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
777 new GeometricField<scalar, PatchField, GeoMesh>
781 "atan2(" + ds.name() +
',' + gsf.name() +
')',
788 atan2(ds, gsf.dimensions())
792 atan2(tAtan2.ref(), ds, gsf);
798 template<
template<
class>
class PatchField,
class GeoMesh>
799 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 802 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf
805 const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf();
807 tmp<GeometricField<scalar, PatchField, GeoMesh>> tAtan2
812 "atan2(" + ds.name() +
',' + gsf.name() +
')',
813 atan2(ds, gsf.dimensions())
817 atan2(tAtan2.ref(), ds, gsf);
824 template<
template<
class>
class PatchField,
class GeoMesh>
825 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 828 const GeometricField<scalar, PatchField, GeoMesh>& gsf
834 template<
template<
class>
class PatchField,
class GeoMesh>
835 tmp<GeometricField<scalar, PatchField, GeoMesh>>
atan2 838 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf
888 #define BesselFunc(func) \ 890 template<template<class> class PatchField, class GeoMesh> \ 893 GeometricField<scalar, PatchField, GeoMesh>& gsf, \ 895 const GeometricField<scalar, PatchField, GeoMesh>& gsf1 \ 898 func(gsf.primitiveFieldRef(), n, gsf1.primitiveField()); \ 899 func(gsf.boundaryFieldRef(), n, gsf1.boundaryField()); \ 902 template<template<class> class PatchField, class GeoMesh> \ 903 tmp<GeometricField<scalar, PatchField, GeoMesh>> func \ 906 const GeometricField<scalar, PatchField, GeoMesh>& gsf \ 909 if (!gsf.dimensions().dimensionless()) \ 911 FatalErrorInFunction \ 912 << "gsf not dimensionless" \ 913 << abort(FatalError); \ 916 tmp<GeometricField<scalar, PatchField, GeoMesh>> tFunc \ 918 new GeometricField<scalar, PatchField, GeoMesh> \ 922 #func "(" + gsf.name() + ')', \ 933 func(tFunc.ref(), n, gsf); \ 938 template<template<class> class PatchField, class GeoMesh> \ 939 tmp<GeometricField<scalar, PatchField, GeoMesh>> func \ 942 const tmp<GeometricField<scalar, PatchField, GeoMesh>>& tgsf \ 945 const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf(); \ 947 if (!gsf.dimensions().dimensionless()) \ 949 FatalErrorInFunction \ 950 << " : gsf not dimensionless" \ 951 << abort(FatalError); \ 954 tmp<GeometricField<scalar, PatchField, GeoMesh>> tFunc \ 959 #func "(" + gsf.name() + ')', \ 964 func(tFunc.ref(), n, gsf); \ void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedScalar tanh(const dimensionedScalar &ds)
const Type & value() const noexcept
Return const reference to value.
dimensionedScalar acos(const dimensionedScalar &ds)
#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.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
dimensionedScalar yn(const int n, const dimensionedScalar &ds)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionedScalar pow025(const dimensionedScalar &ds)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionedScalar y0(const dimensionedScalar &ds)
Generic GeometricField class.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
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 subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar pow5(const dimensionedScalar &ds)
dimensionedScalar j1(const dimensionedScalar &ds)
dimensionedScalar pos(const dimensionedScalar &ds)
Scalar specific part of the implementation of GeometricField.
dimensionedScalar acosh(const dimensionedScalar &ds)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar asinh(const dimensionedScalar &ds)
dimensionedScalar jn(const int n, const dimensionedScalar &ds)
dimensionedScalar cbrt(const dimensionedScalar &ds)
dimensionedScalar neg0(const dimensionedScalar &ds)
dimensionedScalar atanh(const dimensionedScalar &ds)
dimensionedScalar y1(const dimensionedScalar &ds)
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedScalar sin(const dimensionedScalar &ds)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar erf(const dimensionedScalar &ds)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionSet trans(const dimensionSet &ds)
Check the argument is dimensionless (for transcendental functions)
dimensionedScalar lgamma(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar erfc(const dimensionedScalar &ds)
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
dimensionedScalar sinh(const dimensionedScalar &ds)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedScalar atan(const dimensionedScalar &ds)
dimensionedScalar pow4(const dimensionedScalar &ds)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
dimensionedScalar pow6(const dimensionedScalar &ds)
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
dimensionedScalar cosh(const dimensionedScalar &ds)
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensionedScalar tan(const dimensionedScalar &ds)
dimensionedScalar j0(const dimensionedScalar &ds)
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
dimensionedScalar log10(const dimensionedScalar &ds)
dimensionedScalar negPart(const dimensionedScalar &ds)