DimensionedScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 InClass
25  Foam::DimensionedScalarField
26 
27 Description
28  Scalar specific part of the implementation of DimensionedField.
29 
30 SourceFiles
31  DimensionedScalarField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef DimensionedScalarField_H
36 #define DimensionedScalarField_H
37 
38 #include "DimensionedField.H"
39 #include "scalar.H"
40 
41 #define TEMPLATE template<class GeoMesh, template<class> class PrimitiveField>
42 #define TEMPLATE2 \
43  template \
44  < \
45  class GeoMesh, \
46  template<class> class PrimitiveField1, \
47  template<class> class PrimitiveField2 \
48  >
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 template<class GeoMesh, template<class> class PrimitiveField>
59 tmp<DimensionedField<scalar, GeoMesh, Field>> stabilise
60 (
61  const DimensionedField<scalar, GeoMesh, PrimitiveField>&,
62  const dimensioned<scalar>&
63 );
64 
65 template<class GeoMesh>
67 (
69  const dimensioned<scalar>&
70 );
71 
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, '+', add)
76 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, '-', subtract)
77 
78 BINARY_OPERATOR(scalar, scalar, scalar, *, '*', multiply)
79 BINARY_OPERATOR(scalar, scalar, scalar, /, '|', divide)
80 
81 BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
82 
83 BINARY_FUNCTION(scalar, scalar, scalar, pow)
84 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
85 
86 BINARY_FUNCTION(scalar, scalar, scalar, atan2)
87 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
88 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 UNARY_FUNCTION(scalar, scalar, pow3, pow3)
93 UNARY_FUNCTION(scalar, scalar, pow4, pow4)
94 UNARY_FUNCTION(scalar, scalar, pow5, pow5)
95 UNARY_FUNCTION(scalar, scalar, pow6, pow6)
96 UNARY_FUNCTION(scalar, scalar, pow025, pow025)
97 UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
98 UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
99 UNARY_FUNCTION(scalar, scalar, sign, sign)
100 UNARY_FUNCTION(scalar, scalar, pos, pos)
101 UNARY_FUNCTION(scalar, scalar, pos0, pos0)
102 UNARY_FUNCTION(scalar, scalar, neg, neg)
103 UNARY_FUNCTION(scalar, scalar, neg0, neg0)
104 UNARY_FUNCTION(scalar, scalar, posPart, posPart)
105 UNARY_FUNCTION(scalar, scalar, negPart, negPart)
106 
107 UNARY_FUNCTION(scalar, scalar, exp, trans)
108 UNARY_FUNCTION(scalar, scalar, log, trans)
109 UNARY_FUNCTION(scalar, scalar, log10, trans)
110 UNARY_FUNCTION(scalar, scalar, sin, trans)
111 UNARY_FUNCTION(scalar, scalar, cos, trans)
112 UNARY_FUNCTION(scalar, scalar, tan, trans)
113 UNARY_FUNCTION(scalar, scalar, asin, trans)
114 UNARY_FUNCTION(scalar, scalar, acos, trans)
115 UNARY_FUNCTION(scalar, scalar, atan, trans)
116 UNARY_FUNCTION(scalar, scalar, sinh, trans)
117 UNARY_FUNCTION(scalar, scalar, cosh, trans)
118 UNARY_FUNCTION(scalar, scalar, tanh, trans)
119 UNARY_FUNCTION(scalar, scalar, asinh, trans)
120 UNARY_FUNCTION(scalar, scalar, acosh, trans)
121 UNARY_FUNCTION(scalar, scalar, atanh, trans)
122 UNARY_FUNCTION(scalar, scalar, erf, trans)
123 UNARY_FUNCTION(scalar, scalar, erfc, trans)
124 UNARY_FUNCTION(scalar, scalar, lgamma, trans)
125 UNARY_FUNCTION(scalar, scalar, j0, trans)
126 UNARY_FUNCTION(scalar, scalar, j1, trans)
127 UNARY_FUNCTION(scalar, scalar, y0, trans)
128 UNARY_FUNCTION(scalar, scalar, y1, trans)
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #define BesselFunc(func) \
134  \
135 template<class GeoMesh, template<class> class PrimitiveField> \
136 tmp<DimensionedField<scalar, GeoMesh, Field>> func \
137 ( \
138  const int n, \
139  const DimensionedField<scalar, GeoMesh, PrimitiveField>& \
140 ); \
141  \
142 template<class GeoMesh> \
143 tmp<DimensionedField<scalar, GeoMesh, Field>> func \
144 ( \
145  const int n, \
146  const tmp<DimensionedField<scalar, GeoMesh, Field>>& \
147 );
148 
151 
152 #undef BesselFunc
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #include "undefFieldFunctionsM.H"
162 
163 #ifdef NoRepository
164  #include "DimensionedScalarField.C"
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
#define BesselFunc(func)
#define BINARY_FUNCTION(func)
#define BINARY_OPERATOR(Template, Type, Type1, Type2, op, opFunc)
#define UNARY_FUNCTION(Template, Type, Type1, func)
#define BINARY_TYPE_OPERATOR_SF(TYPE, op, opFunc)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
void subtract(LagrangianPatchField< typename typeOfSum< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar erfc(const dimensionedScalar &ds)
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar tan(const dimensionedScalar &ds)
void divide(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< scalar > &f2)
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedScalar lgamma(const dimensionedScalar &ds)
dimensionedScalar j1(const dimensionedScalar &ds)
dimensionedScalar y0(const dimensionedScalar &ds)
dimensionedScalar cosh(const dimensionedScalar &ds)
void pow025(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar sin(const dimensionedScalar &ds)
dimensionedScalar tanh(const dimensionedScalar &ds)
dimensionedScalar erf(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
dimensionedScalar log10(const dimensionedScalar &ds)
tmp< DimensionedField< scalar, GeoMesh, Field > > stabilise(const DimensionedField< scalar, GeoMesh, PrimitiveField > &dsf, const dimensioned< scalar > &ds)
void pow4(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
void pow6(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar yn(const int n, const dimensionedScalar &ds)
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionedScalar y1(const dimensionedScalar &ds)
dimensionedScalar negPart(const dimensionedScalar &ds)
dimensionedScalar acosh(const dimensionedScalar &ds)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
void multiply(LagrangianPatchField< Type > &f, const LagrangianPatchField< scalar > &f1, const LagrangianPatchField< Type > &f2)
void pow5(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar jn(const int n, const dimensionedScalar &ds)
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar neg(const dimensionedScalar &ds)
void cbrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar atanh(const dimensionedScalar &ds)
dimensionedScalar neg0(const dimensionedScalar &ds)
void add(LagrangianPatchField< typename typeOfSum< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
dimensionedScalar atan(const dimensionedScalar &ds)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionSet trans(const dimensionSet &)
Definition: dimensionSet.C:474
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
dimensionedScalar j0(const dimensionedScalar &ds)
dimensionedScalar asinh(const dimensionedScalar &ds)