GeometricScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 InClass
27  Foam::GeometricScalarField
28 
29 Description
30  Scalar specific part of the implementation of GeometricField.
31 
32 SourceFiles
33  GeometricScalarField.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef GeometricScalarField_H
38 #define GeometricScalarField_H
39 
40 #include "GeometricField.H"
41 #include "DimensionedScalarField.H"
42 
43 #define TEMPLATE template<template<class> class PatchField, class GeoMesh>
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 template<template<class> class PatchField, class GeoMesh>
54 void stabilise
55 (
56  GeometricField<scalar, PatchField, GeoMesh>&,
57  const GeometricField<scalar, PatchField, GeoMesh>&,
58  const dimensioned<scalar>&
59 );
60 
61 template<template<class> class PatchField, class GeoMesh>
62 tmp<GeometricField<scalar, PatchField, GeoMesh>> stabilise
63 (
64  const GeometricField<scalar, PatchField, GeoMesh>&,
65  const dimensioned<scalar>&
66 );
67 
68 template<template<class> class PatchField, class GeoMesh>
69 tmp<GeometricField<scalar, PatchField, GeoMesh>> stabilise
70 (
71  const tmp<GeometricField<scalar, PatchField, GeoMesh>>&,
72  const dimensioned<scalar>&
73 );
74 
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, '+', add)
79 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, '-', subtract)
80 
81 BINARY_OPERATOR(scalar, scalar, scalar, *, '*', multiply)
82 BINARY_OPERATOR(scalar, scalar, scalar, /, '|', divide)
83 
84 BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
85 
86 BINARY_FUNCTION(scalar, scalar, scalar, pow)
87 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
88 
89 BINARY_FUNCTION(scalar, scalar, scalar, atan2)
90 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
91 
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 UNARY_FUNCTION(scalar, scalar, pow3, pow3)
96 UNARY_FUNCTION(scalar, scalar, pow4, pow4)
97 UNARY_FUNCTION(scalar, scalar, pow5, pow5)
98 UNARY_FUNCTION(scalar, scalar, pow6, pow6)
99 UNARY_FUNCTION(scalar, scalar, pow025, pow025)
100 UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
101 UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
102 UNARY_FUNCTION(scalar, scalar, sign, sign)
103 UNARY_FUNCTION(scalar, scalar, pos, pos)
104 UNARY_FUNCTION(scalar, scalar, pos0, pos0)
105 UNARY_FUNCTION(scalar, scalar, neg, neg)
106 UNARY_FUNCTION(scalar, scalar, neg0, neg0)
107 UNARY_FUNCTION(scalar, scalar, posPart, posPart)
108 UNARY_FUNCTION(scalar, scalar, negPart, negPart)
109 
110 UNARY_FUNCTION(scalar, scalar, exp, trans)
111 UNARY_FUNCTION(scalar, scalar, log, trans)
112 UNARY_FUNCTION(scalar, scalar, log10, trans)
113 UNARY_FUNCTION(scalar, scalar, sin, trans)
114 UNARY_FUNCTION(scalar, scalar, cos, trans)
115 UNARY_FUNCTION(scalar, scalar, tan, trans)
116 UNARY_FUNCTION(scalar, scalar, asin, trans)
117 UNARY_FUNCTION(scalar, scalar, acos, trans)
118 UNARY_FUNCTION(scalar, scalar, atan, trans)
119 UNARY_FUNCTION(scalar, scalar, sinh, trans)
120 UNARY_FUNCTION(scalar, scalar, cosh, trans)
121 UNARY_FUNCTION(scalar, scalar, tanh, trans)
122 UNARY_FUNCTION(scalar, scalar, asinh, trans)
123 UNARY_FUNCTION(scalar, scalar, acosh, trans)
124 UNARY_FUNCTION(scalar, scalar, atanh, trans)
125 UNARY_FUNCTION(scalar, scalar, erf, trans)
126 UNARY_FUNCTION(scalar, scalar, erfc, trans)
127 UNARY_FUNCTION(scalar, scalar, lgamma, trans)
128 UNARY_FUNCTION(scalar, scalar, j0, trans)
129 UNARY_FUNCTION(scalar, scalar, j1, trans)
130 UNARY_FUNCTION(scalar, scalar, y0, trans)
131 UNARY_FUNCTION(scalar, scalar, y1, trans)
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #define BesselFunc(func) \
137  \
138 template<template<class> class PatchField, class GeoMesh> \
139 void func \
140 ( \
141  GeometricField<scalar, PatchField, GeoMesh>& Res, \
142  const int n, \
143  const GeometricField<scalar, PatchField, GeoMesh>& sf \
144 ); \
145  \
146 template<template<class> class PatchField, class GeoMesh> \
147 tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
148 ( \
149  const int n, \
150  const GeometricField<scalar, PatchField, GeoMesh>& \
151 ); \
152  \
153 template<template<class> class PatchField, class GeoMesh> \
154 tmp<GeometricField<scalar, PatchField, GeoMesh>> func \
155 ( \
156  const int n, \
157  const tmp<GeometricField<scalar, PatchField, GeoMesh>>& \
158 );
159 
160 BesselFunc(jn)
161 BesselFunc(yn)
162 
163 #undef BesselFunc
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #include "undefFieldFunctionsM.H"
173 
174 #ifdef NoRepository
175  #include "GeometricScalarField.C"
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
BINARY_TYPE_OPERATOR_SF
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:522
BINARY_OPERATOR
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:412
Foam::trans
dimensionSet trans(const dimensionSet &ds)
Check the argument is dimensionless (for transcendental functions)
Definition: dimensionSet.C:486
Foam::subtract
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:940
Foam::tan
dimensionedScalar tan(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:266
UNARY_FUNCTION
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
Definition: DimensionedFieldFunctionsM.C:33
Foam::cosh
dimensionedScalar cosh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:271
Foam::y1
dimensionedScalar y1(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:282
Foam::sin
dimensionedScalar sin(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:264
Foam::jn
dimensionedScalar jn(const int n, const dimensionedScalar &ds)
Definition: dimensionedScalar.C:305
Foam::posPart
dimensionedScalar posPart(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:221
Foam::atan2
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
Definition: dimensionedScalar.C:312
Foam::neg0
dimensionedScalar neg0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:210
BINARY_TYPE_OPERATOR
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:674
undefFieldFunctionsM.H
Foam::pos0
dimensionedScalar pos0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:188
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
BINARY_FUNCTION
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
Definition: DimensionedFieldFunctionsM.C:141
Foam::sign
dimensionedScalar sign(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:166
Foam::erf
dimensionedScalar erf(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:276
Foam::divide
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Foam::pow025
dimensionedScalar pow025(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:133
Foam::atanh
dimensionedScalar atanh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:275
DimensionedScalarField.H
Scalar specific part of the implementation of DimensionedField.
GeometricFieldFunctionsM.H
Foam::lgamma
dimensionedScalar lgamma(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:278
Foam::pow4
dimensionedScalar pow4(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:100
Foam::pow6
dimensionedScalar pow6(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:122
Foam::tanh
dimensionedScalar tanh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:272
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:89
Foam::stabilise
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
Definition: DimensionedScalarField.C:43
Foam::log10
dimensionedScalar log10(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:263
Foam::y0
dimensionedScalar y0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:281
Foam::erfc
dimensionedScalar erfc(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:277
Foam::asinh
dimensionedScalar asinh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:273
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
Foam::pow5
dimensionedScalar pow5(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:111
Foam::log
dimensionedScalar log(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:262
GeometricScalarField.C
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
BINARY_TYPE_FUNCTION
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
Definition: DimensionedFieldFunctionsM.C:405
GeometricField.H
Foam::yn
dimensionedScalar yn(const int n, const dimensionedScalar &ds)
Definition: dimensionedScalar.C:306
Foam::acosh
dimensionedScalar acosh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:274
Foam::negPart
dimensionedScalar negPart(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:232
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::j0
dimensionedScalar j0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:279
Foam::acos
dimensionedScalar acos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:268
Foam::atan
dimensionedScalar atan(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:269
BesselFunc
#define BesselFunc(func)
Definition: GeometricScalarField.H:136
Foam::multiply
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::j1
dimensionedScalar j1(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:280
Foam::neg
dimensionedScalar neg(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:199
Foam::asin
dimensionedScalar asin(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:267
Foam::cos
dimensionedScalar cos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:265
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177
Foam::sinh
dimensionedScalar sinh(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:270