Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

REAL.H

Go to the documentation of this file.
00001 #ifdef CH_LANG_CC
00002 /*   _______              __
00003     / ___/ /  ___  __ _  / /  ___
00004    / /__/ _ \/ _ \/  V \/ _ \/ _ \
00005    \___/_//_/\___/_/_/_/_.__/\___/
00006 */
00007 // CHOMBO Copyright (c) 2000-2004, The Regents of the University of
00008 // California, through Lawrence Berkeley National Laboratory (subject to
00009 // receipt of any required approvals from U.S. Dept. of Energy).  All
00010 // rights reserved.
00011 //
00012 // Redistribution and use in source and binary forms, with or without
00013 // modification, are permitted provided that the following conditions are met:
00014 //
00015 // (1) Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 // (2) Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 // (3) Neither the name of Lawrence Berkeley National Laboratory, U.S.
00021 // Dept. of Energy nor the names of its contributors may be used to endorse
00022 // or promote products derived from this software without specific prior
00023 // written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00026 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00027 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00028 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00029 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // You are under no obligation whatsoever to provide any bug fixes,
00038 // patches, or upgrades to the features, functionality or performance of
00039 // the source code ("Enhancements") to anyone; however, if you choose to
00040 // make your Enhancements available either publicly, or directly to
00041 // Lawrence Berkeley National Laboratory, without imposing a separate
00042 // written license agreement for such Enhancements, then you hereby grant
00043 // the following license: a non-exclusive, royalty-free perpetual license
00044 // to install, use, modify, prepare derivative works, incorporate into
00045 // other computer software, distribute, and sublicense such Enhancements or
00046 // derivative works thereof, in binary and source code form.
00047 //
00048 // TRADEMARKS. Product and company names mentioned herein may be the
00049 // trademarks of their respective owners.  Any rights not expressly granted
00050 // herein are reserved.
00051 //
00052 #endif
00053 
00054 #ifndef _REAL_H_
00055 #define _REAL_H_
00056 
00057 #ifdef CH_USE_FLOAT /* precision */
00058 #  undef  CH_USE_DOUBLE
00059 #  undef  CH_USE_FLOAT
00060 #  define CH_USE_FLOAT  1
00061 #else   /* precision */
00062 #  undef  CH_USE_FLOAT
00063 #  undef  CH_USE_DOUBLE
00064 #  define CH_USE_DOUBLE 1
00065 #endif  /* precision */
00066 
00067 #if !defined(CH_LANG_FORT) /* language */
00068 #  ifdef CH_USE_FLOAT /* precision */
00069      typedef float Real;
00070 #    define MPI_CH_REAL         MPI_FLOAT
00071 #    define H5T_NATIVE_REAL     H5T_NATIVE_FLOAT
00072 #    define BASEFAB_REAL_SETVAL 1.23456789e+30
00073 #  else   /* precision */
00074      typedef double Real;
00075 #    define MPI_CH_REAL         MPI_DOUBLE
00076 #    define H5T_NATIVE_REAL     H5T_NATIVE_DOUBLE
00077 #    define BASEFAB_REAL_SETVAL 1.23456789e+300
00078 #  endif  /* precision */
00079 
00080 #else /* language */
00081 
00082 #  ifdef CH_USE_FLOAT /* precision */
00083 #    define REAL_T REAL
00084 #    define COMPLEX_T COMPLEX
00085 #  else /* precision */
00086 #    if defined(CH_CRAY)
00087 #      define REAL_T REAL
00088 #      define COMPLEX_T COMPLEX
00089 #    else /*cray */
00090 #      define REAL_T REAL*8
00091 #      define COMPLEX_T COMPLEX*16
00092 #    endif /*cray*/
00093 #  endif /* precision */
00094 
00095 #endif /* language */
00096 
00097 #if defined(CH_LANG_FORT)
00098 #  define Real_T REAL_T
00099 #  define Real_t REAL_T
00100 #  define real_t REAL_T
00101 #  define Complex_T COMPLEX_T
00102 #  define complex_T COMPLEX_T
00103 #  define complex_t COMPLEX_T
00104 #endif
00105 
00106 #if !defined(CH_USE_FLOAT) && !defined(CH_USE_DOUBLE)
00107 #error Exactly one of CH_USE_FLOAT or CH_USE_DOUBLE must be defined
00108 #endif
00109 
00110 #endif

Generated on Wed Oct 5 13:52:09 2005 for Chombo&AMRSelfGravity by  doxygen 1.4.1