FreeFOAM The Cross-Platform CFD Toolkit
scalarField.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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 Typedef
25  Foam::scalarField
26 
27 Description
28  Specialisation of Field<T> for scalar.
29 
30 SourceFiles
31  scalarField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef scalarField_H
36 #define scalarField_H
37 
38 #include <OpenFOAM/Field.H>
39 #include <OpenFOAM/scalar.H>
40 
41 #define TEMPLATE
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 typedef Field<scalar> scalarField;
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 template<>
54 tmp<scalarField> scalarField::component(const direction) const;
55 
56 void component
57 (
58  scalarField& sf,
59  const UList<scalar>& f,
60  const direction
61 );
62 
63 template<>
64 void scalarField::replace(const direction, const UList<scalar>& sf);
65 
66 template<>
67 void scalarField::replace(const direction, const scalar& s);
68 
69 
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);
73 
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, +, add)
78 BINARY_TYPE_OPERATOR(scalar, scalar, scalar, -, subtract)
79 
80 BINARY_OPERATOR(scalar, scalar, scalar, *, multiply)
81 BINARY_OPERATOR(scalar, scalar, scalar, /, divide)
82 
83 BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, divide)
84 
85 BINARY_FUNCTION(scalar, scalar, scalar, pow)
86 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow)
87 
88 BINARY_FUNCTION(scalar, scalar, scalar, atan2)
89 BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2)
90 
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
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, sqrt)
99 UNARY_FUNCTION(scalar, scalar, sign)
100 UNARY_FUNCTION(scalar, scalar, pos)
101 UNARY_FUNCTION(scalar, scalar, neg)
102 UNARY_FUNCTION(scalar, scalar, exp)
103 UNARY_FUNCTION(scalar, scalar, log)
104 UNARY_FUNCTION(scalar, scalar, log10)
105 UNARY_FUNCTION(scalar, scalar, sin)
106 UNARY_FUNCTION(scalar, scalar, cos)
107 UNARY_FUNCTION(scalar, scalar, tan)
108 UNARY_FUNCTION(scalar, scalar, asin)
109 UNARY_FUNCTION(scalar, scalar, acos)
110 UNARY_FUNCTION(scalar, scalar, atan)
111 UNARY_FUNCTION(scalar, scalar, sinh)
112 UNARY_FUNCTION(scalar, scalar, cosh)
113 UNARY_FUNCTION(scalar, scalar, tanh)
114 UNARY_FUNCTION(scalar, scalar, asinh)
115 UNARY_FUNCTION(scalar, scalar, acosh)
116 UNARY_FUNCTION(scalar, scalar, atanh)
117 UNARY_FUNCTION(scalar, scalar, erf)
118 UNARY_FUNCTION(scalar, scalar, erfc)
119 UNARY_FUNCTION(scalar, scalar, lgamma)
120 UNARY_FUNCTION(scalar, scalar, j0)
121 UNARY_FUNCTION(scalar, scalar, j1)
122 UNARY_FUNCTION(scalar, scalar, y0)
123 UNARY_FUNCTION(scalar, scalar, y1)
124 
126 #define BesselFunc(func) \
127 void func(scalarField& Res, const int n, const UList<scalar>& sf); \
128 tmp<scalarField> func(const int n, const UList<scalar>&); \
129 tmp<scalarField> func(const int n, const tmp<scalarField>&);
130 
131 BesselFunc(jn)
132 BesselFunc(yn)
133 
134 #undef BesselFunc
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************ vim: set sw=4 sts=4 et: ************************ //