grapeinclude.hh

00001 #ifndef DUNE_GRIDDISPLAY_HH
00002 #define DUNE_GRIDDISPLAY_HH
00003 
00004 #include <stdarg.h>
00005 #include <assert.h>
00006 #include <string.h>
00007 
00008 #include "grapewrapper.hh"
00009 #include "grapecommon.hh"
00010 
00011 enum { MAX_EL_DOF  = 8 };
00012 enum { MAX_EL_FACE = 6 };
00013 
00014 namespace GrapeInterface_two_two
00015 {
00016 #define GRAPE_DIM 2 
00017 #define GRAPE_DIMWORLD 2 
00018 #include "grapehmesh.hh"
00019 }
00020 
00021 namespace GrapeInterface_two_three
00022 {
00023 #define GRAPE_DIM 2
00024 #define GRAPE_DIMWORLD 3  
00025 #include "grapehmesh.hh"
00026 }
00027 
00028 namespace GrapeInterface_three_three
00029 {
00030 #define GRAPE_DIM 3 
00031 #define GRAPE_DIMWORLD 3 
00032 #include "grapehmesh.hh"
00033 }
00034 
00035 namespace Dune 
00036 {
00037 
00038 static int __MaxPartition = 1;  
00039 // the interface to dune 
00040 template <int dim, int dimworld>
00041 struct GrapeInterface
00042 {
00043   static int called;
00044   typedef GrapeInterface_two_two::DUNE_ELEM  DUNE_ELEM;
00045   typedef GrapeInterface_two_two::DUNE_FDATA DUNE_FDATA;
00046   typedef GrapeInterface_two_two::DUNE_DAT   DUNE_DAT;
00047   typedef GrapeInterface_two_two::F_DATA F_DATA;
00048   typedef GrapeInterface_three_three::HELEMENT HELEMENT;
00049   typedef GrapeInterface_three_three::STACKENTRY STACKENTRY;
00050   
00051   inline static void init() 
00052   {
00053     GrapeInterface_two_two::grape_add_remove_methods();
00054   }
00055   
00056   inline static void setThread(int t) 
00057   {
00058   }
00059 
00060   inline static void setDefaultIterator(int val) 
00061   {
00062     setDefaultIteratorValue(val);
00063   }
00064 
00065   inline static void handleMesh (void *hmesh, bool grdMode = false )
00066   {
00067     GrapeInterface_two_two::handleMesh(hmesh,grdMode);
00068   }
00069 
00070   inline static void addDataToHmesh(void  *hmesh, DUNE_FDATA * data)
00071   {
00072     GrapeInterface_two_two::addDataToHmesh(hmesh,data);
00073   }
00074 
00075   inline static void *setupHmesh(const int noe, 
00076       const int nov, const int maxlev,DUNE_DAT * dune)
00077   {
00078     return  GrapeInterface_two_two::setupHmesh(
00079               noe,nov,maxlev,dune);
00080   }
00081 
00082   inline static void deleteHmesh( void * hmesh )
00083   {
00084     GrapeInterface_two_two::deleteHmesh( hmesh );
00085   }
00086 
00087   inline static void deleteFunctions( void * hmesh )
00088   {
00089     GrapeInterface_two_two::deleteFunctions( hmesh );
00090   }
00091 
00092   inline static void addHmeshToTimeScene(void * timescene, double time, void  *hmesh , int proc)
00093   {
00094     GrapeInterface_two_two::addHmeshToTimeScene(timescene,time,hmesh,proc);
00095   }
00096   
00097   inline static void addHmeshToGlobalTimeScene(double time, void  *hmesh , int proc)
00098   {
00099     GrapeInterface_two_two::addHmeshToGlobalTimeScene(time,hmesh,proc);
00100   }
00101   
00102   inline static void colorBarMinMax(const double min, const double max) 
00103   {
00104     GrapeInterface_two_two::colorBarMinMax(min,max);
00105   }
00106 };
00107 
00108 // the interface to dune for dim = dimworld = 3
00109 template <>
00110 struct GrapeInterface<3,3>
00111 {
00112   typedef GrapeInterface_three_three::DUNE_ELEM  DUNE_ELEM;
00113   typedef GrapeInterface_three_three::DUNE_FDATA DUNE_FDATA;
00114   typedef GrapeInterface_three_three::DUNE_DAT   DUNE_DAT;
00115   typedef GrapeInterface_three_three::F_DATA F_DATA;
00116   typedef GrapeInterface_three_three::HELEMENT HELEMENT;
00117   typedef GrapeInterface_three_three::STACKENTRY STACKENTRY;
00118 
00119   inline static void init() 
00120   {
00121     GrapeInterface_three_three::initPartitionDisp(__MaxPartition);
00122     GrapeInterface_three_three::grape_add_remove_methods();
00123   }
00124 
00125   inline static void setThread(int t) 
00126   {
00127     GrapeInterface_three_three::setThread(t);
00128   }
00129   
00130   inline static void setDefaultIterator(int val) 
00131   {
00132     setDefaultIteratorValue(val);
00133   }
00134 
00135   inline static void handleMesh (void *hmesh, bool grdMode = false )
00136   {
00137     GrapeInterface_three_three::handleMesh(hmesh,grdMode);
00138   }
00139 
00140   inline static void addDataToHmesh(void  *hmesh, DUNE_FDATA * data)
00141   {
00142     GrapeInterface_three_three::addDataToHmesh(hmesh,data);
00143   }
00144 
00145   inline static void *setupHmesh(const int noe, 
00146       const int nov, const int maxlev, DUNE_DAT * dune)
00147   {
00148     return  GrapeInterface_three_three::
00149       setupHmesh(noe,nov,maxlev,dune);
00150   }
00151 
00152   inline static void deleteFunctions( void * hmesh )
00153   {
00154     GrapeInterface_three_three::deleteFunctions( hmesh );
00155   }
00156   
00157   inline static void deleteHmesh( void * hmesh )
00158   {
00159     GrapeInterface_three_three::deleteHmesh( hmesh );
00160   }
00161   
00162   inline static void addHmeshToTimeScene(void * timescene, double time, void  *hmesh , int proc)
00163   {
00164     GrapeInterface_three_three::addHmeshToTimeScene(timescene,time,hmesh,proc);
00165   }
00166   inline static void addHmeshToGlobalTimeScene(double time, void  *hmesh , int proc)
00167   {
00168     GrapeInterface_three_three::addHmeshToGlobalTimeScene(time,hmesh,proc);
00169   }
00170 
00171   inline static void colorBarMinMax(const double min, const double max) 
00172   {
00173     GrapeInterface_three_three::colorBarMinMax(min,max);
00174   }
00175 };
00176 
00177 
00178 } // end namespace Dune
00179 
00180 #include "grapecommon.cc"
00181 
00182 #endif

Generated on 12 Dec 2007 with Doxygen (ver 1.5.1)