GeometricScalarField.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-2024 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::GeometricScalarField
26 
27 Description
28  Scalar specific part of the implementation of GeometricField.
29 
30 SourceFiles
31  GeometricScalarField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef GeometricScalarField_H
36 #define GeometricScalarField_H
37 
38 #include "GeometricField.H"
39 #include "DimensionedScalarField.H"
40 
41 #define TEMPLATE \
42  template \
43  < \
44  class Type, \
45  class GeoMesh, \
46  template<class> class PrimitiveField \
47  >
48 #define TEMPLATE2 \
49  template \
50  < \
51  class Type, \
52  class GeoMesh, \
53  template<class> class PrimitiveField1, \
54  template<class> class PrimitiveField2 \
55  >
56 #define TEMPLATE3 \
57  template \
58  < \
59  class Type, \
60  class GeoMesh, \
61  template<class> class PrimitiveField1, \
62  template<class> class PrimitiveField2 \
63  template<class> class PrimitiveField3 \
64  >
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
75 void stabilise
76 (
77  GeometricField<scalar, GeoMesh, PrimitiveField1>&,
78  const GeometricField<scalar, GeoMesh, PrimitiveField2>&,
79  const dimensioned<scalar>&
80 );
81 
83 tmp<GeometricField<scalar, GeoMesh, Field>> stabilise
84 (
85  const GeometricField<scalar, GeoMesh, PrimitiveField>&,
86  const dimensioned<scalar>&
87 );
88 
90 tmp<GeometricField<scalar, GeoMesh, Field>> stabilise
91 (
92  const tmp<GeometricField<scalar, GeoMesh, PrimitiveField>>&,
93  const dimensioned<scalar>&
94 );
95 
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, '+', add)
100 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, '-', subtract)
101 
102 BINARY_OPERATOR(scalar, scalar, scalar, *, '*', multiply)
103 BINARY_OPERATOR(scalar, scalar, scalar, /, '|', divide)
104 
105 BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
106 
107 BINARY_FUNCTION(scalar, scalar, scalar, pow)
108 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
109 
110 BINARY_FUNCTION(scalar, scalar, scalar, atan2)
111 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 UNARY_FUNCTION(scalar, scalar, pow3, pow3)
117 UNARY_FUNCTION(scalar, scalar, pow4, pow4)
118 UNARY_FUNCTION(scalar, scalar, pow5, pow5)
119 UNARY_FUNCTION(scalar, scalar, pow6, pow6)
120 UNARY_FUNCTION(scalar, scalar, pow025, pow025)
121 UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
122 UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
123 UNARY_FUNCTION(scalar, scalar, sign, sign)
124 UNARY_FUNCTION(scalar, scalar, pos, pos)
125 UNARY_FUNCTION(scalar, scalar, pos0, pos0)
126 UNARY_FUNCTION(scalar, scalar, neg, neg)
127 UNARY_FUNCTION(scalar, scalar, neg0, neg0)
128 UNARY_FUNCTION(scalar, scalar, posPart, posPart)
129 UNARY_FUNCTION(scalar, scalar, negPart, negPart)
130 
131 UNARY_FUNCTION(scalar, scalar, exp, trans)
132 UNARY_FUNCTION(scalar, scalar, log, trans)
133 UNARY_FUNCTION(scalar, scalar, log10, trans)
134 UNARY_FUNCTION(scalar, scalar, sin, trans)
135 UNARY_FUNCTION(scalar, scalar, cos, trans)
136 UNARY_FUNCTION(scalar, scalar, tan, trans)
137 UNARY_FUNCTION(scalar, scalar, asin, trans)
138 UNARY_FUNCTION(scalar, scalar, acos, trans)
139 UNARY_FUNCTION(scalar, scalar, atan, trans)
140 UNARY_FUNCTION(scalar, scalar, sinh, trans)
141 UNARY_FUNCTION(scalar, scalar, cosh, trans)
142 UNARY_FUNCTION(scalar, scalar, tanh, trans)
143 UNARY_FUNCTION(scalar, scalar, asinh, trans)
144 UNARY_FUNCTION(scalar, scalar, acosh, trans)
145 UNARY_FUNCTION(scalar, scalar, atanh, trans)
146 UNARY_FUNCTION(scalar, scalar, erf, trans)
147 UNARY_FUNCTION(scalar, scalar, erfc, trans)
148 UNARY_FUNCTION(scalar, scalar, lgamma, trans)
149 UNARY_FUNCTION(scalar, scalar, j0, trans)
150 UNARY_FUNCTION(scalar, scalar, j1, trans)
151 UNARY_FUNCTION(scalar, scalar, y0, trans)
152 UNARY_FUNCTION(scalar, scalar, y1, trans)
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #define BesselFunc(func) \
158  \
159 TEMPLATE2 \
160 void func \
161 ( \
162  GeometricField<scalar, GeoMesh, PrimitiveField1>& Res, \
163  const int n, \
164  const GeometricField<scalar, GeoMesh, PrimitiveField2>& sf \
165 ); \
166  \
167 TEMPLATE \
168 tmp<GeometricField<scalar, GeoMesh, Field>> func \
169 ( \
170  const int n, \
171  const GeometricField<scalar, GeoMesh, PrimitiveField>& \
172 ); \
173  \
174 TEMPLATE \
175 tmp<GeometricField<scalar, GeoMesh, Field>> func \
176 ( \
177  const int n, \
178  const tmp<GeometricField<scalar, GeoMesh, PrimitiveField>>& \
179 );
180 
181 BesselFunc(jn)
182 BesselFunc(yn)
183 
184 #undef BesselFunc
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #include "undefFieldFunctionsM.H"
194 
195 #ifdef NoRepository
196  #include "GeometricScalarField.C"
197 #endif
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
Scalar specific part of the implementation of DimensionedField.
#define TEMPLATE2
#define TEMPLATE
#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)
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)