dune-grid  2.1.1
grapeinclude.hh
Go to the documentation of this file.
00001 #ifndef DUNE_GRIDDISPLAY_HH
00002 #define DUNE_GRIDDISPLAY_HH
00003 
00004 #include <cstdlib>
00005 #include <iostream>
00006 #include <cassert>
00007 #include <cstdarg>
00008 #include <cstring>
00009 #include <iostream>
00010 #include <stack>
00011 #include <map>
00012 #include <set>
00013 #include <list>
00014 
00015 #if HAVE_GRAPE
00016 #include "grapecommon.hh"
00017 
00018 namespace GrapeInterface_two_two
00019 {
00020 #define GRAPE_DIM 2 
00021 #define GRAPE_DIMWORLD 2 
00022 #undef GRAPE_GRAPEHMESH_HH_INCLUDED 
00023 #include "grapehmesh.hh"
00024 }
00025 
00026 namespace GrapeInterface_two_three
00027 {
00028 #define GRAPE_DIM 2
00029 #define GRAPE_DIMWORLD 3  
00030 #undef GRAPE_GRAPEHMESH_HH_INCLUDED 
00031 #include "grapehmesh.hh"
00032 }
00033 
00034 namespace GrapeInterface_three_three
00035 {
00036 #define GRAPE_DIM 3 
00037 #define GRAPE_DIMWORLD 3 
00038 #undef GRAPE_GRAPEHMESH_HH_INCLUDED 
00039 #include "grapehmesh.hh"
00040 }
00041 
00042 namespace Dune 
00043 {
00044 
00045 static int __MaxPartition = 1;  
00046 // the interface to dune 
00047 template <int dim, int dimworld>
00048 struct GrapeInterface
00049 {
00050   static int called;
00051   typedef GrapeInterface_two_two::DUNE_ELEM  DUNE_ELEM;
00052   typedef GrapeInterface_two_two::DUNE_FDATA DUNE_FDATA;
00053   typedef GrapeInterface_two_two::DUNE_DAT   DUNE_DAT;
00054   typedef GrapeInterface_two_two::F_DATA F_DATA;
00055   typedef GrapeInterface_three_three::HELEMENT HELEMENT;
00056   typedef GrapeInterface_three_three::STACKENTRY STACKENTRY;
00057   
00058   inline static void init() 
00059   {
00060     GrapeInterface_two_two::grape_add_remove_methods();
00061     GrapeInterface_two_two::setupReferenceElements();
00062   }
00063   
00064   inline static void setThread(int t) 
00065   {
00066   }
00067 
00068   inline static void setDefaultIterator(int val) 
00069   {
00070     setDefaultIteratorValue(val);
00071   }
00072 
00073   inline static void handleMesh (void *hmesh, bool grdMode = false )
00074   {
00075     GrapeInterface_two_two::handleMesh(hmesh,grdMode);
00076   }
00077 
00078   inline static void addDataToHmesh(void  *hmesh, DUNE_FDATA * data)
00079   {
00080     GrapeInterface_two_two::addDataToHmesh(hmesh,data);
00081   }
00082 
00083   inline static void *setupHmesh(const int noe, 
00084       const int nov, const int maxlev,DUNE_DAT * dune,
00085       const char *meshName = "Dune Mesh" )
00086   {
00087     return  GrapeInterface_two_two::setupHmesh(
00088               noe,nov,maxlev,dune,meshName);
00089   }
00090 
00091   inline static void deleteHmesh( void * hmesh )
00092   {
00093     GrapeInterface_two_two::deleteHmesh( hmesh );
00094   }
00095 
00096   inline static void deleteFunctions( void * hmesh )
00097   {
00098     GrapeInterface_two_two::deleteFunctions( hmesh );
00099   }
00100 
00101   inline static void addHmeshToTimeScene(void * timescene, double time, void  *hmesh , int proc)
00102   {
00103     GrapeInterface_two_two::addHmeshToTimeScene(timescene,time,hmesh,proc);
00104   }
00105   
00106   inline static void addHmeshToGlobalTimeScene(double time, void  *hmesh , int proc)
00107   {
00108     GrapeInterface_two_two::addHmeshToGlobalTimeScene(time,hmesh,proc);
00109   }
00110   
00111   inline static void colorBarMinMax(const double min, const double max) 
00112   {
00113     GrapeInterface_two_two::colorBarMinMax(min,max);
00114   }
00115 };
00116 
00117 template <>
00118 struct GrapeInterface<2,3> 
00119 {
00120   static int called;
00121   typedef GrapeInterface_two_three::DUNE_ELEM  DUNE_ELEM;
00122   typedef GrapeInterface_two_three::DUNE_FDATA DUNE_FDATA;
00123   typedef GrapeInterface_two_three::DUNE_DAT   DUNE_DAT;
00124   typedef GrapeInterface_two_three::F_DATA F_DATA;
00125   typedef GrapeInterface_two_three::HELEMENT HELEMENT;
00126   typedef GrapeInterface_two_three::STACKENTRY STACKENTRY;
00127   
00128   inline static void init() 
00129   {
00130     GrapeInterface_two_three::grape_add_remove_methods();
00131     GrapeInterface_two_three::setupReferenceElements();
00132   }
00133   
00134   inline static void setThread(int t) 
00135   {
00136   }
00137 
00138   inline static void setDefaultIterator(int val) 
00139   {
00140     setDefaultIteratorValue(val);
00141   }
00142 
00143   inline static void handleMesh (void *hmesh, bool grdMode = false )
00144   {
00145     GrapeInterface_two_three::handleMesh(hmesh,grdMode);
00146   }
00147 
00148   inline static void addDataToHmesh(void  *hmesh, DUNE_FDATA * data)
00149   {
00150     GrapeInterface_two_three::addDataToHmesh(hmesh,data);
00151   }
00152 
00153   inline static void *setupHmesh(const int noe, 
00154       const int nov, const int maxlev,DUNE_DAT * dune,
00155       const char *meshName = "Dune Mesh" )
00156   {
00157     return  GrapeInterface_two_three::setupHmesh(
00158               noe,nov,maxlev,dune, meshName);
00159   }
00160 
00161   inline static void deleteHmesh( void * hmesh )
00162   {
00163     GrapeInterface_two_three::deleteHmesh( hmesh );
00164   }
00165 
00166   inline static void deleteFunctions( void * hmesh )
00167   {
00168     GrapeInterface_two_three::deleteFunctions( hmesh );
00169   }
00170 
00171   inline static void addHmeshToTimeScene(void * timescene, double time, void  *hmesh , int proc)
00172   {
00173     GrapeInterface_two_three::addHmeshToTimeScene(timescene,time,hmesh,proc);
00174   }
00175   
00176   inline static void addHmeshToGlobalTimeScene(double time, void  *hmesh , int proc)
00177   {
00178     GrapeInterface_two_three::addHmeshToGlobalTimeScene(time,hmesh,proc);
00179   }
00180   
00181   inline static void colorBarMinMax(const double min, const double max) 
00182   {
00183     GrapeInterface_two_three::colorBarMinMax(min,max);
00184   }
00185 };
00186 
00187 // the interface to dune for dim = dimworld = 3
00188 template <>
00189 struct GrapeInterface<3,3>
00190 {
00191   typedef GrapeInterface_three_three::DUNE_ELEM  DUNE_ELEM;
00192   typedef GrapeInterface_three_three::DUNE_FDATA DUNE_FDATA;
00193   typedef GrapeInterface_three_three::DUNE_DAT   DUNE_DAT;
00194   typedef GrapeInterface_three_three::F_DATA F_DATA;
00195   typedef GrapeInterface_three_three::HELEMENT HELEMENT;
00196   typedef GrapeInterface_three_three::STACKENTRY STACKENTRY;
00197 
00198   inline static void init() 
00199   {
00200     GrapeInterface_three_three::initPartitionDisp(__MaxPartition);
00201     GrapeInterface_three_three::grape_add_remove_methods();
00202     GrapeInterface_three_three::setupReferenceElements();
00203   }
00204 
00205   inline static void setThread(int t) 
00206   {
00207     GrapeInterface_three_three::setThread(t);
00208   }
00209   
00210   inline static void setDefaultIterator(int val) 
00211   {
00212     setDefaultIteratorValue(val);
00213   }
00214 
00215   inline static void handleMesh (void *hmesh, bool grdMode = false )
00216   {
00217     GrapeInterface_three_three::handleMesh(hmesh,grdMode);
00218   }
00219 
00220   inline static void addDataToHmesh(void  *hmesh, DUNE_FDATA * data)
00221   {
00222     GrapeInterface_three_three::addDataToHmesh(hmesh,data);
00223   }
00224 
00225   inline static void *setupHmesh(const int noe, 
00226       const int nov, const int maxlev, DUNE_DAT * dune,
00227       const char *meshName = "Dune Mesh" )
00228   {
00229     return  GrapeInterface_three_three::
00230       setupHmesh(noe,nov,maxlev,dune, meshName);
00231   }
00232 
00233   inline static void deleteFunctions( void * hmesh )
00234   {
00235     GrapeInterface_three_three::deleteFunctions( hmesh );
00236   }
00237   
00238   inline static void deleteHmesh( void * hmesh )
00239   {
00240     GrapeInterface_three_three::deleteHmesh( hmesh );
00241   }
00242   
00243   inline static void addHmeshToTimeScene(void * timescene, double time, void  *hmesh , int proc)
00244   {
00245     GrapeInterface_three_three::addHmeshToTimeScene(timescene,time,hmesh,proc);
00246   }
00247   inline static void addHmeshToGlobalTimeScene(double time, void  *hmesh , int proc)
00248   {
00249     GrapeInterface_three_three::addHmeshToGlobalTimeScene(time,hmesh,proc);
00250   }
00251 
00252   inline static void colorBarMinMax(const double min, const double max) 
00253   {
00254     GrapeInterface_three_three::colorBarMinMax(min,max);
00255   }
00256 };
00257 
00258 
00259 } // end namespace Dune
00260 
00261 #include "grapecommon.cc"
00262 
00263 #endif
00264 
00265 #endif