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 DOXYGEN 00058 00066 #define CH_SPACEDIM 00067 #undef CH_SPACEDIM 00068 #define CH_SPACEDIM 3 00069 #endif 00070 00071 #if ! defined(CH_SPACEDIM) 00072 #error CH_SPACEDIM must be defined 00073 #endif 00074 00075 #if (CH_SPACEDIM != 1 && CH_SPACEDIM !=2 && CH_SPACEDIM != 3) 00076 #error CH_SPACEDIM must be either 1, 2, or 3 00077 #endif 00078 00079 #if !defined(CH_LANG_FORT) || defined(CH_LANG_CC) 00080 00091 const int SpaceDim = CH_SPACEDIM; 00092 #endif 00093 00094 #if CH_SPACEDIM==1 00095 00096 # define D_EXPR(a,b,c) ((void)((a),0)) 00097 00098 # define D_DECL(a,b,c) a 00099 00100 # define D_TERM(a,b,c) a 00101 #elif CH_SPACEDIM==2 00102 # define D_EXPR(a,b,c) ((void)((a),(b),0)) 00103 # define D_DECL(a,b,c) a,b 00104 # define D_TERM(a,b,c) a b 00105 #elif CH_SPACEDIM==3 00106 00132 # define D_EXPR(a,b,c) ((void)((a),(b),(c),0)) 00133 00157 # define D_DECL(a,b,c) a,b,c 00158 00177 # define D_TERM(a,b,c) a b c 00178 #endif 00179 00180 #ifdef DOXYGEN 00181 #undef CH_SPACEDIM 00182 #endif 00183 00184 #endif /*CH_SPACE_H*/