00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012 #ifndef _SPACE_H_
00013 #define _SPACE_H_
00014
00015 #ifdef HAVE_CONFIG_H
00016 #include <autoconfig.H>
00017 #endif
00018
00019 #ifdef CH_LANG_CC
00020 # include "MayDay.H"
00021 #endif
00022
00023 # include "CH_assert.H"
00024
00025 #include "NamespaceHeader.H"
00026
00027 #if !defined(CH_LANG_FORT) || defined(CH_LANG_CC)
00028
00039 const int SpaceDim = CH_SPACEDIM;
00040 #endif
00041
00042 #ifdef DOXYGEN
00043
00050 #define CH_SPACEDIM
00051 #undef CH_SPACEDIM
00052 #define CH_SPACEDIM 3
00053 #endif
00054
00055 #if ! defined(CH_SPACEDIM)
00056 #error CH_SPACEDIM must be defined
00057 #endif
00058
00059 #if (CH_SPACEDIM < 1 || CH_SPACEDIM > 6)
00060 #error CH_SPACEDIM must be either 1, 2, 3, 4, 5, or 6
00061 #endif
00062
00063 #ifdef DOXYGEN
00064 #undef CH_SPACEDIM
00065 #endif
00066
00067 #include "NamespaceFooter.H"
00068
00069 #endif
00070 #ifdef CH_LANG_CC
00071
00072
00073
00074
00075 #endif
00076
00077 #ifndef LAST_SPACE_H_SPACEDIM
00078 #define LAST_SPACE_H_SPACEDIM 0
00079 #endif
00080
00081 #if CH_SPACEDIM != LAST_SPACE_H_SPACEDIM
00082 #undef LAST_SPACE_H_SPACEDIM
00083
00084
00085 #ifdef D_EXPR6
00086 #undef D_EXPR
00087 #undef D_DECL
00088 #undef D_TERM
00089 #undef D_EXPR6
00090 #undef D_DECL6
00091 #undef D_TERM6
00092 #endif
00093
00094 #if CH_SPACEDIM==1
00095 # define D_EXPR(a,b,c) ((void)((a),0))
00096 # define D_DECL(a,b,c) a
00097 # define D_TERM(a,b,c) a
00098 # define D_EXPR6(a,b,c,d,e,f) ((void)((a),0))
00099 # define D_DECL6(a,b,c,d,e,f) a
00100 # define D_TERM6(a,b,c,d,e,f) a
00101 # define LAST_SPACE_H_SPACEDIM 1
00102
00103
00104 #elif CH_SPACEDIM==2
00105 # define D_EXPR(a,b,c) ((void)((a),(b),0))
00106 # define D_DECL(a,b,c) a,b
00107 # define D_TERM(a,b,c) a b
00108 # define D_EXPR6(a,b,c,d,e,f) ((void)((a),(b),0))
00109 # define D_DECL6(a,b,c,d,e,f) a,b
00110 # define D_TERM6(a,b,c,d,e,f) a b
00111 # define LAST_SPACE_H_SPACEDIM 2
00112
00113 #elif CH_SPACEDIM==3
00114 #ifdef DOXYGEN
00115
00140 #endif
00141 # define D_EXPR(a,b,c) ((void)((a),(b),(c),0))
00142 # define D_EXPR6(a,b,c,d,e,f) ((void)((a),(b),(c),0))
00143
00144 #ifdef DOXYGEN
00145
00168 #endif
00169 # define D_DECL(a,b,c) a,b,c
00170 # define D_DECL6(a,b,c,d,e,f) a,b,c
00171
00172 #ifdef DOXYGEN
00173
00191 #endif
00192 # define D_TERM(a,b,c) a b c
00193 # define D_TERM6(a,b,c,d,e,f) a b c
00194 # define LAST_SPACE_H_SPACEDIM 3
00195
00196 #ifdef DOXYGEN
00197
00200 #endif
00201 #elif CH_SPACEDIM==4
00202 # define D_EXPR6(a,b,c,d,e,f) ((void)((a),(b),(c),(d),0))
00203 # define D_DECL6(a,b,c,d,e,f) a,b,c,d
00204 # define D_TERM6(a,b,c,d,e,f) a b c d
00205 # define LAST_SPACE_H_SPACEDIM 4
00206
00207 #elif CH_SPACEDIM==5
00208 # define D_EXPR6(a,b,c,d,e,f) ((void)((a),(b),(c),(d),(e),0))
00209 # define D_DECL6(a,b,c,d,e,f) a,b,c,d,e
00210 # define D_TERM6(a,b,c,d,e,f) a b c d e
00211 # define LAST_SPACE_H_SPACEDIM 5
00212
00213 #elif CH_SPACEDIM==6
00214 # define D_EXPR6(a,b,c,d,e,f) ((void)((a),(b),(c),(d),(e),(f),0))
00215 # define D_DECL6(a,b,c,d,e,f) a,b,c,d,e,f
00216 # define D_TERM6(a,b,c,d,e,f) a b c d e f
00217 # define LAST_SPACE_H_SPACEDIM 6
00218
00219
00220 #else // matches elif CH_SPACEDIM==3
00221
00222 # define LAST_SPACE_H_SPACEDIM CH_SPACEDIM
00223 #endif
00224 #endif // matches CH_SPACEDIM != LAST_SPACE_H_SPACEDIM