00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Typedef 00025 Foam::doubleScalar 00026 00027 Description 00028 Double precision floating point scalar type. 00029 00030 SourceFiles 00031 doubleScalar.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef doubleScalar_H 00036 #define doubleScalar_H 00037 00038 #include <OpenFOAM/doubleFloat.H> 00039 #include <OpenFOAM/direction.H> 00040 #include <OpenFOAM/word.H> 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00048 00049 typedef double doubleScalar; 00050 00051 // Largest and smallest scalar values allowed in certain parts of the code. 00052 // (15 is the number of significant figures in an 00053 // IEEE double precision number. See limits.h or float.h) 00054 static const doubleScalar doubleScalarGREAT = 1.0e+15; 00055 static const doubleScalar doubleScalarVGREAT = 1.0e+300; 00056 static const doubleScalar doubleScalarROOTVGREAT = 1.0e+150; 00057 static const doubleScalar doubleScalarSMALL = 1.0e-15; 00058 static const doubleScalar doubleScalarVSMALL = 1.0e-300; 00059 static const doubleScalar doubleScalarROOTVSMALL = 1.0e-150; 00060 00061 00062 #define Scalar doubleScalar 00063 #define ScalarVGREAT doubleScalarVGREAT 00064 #define ScalarVSMALL doubleScalarVSMALL 00065 #define readScalar readDoubleScalar 00066 00067 inline Scalar mag(const Scalar s) 00068 { 00069 return ::fabs(s); 00070 } 00071 00072 #define transFunc(func) \ 00073 inline Scalar func(const Scalar s) \ 00074 { \ 00075 return ::func(s); \ 00076 } 00077 00078 #include <OpenFOAM/Scalar_.H> 00079 00080 inline Scalar hypot(const Scalar x, const Scalar y) 00081 { 00082 return ::hypot(x, y); 00083 } 00084 00085 inline Scalar atan2(const Scalar y, const Scalar x) 00086 { 00087 return ::atan2(y, x); 00088 } 00089 00090 inline Scalar jn(const int n, const Scalar s) 00091 { 00092 return ::jn(n, s); 00093 } 00094 00095 inline Scalar yn(const int n, const Scalar s) 00096 { 00097 return ::yn(n, s); 00098 } 00099 00100 #undef Scalar 00101 #undef ScalarVGREAT 00102 #undef ScalarVSMALL 00103 #undef readScalar 00104 #undef transFunc 00105 00106 00107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00108 00109 } // End namespace Foam 00110 00111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00112 00113 #endif 00114 00115 // ************************ vim: set sw=4 sts=4 et: ************************ //