1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 Specialisation of Field\<T\> for scalar.
33 \*---------------------------------------------------------------------------*/
42 #include "FieldFunctionsM.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 typedef Field<scalar> scalarField;
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 tmp<scalarField> scalarField::component(const direction) const;
59 const UList<scalar>& f,
64 void scalarField::replace(const direction, const UList<scalar>& sf);
67 void scalarField::replace(const direction, const scalar& s);
70 void stabilise(scalarField& Res, const UList<scalar>& sf, const scalar s);
71 tmp<scalarField> stabilise(const UList<scalar>&, const scalar s);
72 tmp<scalarField> stabilise(const tmp<scalarField>&, const scalar s);
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, add)
78 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, subtract)
80 BINARY_OPERATOR(scalar, scalar, scalar, *, multiply)
81 BINARY_OPERATOR(scalar, scalar, scalar, /, divide)
83 BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, divide)
85 BINARY_FUNCTION(scalar, scalar, scalar, pow)
86 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
88 BINARY_FUNCTION(scalar, scalar, scalar, atan2)
89 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 UNARY_FUNCTION(scalar, scalar, pow3)
95 UNARY_FUNCTION(scalar, scalar, pow4)
96 UNARY_FUNCTION(scalar, scalar, pow5)
97 UNARY_FUNCTION(scalar, scalar, pow6)
98 UNARY_FUNCTION(scalar, scalar, pow025)
99 UNARY_FUNCTION(scalar, scalar, sqrt)
100 UNARY_FUNCTION(scalar, scalar, sign)
101 UNARY_FUNCTION(scalar, scalar, pos)
102 UNARY_FUNCTION(scalar, scalar, neg)
103 UNARY_FUNCTION(scalar, scalar, exp)
104 UNARY_FUNCTION(scalar, scalar, log)
105 UNARY_FUNCTION(scalar, scalar, log10)
106 UNARY_FUNCTION(scalar, scalar, sin)
107 UNARY_FUNCTION(scalar, scalar, cos)
108 UNARY_FUNCTION(scalar, scalar, tan)
109 UNARY_FUNCTION(scalar, scalar, asin)
110 UNARY_FUNCTION(scalar, scalar, acos)
111 UNARY_FUNCTION(scalar, scalar, atan)
112 UNARY_FUNCTION(scalar, scalar, sinh)
113 UNARY_FUNCTION(scalar, scalar, cosh)
114 UNARY_FUNCTION(scalar, scalar, tanh)
115 UNARY_FUNCTION(scalar, scalar, asinh)
116 UNARY_FUNCTION(scalar, scalar, acosh)
117 UNARY_FUNCTION(scalar, scalar, atanh)
118 UNARY_FUNCTION(scalar, scalar, erf)
119 UNARY_FUNCTION(scalar, scalar, erfc)
120 UNARY_FUNCTION(scalar, scalar, lgamma)
121 UNARY_FUNCTION(scalar, scalar, j0)
122 UNARY_FUNCTION(scalar, scalar, j1)
123 UNARY_FUNCTION(scalar, scalar, y0)
124 UNARY_FUNCTION(scalar, scalar, y1)
127 #define BesselFunc(func) \
128 void func(scalarField& Res, const int n, const UList<scalar>& sf); \
129 tmp<scalarField> func(const int n, const UList<scalar>&); \
130 tmp<scalarField> func(const int n, const tmp<scalarField>&);
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 #include "undefFieldFunctionsM.H"
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 // ************************************************************************* //