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
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 template <>
00109 struct GrapeInterface<2,3>
00110 {
00111 static int called;
00112 typedef GrapeInterface_two_three::DUNE_ELEM DUNE_ELEM;
00113 typedef GrapeInterface_two_three::DUNE_FDATA DUNE_FDATA;
00114 typedef GrapeInterface_two_three::DUNE_DAT DUNE_DAT;
00115 typedef GrapeInterface_two_three::F_DATA F_DATA;
00116 typedef GrapeInterface_two_three::HELEMENT HELEMENT;
00117 typedef GrapeInterface_two_three::STACKENTRY STACKENTRY;
00118
00119 inline static void init()
00120 {
00121 GrapeInterface_two_three::grape_add_remove_methods();
00122 }
00123
00124 inline static void setThread(int t)
00125 {
00126 }
00127
00128 inline static void setDefaultIterator(int val)
00129 {
00130 setDefaultIteratorValue(val);
00131 }
00132
00133 inline static void handleMesh (void *hmesh, bool grdMode = false )
00134 {
00135 GrapeInterface_two_three::handleMesh(hmesh,grdMode);
00136 }
00137
00138 inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
00139 {
00140 GrapeInterface_two_three::addDataToHmesh(hmesh,data);
00141 }
00142
00143 inline static void *setupHmesh(const int noe,
00144 const int nov, const int maxlev,DUNE_DAT * dune)
00145 {
00146 return GrapeInterface_two_three::setupHmesh(
00147 noe,nov,maxlev,dune);
00148 }
00149
00150 inline static void deleteHmesh( void * hmesh )
00151 {
00152 GrapeInterface_two_three::deleteHmesh( hmesh );
00153 }
00154
00155 inline static void deleteFunctions( void * hmesh )
00156 {
00157 GrapeInterface_two_three::deleteFunctions( hmesh );
00158 }
00159
00160 inline static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc)
00161 {
00162 GrapeInterface_two_three::addHmeshToTimeScene(timescene,time,hmesh,proc);
00163 }
00164
00165 inline static void addHmeshToGlobalTimeScene(double time, void *hmesh , int proc)
00166 {
00167 GrapeInterface_two_three::addHmeshToGlobalTimeScene(time,hmesh,proc);
00168 }
00169
00170 inline static void colorBarMinMax(const double min, const double max)
00171 {
00172 GrapeInterface_two_three::colorBarMinMax(min,max);
00173 }
00174 };
00175
00176
00177 template <>
00178 struct GrapeInterface<3,3>
00179 {
00180 typedef GrapeInterface_three_three::DUNE_ELEM DUNE_ELEM;
00181 typedef GrapeInterface_three_three::DUNE_FDATA DUNE_FDATA;
00182 typedef GrapeInterface_three_three::DUNE_DAT DUNE_DAT;
00183 typedef GrapeInterface_three_three::F_DATA F_DATA;
00184 typedef GrapeInterface_three_three::HELEMENT HELEMENT;
00185 typedef GrapeInterface_three_three::STACKENTRY STACKENTRY;
00186
00187 inline static void init()
00188 {
00189 GrapeInterface_three_three::initPartitionDisp(__MaxPartition);
00190 GrapeInterface_three_three::grape_add_remove_methods();
00191 }
00192
00193 inline static void setThread(int t)
00194 {
00195 GrapeInterface_three_three::setThread(t);
00196 }
00197
00198 inline static void setDefaultIterator(int val)
00199 {
00200 setDefaultIteratorValue(val);
00201 }
00202
00203 inline static void handleMesh (void *hmesh, bool grdMode = false )
00204 {
00205 GrapeInterface_three_three::handleMesh(hmesh,grdMode);
00206 }
00207
00208 inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
00209 {
00210 GrapeInterface_three_three::addDataToHmesh(hmesh,data);
00211 }
00212
00213 inline static void *setupHmesh(const int noe,
00214 const int nov, const int maxlev, DUNE_DAT * dune)
00215 {
00216 return GrapeInterface_three_three::
00217 setupHmesh(noe,nov,maxlev,dune);
00218 }
00219
00220 inline static void deleteFunctions( void * hmesh )
00221 {
00222 GrapeInterface_three_three::deleteFunctions( hmesh );
00223 }
00224
00225 inline static void deleteHmesh( void * hmesh )
00226 {
00227 GrapeInterface_three_three::deleteHmesh( hmesh );
00228 }
00229
00230 inline static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc)
00231 {
00232 GrapeInterface_three_three::addHmeshToTimeScene(timescene,time,hmesh,proc);
00233 }
00234 inline static void addHmeshToGlobalTimeScene(double time, void *hmesh , int proc)
00235 {
00236 GrapeInterface_three_three::addHmeshToGlobalTimeScene(time,hmesh,proc);
00237 }
00238
00239 inline static void colorBarMinMax(const double min, const double max)
00240 {
00241 GrapeInterface_three_three::colorBarMinMax(min,max);
00242 }
00243 };
00244
00245
00246 }
00247
00248 #include "grapecommon.cc"
00249
00250 #endif