dune-grid  2.4
grapeinclude.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GRIDDISPLAY_HH
4 #define DUNE_GRIDDISPLAY_HH
5 
6 #include <cstdlib>
7 #include <iostream>
8 #include <cassert>
9 #include <cstdarg>
10 #include <cstring>
11 #include <iostream>
12 #include <stack>
13 #include <map>
14 #include <set>
15 #include <list>
16 
17 #if HAVE_GRAPE
18 #include "grapecommon.hh"
19 
20 namespace GrapeInterface_two_two
21 {
22 #define GRAPE_DIM 2
23 #define GRAPE_DIMWORLD 2
24 #undef GRAPE_GRAPEHMESH_HH_INCLUDED
25 #include "grapehmesh.hh"
26 }
27 
28 namespace GrapeInterface_two_three
29 {
30 #define GRAPE_DIM 2
31 #define GRAPE_DIMWORLD 3
32 #undef GRAPE_GRAPEHMESH_HH_INCLUDED
33 #include "grapehmesh.hh"
34 }
35 
36 namespace GrapeInterface_three_three
37 {
38 #define GRAPE_DIM 3
39 #define GRAPE_DIMWORLD 3
40 #undef GRAPE_GRAPEHMESH_HH_INCLUDED
41 #include "grapehmesh.hh"
42 }
43 
44 namespace Dune
45 {
46 
47  static int __MaxPartition = 1;
48 
49  // the interface to dune
50  template <int dim, int dimworld>
51  struct GrapeInterface;
52 
53  template<>
54  struct GrapeInterface<2,2>
55  {
56  static int called;
57  typedef GrapeInterface_two_two::DUNE_ELEM DUNE_ELEM;
58  typedef GrapeInterface_two_two::DUNE_FDATA DUNE_FDATA;
59  typedef GrapeInterface_two_two::DUNE_DAT DUNE_DAT;
60  typedef GrapeInterface_two_two::F_DATA F_DATA;
61  typedef GrapeInterface_three_three::HELEMENT HELEMENT;
63 
64  inline static void init()
65  {
67  GrapeInterface_two_two::setupReferenceElements();
68  }
69 
70  inline static void setThread(int t)
71  {}
72 
73  inline static void setDefaultIterator(int val)
74  {
76  }
77 
78  inline static void handleMesh (void *hmesh, bool grdMode = false )
79  {
81  }
82 
83  inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
84  {
86  }
87 
88  inline static void *setupHmesh(const int noe,
89  const int nov, const int maxlev,DUNE_DAT * dune,
90  const char *meshName = "Dune Mesh" )
91  {
93  noe,nov,maxlev,dune,meshName);
94  }
95 
96  inline static void deleteHmesh( void * hmesh )
97  {
99  }
100 
101  inline static void deleteFunctions( void * hmesh )
102  {
104  }
105 
106  inline static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc)
107  {
108  GrapeInterface_two_two::addHmeshToTimeScene(timescene,time,hmesh,proc);
109  }
110 
111  inline static void addHmeshToGlobalTimeScene(double time, void *hmesh , int proc)
112  {
114  }
115 
116  inline static void colorBarMinMax(const double min, const double max)
117  {
119  }
120  };
121 
122  template <>
123  struct GrapeInterface<2,3>
124  {
125  static int called;
126  typedef GrapeInterface_two_three::DUNE_ELEM DUNE_ELEM;
127  typedef GrapeInterface_two_three::DUNE_FDATA DUNE_FDATA;
128  typedef GrapeInterface_two_three::DUNE_DAT DUNE_DAT;
129  typedef GrapeInterface_two_three::F_DATA F_DATA;
130  typedef GrapeInterface_two_three::HELEMENT HELEMENT;
132 
133  inline static void init()
134  {
136  GrapeInterface_two_three::setupReferenceElements();
137  }
138 
139  inline static void setThread(int t)
140  {}
141 
142  inline static void setDefaultIterator(int val)
143  {
145  }
146 
147  inline static void handleMesh (void *hmesh, bool grdMode = false )
148  {
150  }
151 
152  inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
153  {
155  }
156 
157  inline static void *setupHmesh(const int noe,
158  const int nov, const int maxlev,DUNE_DAT * dune,
159  const char *meshName = "Dune Mesh" )
160  {
162  noe,nov,maxlev,dune, meshName);
163  }
164 
165  inline static void deleteHmesh( void * hmesh )
166  {
168  }
169 
170  inline static void deleteFunctions( void * hmesh )
171  {
173  }
174 
175  inline static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc)
176  {
177  GrapeInterface_two_three::addHmeshToTimeScene(timescene,time,hmesh,proc);
178  }
179 
180  inline static void addHmeshToGlobalTimeScene(double time, void *hmesh , int proc)
181  {
183  }
184 
185  inline static void colorBarMinMax(const double min, const double max)
186  {
188  }
189  };
190 
191  // the interface to dune for dim = dimworld = 3
192  template <>
193  struct GrapeInterface<3,3>
194  {
195  typedef GrapeInterface_three_three::DUNE_ELEM DUNE_ELEM;
196  typedef GrapeInterface_three_three::DUNE_FDATA DUNE_FDATA;
197  typedef GrapeInterface_three_three::DUNE_DAT DUNE_DAT;
198  typedef GrapeInterface_three_three::F_DATA F_DATA;
199  typedef GrapeInterface_three_three::HELEMENT HELEMENT;
201 
202  inline static void init()
203  {
206  GrapeInterface_three_three::setupReferenceElements();
207  }
208 
209  inline static void setThread(int t)
210  {
212  }
213 
214  inline static void setDefaultIterator(int val)
215  {
217  }
218 
219  inline static void handleMesh (void *hmesh, bool grdMode = false )
220  {
222  }
223 
224  inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
225  {
227  }
228 
229  inline static void *setupHmesh(const int noe,
230  const int nov, const int maxlev, DUNE_DAT * dune,
231  const char *meshName = "Dune Mesh" )
232  {
234  setupHmesh(noe,nov,maxlev,dune, meshName);
235  }
236 
237  inline static void deleteFunctions( void * hmesh )
238  {
240  }
241 
242  inline static void deleteHmesh( void * hmesh )
243  {
245  }
246 
247  inline static void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc)
248  {
249  GrapeInterface_three_three::addHmeshToTimeScene(timescene,time,hmesh,proc);
250  }
251  inline static void addHmeshToGlobalTimeScene(double time, void *hmesh , int proc)
252  {
254  }
255 
256  inline static void colorBarMinMax(const double min, const double max)
257  {
259  }
260  };
261 
262 } // end namespace Dune
263 
264 #include "grapecommon.cc"
265 
266 #endif // #if HAVE_GRAPE
267 
268 #endif // #ifndef DUNE_GRIDDISPLAY_HH
void handleMesh(void *hmesh, bool gridMode)
Definition: ghmesh.cc:1065
void colorBarMinMax(const double min, const double max)
Definition: ghmesh.cc:1057
int max(const DofVectorPointer< int > &dofVector)
Definition: dofvector.hh:335
Include standard header files.
Definition: agrid.hh:59
void addDataToHmesh(void *hmesh, DUNE_FDATA *data)
Definition: ghmesh.cc:668
static void grape_add_remove_methods(void)
Definition: ghmesh.cc:1513
void deleteFunctions(void *hmesh)
Definition: ghmesh.cc:851
void addHmeshToGlobalTimeScene(double time, void *hmesh, int proc)
Definition: ghmesh.cc:1149
void initPartitionDisp(int mp)
Definition: partitiondisplay.cc:370
void setDefaultIteratorValue(int val)
Definition: grapecommon.cc:43
int min(const DofVectorPointer< int > &dofVector)
Definition: dofvector.hh:346
void deleteHmesh(void *hmesh)
Definition: ghmesh.cc:845
struct stackentry STACKENTRY
static void setThread(int t)
Definition: partitiondisplay.cc:144
void addHmeshToTimeScene(void *timescene, double time, void *hmesh, int proc)
Definition: ghmesh.cc:1124
void * setupHmesh(const int noe, const int nov, const int maxlev, DUNE_DAT *dune, const char *meshName)
Definition: ghmesh.cc:794