Overture  Version 25
OvertureTypes.h
Go to the documentation of this file.
1 #ifndef OVERTURE_TYPES_H
2 #define OVERTURE_TYPES_H
3 
4 // Define various things for Overture
5 
6 #include "OvertureDefine.h"
7 #include <float.h>
8 
9 
10 /* *wdh* for pgi */
11 #ifdef __PGI
12  #include "math.h"
13  /* inline float abs(float x){ return fabs(x); } */
14  #include <cmath>
15 #endif
16 
17 // This next line was needed when compiling mogl.C with P++ version, BadValue appears in
18 // PADRE_Parti_Template.C and some motif or opengl header defines it I think
19 #undef BadValue
20 #include "A++.h"
21 
22 // *wdh* 961005
23 #undef FALSE
24 #define FALSE 0
25 
26 # ifdef LONGINT
27 # define INTEGER_MIN LONG_MIN
28 # define INTEGER_MAX LONG_MAX
29  typedef long int Integer;
30  // typedef longIntSerialArray IntegerArray; // This does not exist, so we
31  typedef intSerialArray IntegerArray; // must use intSerialArray instead.
32  typedef intArray IntegerDistributedArray;
33 # else
34 # define INTEGER_MIN INT_MIN
35 # define INTEGER_MAX INT_MAX
36  typedef int Integer;
37  typedef intSerialArray IntegerArray;
38  typedef intArray IntegerDistributedArray;
39 # endif // LONGINT
40 
41 typedef int Logical; // this must alway match LogicalArray !!
42 
45 
46 typedef IntegerArray LogicalArray; // There is no such thing as a boolArray!
48 typedef Integer LogicalAE; // This might not be the same as Logical.
49 
50 typedef int64_t doubleLengthInt; // this defines a double length int -- currently a 64 bit int
51 
52 
53 # ifdef OV_USE_DOUBLE
54 # ifndef USE_DOUBLE
55 # define USE_DOUBLE
56 # endif // USE_DOUBLE
57 # ifdef USE_FLOAT
58 # undef USE_FLOAT
59 # endif // USE_FLOAT
60 # ifndef _REAL_H_
61  // avoid conflict with boxlib
62  typedef double Real;
63 # endif
64  typedef long double DoubleReal;
65  typedef doubleSerialArray RealArray;
66  // typedef longDoubleSerialArray DoubleRealArray; // This does not exist, so
67  typedef doubleSerialArray DoubleRealArray; // we use doubleSerialArray.
68  typedef doubleSerialArray RealSerialArray;
69  typedef doubleSerialArray realSerialArray;
70  typedef doubleArray RealDistributedArray;
71  typedef doubleArray DoubleRealDistributedArray;
72 
73  #define MPI_Real MPI_DOUBLE
74 
75 // Define "real" versions of the constants in <float.h>
76 # define REAL_RADIX FLT_RADIX
77 # define REAL_ROUNDS FLT_ROUNDS
78 # define REAL_DIG DBL_DIG
79 # define REAL_EPSILON DBL_EPSILON
80 # define REAL_MANT_DIG DBL_MANT_DIG
81 # define REAL_MAX DBL_MAX
82 # define REAL_MAX_EXP DBL_MAX_EXP
83 # define REAL_MIN DBL_MIN
84 # define REAL_MIN_EXP DBL_MIN_EXP
85 
86 # else
87 
88 # ifdef USE_DOUBLE
89 # undef USE_DOUBLE
90 # endif // USE_DOUBLE
91 # ifndef USE_FLOAT
92 # define USE_FLOAT
93 # endif // USE_FLOAT
94 # ifndef _REAL_H_
95  typedef float Real;
96 # endif
97  typedef double DoubleReal;
98  typedef floatSerialArray RealArray;
99  typedef floatSerialArray RealSerialArray;
100  typedef floatSerialArray realSerialArray;
101 
102  typedef doubleSerialArray DoubleRealArray;
103  typedef floatArray RealDistributedArray;
104  typedef doubleArray DoubleRealDistributedArray;
105 
106  #define MPI_Real MPI_FLOAT
107 
108 // Define "real" versions of the constants in <float.h>
109 # define REAL_RADIX FLT_RADIX
110 # define REAL_ROUNDS FLT_ROUNDS
111 # define REAL_DIG FLT_DIG
112 # define REAL_EPSILON FLT_EPSILON
113 # define REAL_MANT_DIG FLT_MANT_DIG
114 # define REAL_MAX FLT_MAX
115 # define REAL_MAX_EXP FLT_MAX_EXP
116 # define REAL_MIN FLT_MIN
117 # define REAL_MIN_EXP FLT_MIN_EXP
118 
119 # endif // DOUBLE
120 
121 typedef Real real;
124 typedef intArray intDistributedArray;
125 typedef floatArray floatDistributedArray;
126 typedef doubleArray doubleDistributedArray;
127 
128 
130 
131 // Constants for A++ array indexing.
132 /* *wdh* 030423 enum { START=0, END=1, X_AXIS=0, Y_AXIS=1, Z_AXIS=2 }; */
133 
134 // Macros used by Boxlib.
135 # undef BL_SPACEDIM
136 # define BL_SPACEDIM 3
137 # undef BL_ARCH_IEEE
138 # define BL_ARCH_IEEE
139 
140 #if ( defined(__alpha) || defined(__sgi) )
141  inline ostream& operator<<(ostream& s, const long double& x)
142  { s << (double)x; return s; }
143 #endif // ( defined(__alpha) || defined(__sgi) )
144 
145 #if !defined(OV_BOOL_DEFINED) && !defined(USE_PPP)
146  typedef int bool; // this will be the new standard for Boolean
147 #endif
148 
149 #ifdef OV_EXCEPTIONS_NOT_SUPPORTED
150  #define throw exit(1); cout <<
151 #endif
152 
153 
154 #endif
155 
156 
157