Dune Core Modules (2.4.2)

grapeinclude.hh
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
20namespace 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
28namespace 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
36namespace 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
44namespace 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;
62 typedef GrapeInterface_three_three::STACKENTRY STACKENTRY;
63
64 inline static void init()
65 {
66 GrapeInterface_two_two::grape_add_remove_methods();
67 GrapeInterface_two_two::setupReferenceElements();
68 }
69
70 inline static void setThread(int t)
71 {}
72
73 inline static void setDefaultIterator(int val)
74 {
75 setDefaultIteratorValue(val);
76 }
77
78 inline static void handleMesh (void *hmesh, bool grdMode = false )
79 {
80 GrapeInterface_two_two::handleMesh(hmesh,grdMode);
81 }
82
83 inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
84 {
85 GrapeInterface_two_two::addDataToHmesh(hmesh,data);
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 {
92 return GrapeInterface_two_two::setupHmesh(
93 noe,nov,maxlev,dune,meshName);
94 }
95
96 inline static void deleteHmesh( void * hmesh )
97 {
98 GrapeInterface_two_two::deleteHmesh( hmesh );
99 }
100
101 inline static void deleteFunctions( void * hmesh )
102 {
103 GrapeInterface_two_two::deleteFunctions( hmesh );
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 {
113 GrapeInterface_two_two::addHmeshToGlobalTimeScene(time,hmesh,proc);
114 }
115
116 inline static void colorBarMinMax(const double min, const double max)
117 {
118 GrapeInterface_two_two::colorBarMinMax(min,max);
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;
131 typedef GrapeInterface_two_three::STACKENTRY STACKENTRY;
132
133 inline static void init()
134 {
135 GrapeInterface_two_three::grape_add_remove_methods();
136 GrapeInterface_two_three::setupReferenceElements();
137 }
138
139 inline static void setThread(int t)
140 {}
141
142 inline static void setDefaultIterator(int val)
143 {
144 setDefaultIteratorValue(val);
145 }
146
147 inline static void handleMesh (void *hmesh, bool grdMode = false )
148 {
149 GrapeInterface_two_three::handleMesh(hmesh,grdMode);
150 }
151
152 inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
153 {
154 GrapeInterface_two_three::addDataToHmesh(hmesh,data);
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 {
161 return GrapeInterface_two_three::setupHmesh(
162 noe,nov,maxlev,dune, meshName);
163 }
164
165 inline static void deleteHmesh( void * hmesh )
166 {
167 GrapeInterface_two_three::deleteHmesh( hmesh );
168 }
169
170 inline static void deleteFunctions( void * hmesh )
171 {
172 GrapeInterface_two_three::deleteFunctions( hmesh );
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 {
182 GrapeInterface_two_three::addHmeshToGlobalTimeScene(time,hmesh,proc);
183 }
184
185 inline static void colorBarMinMax(const double min, const double max)
186 {
187 GrapeInterface_two_three::colorBarMinMax(min,max);
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;
200 typedef GrapeInterface_three_three::STACKENTRY STACKENTRY;
201
202 inline static void init()
203 {
204 GrapeInterface_three_three::initPartitionDisp(__MaxPartition);
205 GrapeInterface_three_three::grape_add_remove_methods();
206 GrapeInterface_three_three::setupReferenceElements();
207 }
208
209 inline static void setThread(int t)
210 {
211 GrapeInterface_three_three::setThread(t);
212 }
213
214 inline static void setDefaultIterator(int val)
215 {
216 setDefaultIteratorValue(val);
217 }
218
219 inline static void handleMesh (void *hmesh, bool grdMode = false )
220 {
221 GrapeInterface_three_three::handleMesh(hmesh,grdMode);
222 }
223
224 inline static void addDataToHmesh(void *hmesh, DUNE_FDATA * data)
225 {
226 GrapeInterface_three_three::addDataToHmesh(hmesh,data);
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 {
233 return GrapeInterface_three_three::
234 setupHmesh(noe,nov,maxlev,dune, meshName);
235 }
236
237 inline static void deleteFunctions( void * hmesh )
238 {
239 GrapeInterface_three_three::deleteFunctions( hmesh );
240 }
241
242 inline static void deleteHmesh( void * hmesh )
243 {
244 GrapeInterface_three_three::deleteHmesh( hmesh );
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 {
253 GrapeInterface_three_three::addHmeshToGlobalTimeScene(time,hmesh,proc);
254 }
255
256 inline static void colorBarMinMax(const double min, const double max)
257 {
258 GrapeInterface_three_three::colorBarMinMax(min,max);
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
Dune namespace.
Definition: alignment.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)