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 _SPACE_H_ 00055 #define _SPACE_H_ 00056 00057 #ifdef CH_LANG_CC 00058 00062 # include "MayDay.H" 00063 # ifndef NDEBUG 00064 # define CH_assert_str(s) # s 00065 # define CH_assert_xstr(s) CH_assert_str(s) 00066 # define CH_assert(cond) if(!(cond)){ MayDay::Abort( __FILE__ ":" CH_assert_xstr(__LINE__) ": Assertion `" #cond "' failed."); } 00067 # else 00068 # define CH_assert(cond) (void)0 00069 #endif 00070 #endif //CH_LANG_CC 00071 00072 #ifdef CH_LANG_FORT 00073 #ifndef NDEBUG 00074 # define CH_assert(cond) if(.NOT. cond) call MAYDAYERROR() 00075 #else 00076 # define CH_assert(cond) 00077 #endif 00078 #endif //CH_LANG_FORT 00079 00080 #ifdef DOXYGEN 00081 00088 #define CH_SPACEDIM 00089 #undef CH_SPACEDIM 00090 #define CH_SPACEDIM 3 00091 #endif 00092 00093 #if ! defined(CH_SPACEDIM) 00094 #error CH_SPACEDIM must be defined 00095 #endif 00096 00097 #if (CH_SPACEDIM != 1 && CH_SPACEDIM !=2 && CH_SPACEDIM != 3) 00098 #error CH_SPACEDIM must be either 1, 2, or 3 00099 #endif 00100 00101 #if !defined(CH_LANG_FORT) || defined(CH_LANG_CC) 00102 00113 const int SpaceDim = CH_SPACEDIM; 00114 #endif 00115 00116 #if CH_SPACEDIM==1 00117 00118 # define D_EXPR(a,b,c) ((void)((a),0)) 00119 00120 # define D_DECL(a,b,c) a 00121 00122 # define D_TERM(a,b,c) a 00123 #elif CH_SPACEDIM==2 00124 # define D_EXPR(a,b,c) ((void)((a),(b),0)) 00125 # define D_DECL(a,b,c) a,b 00126 # define D_TERM(a,b,c) a b 00127 #elif CH_SPACEDIM==3 00128 00129 #ifdef DOXYGEN 00130 00155 #endif 00156 # define D_EXPR(a,b,c) ((void)((a),(b),(c),0)) 00157 00158 #ifdef DOXYGEN 00159 00182 #endif 00183 # define D_DECL(a,b,c) a,b,c 00184 00185 #ifdef DOXYGEN 00186 00204 #endif 00205 # define D_TERM(a,b,c) a b c 00206 #endif 00207 00208 #ifdef DOXYGEN 00209 #undef CH_SPACEDIM 00210 #endif 00211 00212 #endif /*CH_SPACE_H*/