albertaheader.hh

00001 #ifndef DUNE_ALBERTAHEADER_HH
00002 #define DUNE_ALBERTAHEADER_HH
00003 
00004 #if HAVE_ALBERTA
00005 
00006 #include <dune/grid/albertagrid/griddim.hh>
00007 
00008 // if we have ALBERTA C++ lib define namespace for ALBERTA
00009 #ifdef __ALBERTApp__
00010 #define ALBERTA Alberta:: 
00011 #else
00012 #define ALBERTA ::
00013 #endif
00014 
00015 // the keyword ALBERTA stands for ALBERTA routines 
00016 #ifndef __ALBERTApp__
00017 extern "C" 
00018 {
00019 #endif
00020 
00021 #ifndef ALBERTA_DEBUG
00022 #define ALBERTA_DEBUG 0 
00023 #endif
00024   
00025 // we dont use the el->index, its for debugging
00026 #ifndef EL_INDEX 
00027 #define EL_INDEX 0
00028 #else
00029 #if EL_INDEX != 0
00030 #warning "EL_INDEX != 0, but not used in interface implementation!\n"
00031 #endif
00032 #endif
00033   
00034   
00035 #ifndef NEIGH_IN_EL
00036 // neighbours were calculated on walkthrough
00037 #define NEIGH_IN_EL 0
00038 #else 
00039 #if NEIGH_IN_EL != 0
00040 #error "NEIGH_IN_EL != 0 is not supported by this implementation!\n"  
00041 #endif
00042 #endif
00043 
00044 // MAX, MIN, and ABS are defined macros of ALBERTA
00045 // if they are not defined elsewhere, they are undefined here
00046 #ifndef MAX 
00047 #define _MAX_NOT_DEFINED_
00048 #endif
00049   
00050 #ifndef MIN 
00051 #define _MIN_NOT_DEFINED_
00052 #endif
00053   
00054 #ifndef ABS 
00055 #define _ABS_NOT_DEFINED_
00056 #endif
00057 
00058 #ifndef DIM 
00059 #error "DIM or DIM_OF_WORLD not defined!"
00060 #endif
00061   
00062 #include <alberta.h>
00063 
00064 // for version 1.2 thing are different 
00065 #if DUNE_ALBERTA_VERSION < 0x200
00066 
00067 // face is not defined but should be the value of edge 
00068 //#ifndef FACE 
00069 //#define FACE EDGE
00070 //#endif
00071 
00072 static inline void meshTraverse(MESH *mesh, 
00073                                 int level, FLAGS fill_flag,
00074                                 void (*el_fct)(const EL_INFO *))
00075 {
00076   mesh_traverse(mesh, level, fill_flag, el_fct);
00077 }
00078 
00079 #define GET_EL_FROM_LIST(rc_list_el) (rc_list_el).el
00080 
00082 #else // version 2.0
00084 
00085 static inline void wrapped_el_fct(const EL_INFO* elinfo, void * data) 
00086 {
00087   ((void (*)(const EL_INFO *)) data)(elinfo);
00088 }
00089 
00090 static inline void meshTraverse(MESH *mesh, 
00091                                 int level, FLAGS fill_flag,
00092                                 void (*el_fct)(const EL_INFO *))
00093 {
00094   mesh_traverse(mesh, level, fill_flag, wrapped_el_fct, (void*)el_fct );
00095 }
00096 
00097 #define GET_EL_FROM_LIST(rc_list_el) (rc_list_el).el_info.el
00098 
00099 #endif // end Version 2.0
00101   
00102 #ifndef _ALBERTA_H_
00103 #error "Couldn't find alberta.h for include! "
00104 #endif
00105   
00106 #ifndef __ALBERTApp__
00107 } // end extern "C"
00108 #endif
00109 
00110 #endif // HAVE_ALBERTA
00111 
00112 #endif

Generated on Thu Apr 2 10:40:38 2009 for dune-grid by  doxygen 1.5.6