1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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 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
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
29 Float precision floating point scalar type.
34 \*---------------------------------------------------------------------------*/
39 #include "doubleFloat.H"
40 #include "direction.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 typedef float floatScalar;
52 // Largest and smallest scalar values allowed in certain parts of the code
53 // (6 is the number of significant figures in an
54 // IEEE single precision number. See limits.h or float.h)
55 static const floatScalar floatScalarGREAT = 1.0e+6;
56 static const floatScalar floatScalarVGREAT = 1.0e+37;
57 static const floatScalar floatScalarROOTVGREAT = 1.0e+18;
58 static const floatScalar floatScalarSMALL = 1.0e-6;
59 static const floatScalar floatScalarVSMALL = 1.0e-37;
60 static const floatScalar floatScalarROOTVSMALL = 1.0e-18;
63 #define Scalar floatScalar
64 #define ScalarVSMALL floatScalarVSMALL
65 #define readScalar readFloatScalar
67 inline Scalar mag(const Scalar s)
72 #define transFunc(func) \
73 inline Scalar func(const Scalar s) \
75 return ::func##f(s); \
80 inline Scalar hypot(const Scalar x, const Scalar y)
82 return ::hypotf(x, y);
85 inline Scalar atan2(const Scalar y, const Scalar x)
87 return ::atan2f(y, x);
90 inline Scalar jn(const int n, const Scalar s)
95 inline Scalar yn(const int n, const Scalar s)
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 } // End namespace Foam
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 // ************************************************************************* //