FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

doubleFloat.H

Go to the documentation of this file.
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 \*---------------------------------------------------------------------------*/
00025 
00026 #ifndef doubleFloat_H
00027 #define doubleFloat_H
00028 
00029 #include <OpenFOAM/label.H>
00030 #include <OpenFOAM/products.H>
00031 
00032 #include <cmath>
00033 
00034 #ifdef darwin
00035 #ifndef DUMMY_SCALAR_FUNCTIONS
00036 #define DUMMY_SCALAR_FUNCTIONS
00037 inline float j0f(float x) { return float(j0(double(x)));}
00038 inline float j1f(float x) { return float(j1(double(x)));}
00039 inline float y0f(float x) { return float(y0(double(x)));}
00040 inline float y1f(float x) { return float(y1(double(x)));}
00041 inline float jnf(const int n, const float s) { return float(jn(n, double(s))); }
00042 inline float ynf(const int n, const float s) { return float(yn(n, double(s))); }
00043 #endif
00044 #endif
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00052 
00053 template<class Cmpt>
00054 class typeOfRank<Cmpt, 0>
00055 {
00056 public:
00057 
00058     typedef Cmpt type;
00059 };
00060 
00061 
00062 template<class Cmpt>
00063 class symmTypeOfRank<Cmpt, 0>
00064 {
00065 public:
00066 
00067     typedef Cmpt type;
00068 };
00069 
00070 
00071 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00072 
00073 template<class T>
00074 inline bool equal(const T& s1, const T& s2)
00075 {
00076     return s1 == s2;
00077 }
00078 
00079 
00080 #define MAXMINPOW(retType, type1, type2)          \
00081                                                   \
00082 MAXMIN(retType, type1, type2)                     \
00083                                                   \
00084 inline double pow(const type1 s, const type2 e)   \
00085 {                                                 \
00086     return ::pow(double(s), double(e));           \
00087 }
00088 
00089 
00090 MAXMINPOW(double, double, double)
00091 MAXMINPOW(double, double, float)
00092 MAXMINPOW(double, float, double)
00093 MAXMINPOW(float, float, float)
00094 MAXMINPOW(double, double, int)
00095 MAXMINPOW(double, int, double)
00096 MAXMINPOW(double, double, long)
00097 MAXMINPOW(double, long, double)
00098 MAXMINPOW(float, float, int)
00099 MAXMINPOW(float, int, float)
00100 MAXMINPOW(float, float, long)
00101 MAXMINPOW(float, long, float)
00102 
00103 #undef MAXMINPOW
00104 
00105 
00106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00107 
00108 } // End namespace Foam
00109 
00110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00111 
00112 #endif
00113 
00114 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines