DimensionedScalarField.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-------------------------------------------------------------------------------
10License
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
26InClass
27 Foam::DimensionedScalarField
28
29Description
30 Scalar specific part of the implementation of DimensionedField.
31
32SourceFiles
33 DimensionedScalarField.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef DimensionedScalarField_H
38#define DimensionedScalarField_H
39
40#include "DimensionedField.H"
41#include "scalar.H"
42
43#define TEMPLATE template<class GeoMesh>
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53template<class GeoMesh>
54tmp<DimensionedField<scalar, GeoMesh>> stabilise
55(
56 const DimensionedField<scalar, GeoMesh>&,
57 const dimensioned<scalar>&
58);
59
60template<class GeoMesh>
61tmp<DimensionedField<scalar, GeoMesh>> stabilise
62(
63 const tmp<DimensionedField<scalar, GeoMesh>>&,
64 const dimensioned<scalar>&
65);
66
67
68// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69
70BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, '+', add)
71BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, '-', subtract)
72
73BINARY_OPERATOR(scalar, scalar, scalar, *, '*', multiply)
74BINARY_OPERATOR(scalar, scalar, scalar, /, '|', divide)
75
76BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide)
77
78BINARY_FUNCTION(scalar, scalar, scalar, pow)
79BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
80
81BINARY_FUNCTION(scalar, scalar, scalar, atan2)
82BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
83
84
85// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86
87UNARY_FUNCTION(scalar, scalar, pow3, pow3)
88UNARY_FUNCTION(scalar, scalar, pow4, pow4)
89UNARY_FUNCTION(scalar, scalar, pow5, pow5)
90UNARY_FUNCTION(scalar, scalar, pow6, pow6)
91UNARY_FUNCTION(scalar, scalar, pow025, pow025)
92UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
93UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
94UNARY_FUNCTION(scalar, scalar, sign, sign)
95UNARY_FUNCTION(scalar, scalar, pos, pos)
96UNARY_FUNCTION(scalar, scalar, pos0, pos0)
97UNARY_FUNCTION(scalar, scalar, neg, neg)
98UNARY_FUNCTION(scalar, scalar, neg0, neg0)
99UNARY_FUNCTION(scalar, scalar, posPart, posPart)
100UNARY_FUNCTION(scalar, scalar, negPart, negPart)
101
102UNARY_FUNCTION(scalar, scalar, exp, trans)
103UNARY_FUNCTION(scalar, scalar, log, trans)
104UNARY_FUNCTION(scalar, scalar, log10, trans)
105UNARY_FUNCTION(scalar, scalar, sin, trans)
106UNARY_FUNCTION(scalar, scalar, cos, trans)
107UNARY_FUNCTION(scalar, scalar, tan, trans)
108UNARY_FUNCTION(scalar, scalar, asin, trans)
109UNARY_FUNCTION(scalar, scalar, acos, trans)
110UNARY_FUNCTION(scalar, scalar, atan, trans)
111UNARY_FUNCTION(scalar, scalar, sinh, trans)
112UNARY_FUNCTION(scalar, scalar, cosh, trans)
113UNARY_FUNCTION(scalar, scalar, tanh, trans)
114UNARY_FUNCTION(scalar, scalar, asinh, trans)
115UNARY_FUNCTION(scalar, scalar, acosh, trans)
116UNARY_FUNCTION(scalar, scalar, atanh, trans)
117UNARY_FUNCTION(scalar, scalar, erf, trans)
118UNARY_FUNCTION(scalar, scalar, erfc, trans)
119UNARY_FUNCTION(scalar, scalar, lgamma, trans)
120UNARY_FUNCTION(scalar, scalar, j0, trans)
121UNARY_FUNCTION(scalar, scalar, j1, trans)
122UNARY_FUNCTION(scalar, scalar, y0, trans)
123UNARY_FUNCTION(scalar, scalar, y1, trans)
124
125
126// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127
128#define BesselFunc(func) \
129 \
130template<class GeoMesh> \
131tmp<DimensionedField<scalar, GeoMesh>> func \
132( \
133 const int n, \
134 const DimensionedField<scalar, GeoMesh>& \
135); \
136 \
137template<class GeoMesh> \
138tmp<DimensionedField<scalar, GeoMesh>> func \
139( \
140 const int n, \
141 const tmp<DimensionedField<scalar, GeoMesh>>& \
142);
143
146
147#undef BesselFunc
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152} // End namespace Foam
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156#include "undefFieldFunctionsM.H"
157
158#ifdef NoRepository
159 #include "DimensionedScalarField.C"
160#endif
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164#endif
165
166// ************************************************************************* //
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
#define BesselFunc(func)
Namespace for OpenFOAM.
dimensionedScalar pow6(const dimensionedScalar &ds)
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar pow5(const dimensionedScalar &ds)
dimensionedScalar erfc(const dimensionedScalar &ds)
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar tan(const dimensionedScalar &ds)
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedScalar lgamma(const dimensionedScalar &ds)
dimensionedScalar j1(const dimensionedScalar &ds)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar y0(const dimensionedScalar &ds)
dimensionedScalar cosh(const dimensionedScalar &ds)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
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)
dimensionedScalar yn(const int n, const dimensionedScalar &ds)
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionedScalar y1(const dimensionedScalar &ds)
dimensionedScalar negPart(const dimensionedScalar &ds)
dimensionedScalar acosh(const dimensionedScalar &ds)
dimensionedScalar sqrt(const dimensionedScalar &ds)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensionedScalar jn(const int n, const dimensionedScalar &ds)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionSet trans(const dimensionSet &ds)
Check the argument is dimensionless (for transcendental functions)
Definition: dimensionSet.C:486
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedScalar atanh(const dimensionedScalar &ds)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionedScalar neg0(const dimensionedScalar &ds)
dimensionedScalar cbrt(const dimensionedScalar &ds)
dimensionedScalar atan(const dimensionedScalar &ds)
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
dimensionedScalar j0(const dimensionedScalar &ds)
dimensionedScalar pow025(const dimensionedScalar &ds)
dimensionedScalar asinh(const dimensionedScalar &ds)