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-2018 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 template<template<class> class PatchField, class GeoMesh>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 template<template<class> class PatchField, class GeoMesh>
52 void stabilise
53 (
54  GeometricField<scalar, PatchField, GeoMesh>&,
55  const GeometricField<scalar, PatchField, GeoMesh>&,
56  const dimensioned<scalar>&
57 );
58 
59 template<template<class> class PatchField, class GeoMesh>
60 tmp<GeometricField<scalar, PatchField, GeoMesh>> stabilise
61 (
62  const GeometricField<scalar, PatchField, GeoMesh>&,
63  const dimensioned<scalar>&
64 );
65 
66 template<template<class> class PatchField, class GeoMesh>
67 tmp<GeometricField<scalar, PatchField, GeoMesh>> stabilise
68 (
69  const tmp<GeometricField<scalar, PatchField, GeoMesh>>&,
70  const dimensioned<scalar>&
71 );
72 
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, '+', add)
77 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, '-', subtract)
78 
79 BINARY_OPERATOR(scalar, scalar, scalar, *, '*', multiply)
80 BINARY_OPERATOR(scalar, scalar, scalar, /, '|', divide)
81 
82 BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
83 
84 BINARY_FUNCTION(scalar, scalar, scalar, pow)
85 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
86 
87 BINARY_FUNCTION(scalar, scalar, scalar, atan2)
88 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
89 
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 UNARY_FUNCTION(scalar, scalar, pow3, pow3)
94 UNARY_FUNCTION(scalar, scalar, pow4, pow4)
95 UNARY_FUNCTION(scalar, scalar, pow5, pow5)
96 UNARY_FUNCTION(scalar, scalar, pow6, pow6)
97 UNARY_FUNCTION(scalar, scalar, pow025, pow025)
98 UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
99 UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
100 UNARY_FUNCTION(scalar, scalar, sign, sign)
101 UNARY_FUNCTION(scalar, scalar, pos, pos)
102 UNARY_FUNCTION(scalar, scalar, pos0, pos0)
103 UNARY_FUNCTION(scalar, scalar, neg, neg)
104 UNARY_FUNCTION(scalar, scalar, neg0, neg0)
105 UNARY_FUNCTION(scalar, scalar, posPart, posPart)
106 UNARY_FUNCTION(scalar, scalar, negPart, negPart)
107 
108 UNARY_FUNCTION(scalar, scalar, exp, trans)
109 UNARY_FUNCTION(scalar, scalar, log, trans)
110 UNARY_FUNCTION(scalar, scalar, log10, trans)
111 UNARY_FUNCTION(scalar, scalar, sin, trans)
112 UNARY_FUNCTION(scalar, scalar, cos, trans)
113 UNARY_FUNCTION(scalar, scalar, tan, trans)
114 UNARY_FUNCTION(scalar, scalar, asin, trans)
115 UNARY_FUNCTION(scalar, scalar, acos, trans)
116 UNARY_FUNCTION(scalar, scalar, atan, trans)
117 UNARY_FUNCTION(scalar, scalar, sinh, trans)
118 UNARY_FUNCTION(scalar, scalar, cosh, trans)
119 UNARY_FUNCTION(scalar, scalar, tanh, trans)
120 UNARY_FUNCTION(scalar, scalar, asinh, trans)
121 UNARY_FUNCTION(scalar, scalar, acosh, trans)
122 UNARY_FUNCTION(scalar, scalar, atanh, trans)
123 UNARY_FUNCTION(scalar, scalar, erf, trans)
124 UNARY_FUNCTION(scalar, scalar, erfc, trans)
125 UNARY_FUNCTION(scalar, scalar, lgamma, trans)
126 UNARY_FUNCTION(scalar, scalar, j0, trans)
127 UNARY_FUNCTION(scalar, scalar, j1, trans)
128 UNARY_FUNCTION(scalar, scalar, y0, trans)
129 UNARY_FUNCTION(scalar, scalar, y1, trans)
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #define BesselFunc(func) \
135  \
136 template<template<class> class PatchField, class GeoMesh> \
137 void func \
138 ( \
139  GeometricField<scalar, PatchField, GeoMesh>& Res, \
140  const int n, \
141  const GeometricField<scalar, PatchField, GeoMesh>& sf \
142 ); \
143  \
144 template<template<class> class PatchField, class GeoMesh> \
145 tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
146 ( \
147  const int n, \
148  const GeometricField<scalar, PatchField, GeoMesh>& \
149 ); \
150  \
151 template<template<class> class PatchField, class GeoMesh> \
152 tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
153 ( \
154  const int n, \
155  const tmp<GeometricField<scalar, PatchField, GeoMesh>>& \
156 );
157 
158 BesselFunc(jn)
159 BesselFunc(yn)
160 
161 #undef BesselFunc
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #include "undefFieldFunctionsM.H"
171 
172 #ifdef NoRepository
173  #include "GeometricScalarField.C"
174 #endif
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
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)
dimensionSet trans(const dimensionSet &)
Definition: dimensionSet.C:456
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)
dimensionedScalar log(const dimensionedScalar &ds)
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 y0(const dimensionedScalar &ds)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
#define BesselFunc(func)
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)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
dimensionedScalar pos(const dimensionedScalar &ds)
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)
UNARY_FUNCTION(Type, Type, cmptMag, cmptMag)
dimensionedScalar lgamma(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
dimensionedScalar erfc(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
dimensionedScalar atan(const dimensionedScalar &ds)
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensionedScalar pow6(const dimensionedScalar &ds)
Scalar specific part of the implementation of DimensionedField.
dimensionedScalar cosh(const dimensionedScalar &ds)
dimensionedScalar tan(const dimensionedScalar &ds)
dimensionedScalar j0(const dimensionedScalar &ds)
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
dimensionedScalar log10(const dimensionedScalar &ds)
Namespace for OpenFOAM.
dimensionedScalar negPart(const dimensionedScalar &ds)