initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / primitives / Scalar / doubleScalar / doubleScalar.H
blobff4db3393b4b5b02af1dd2fac68abb3838af3172
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Typedef
26     Foam::doubleScalar
28 Description
29     Double precision floating point scalar type.
31 SourceFiles
32     doubleScalar.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef doubleScalar_H
37 #define doubleScalar_H
39 #include "doubleFloat.H"
40 #include "direction.H"
41 #include "word.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 typedef double doubleScalar;
52 // Largest and smallest scalar values allowed in certain parts of the code.
53 // (15 is the number of significant figures in an
54 //  IEEE double precision number.  See limits.h or float.h)
55 static const doubleScalar doubleScalarGREAT = 1.0e+15;
56 static const doubleScalar doubleScalarVGREAT = 1.0e+300;
57 static const doubleScalar doubleScalarROOTVGREAT = 1.0e+150;
58 static const doubleScalar doubleScalarSMALL = 1.0e-15;
59 static const doubleScalar doubleScalarVSMALL = 1.0e-300;
60 static const doubleScalar doubleScalarROOTVSMALL = 1.0e-150;
63 #define Scalar doubleScalar
64 #define ScalarVGREAT doubleScalarVGREAT
65 #define ScalarVSMALL doubleScalarVSMALL
66 #define readScalar readDoubleScalar
68 inline Scalar mag(const Scalar s)
70     return ::fabs(s);
73 #define transFunc(func)            \
74 inline Scalar func(const Scalar s) \
75 {                                  \
76     return ::func(s);              \
79 #include "Scalar.H"
81 inline Scalar hypot(const Scalar x, const Scalar y)
83     return ::hypot(x, y);
86 inline Scalar atan2(const Scalar y, const Scalar x)
88     return ::atan2(y, x);
91 inline Scalar jn(const int n, const Scalar s)
93     return ::jn(n, s);
96 inline Scalar yn(const int n, const Scalar s)
98     return ::yn(n, s);
101 #undef Scalar
102 #undef ScalarVGREAT
103 #undef ScalarVSMALL
104 #undef readScalar
105 #undef transFunc
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 } // End namespace Foam
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 #endif
116 // ************************************************************************* //