dune-grid  2.2.0
geldesc.hh
Go to the documentation of this file.
1 #ifndef __GRAPE_ELDESC_H__
2 #define __GRAPE_ELDESC_H__
3 
4 #if HAVE_GRAPE
5 
6 #include "ghmesh.hh"
7 
8 #ifndef GRAPE_DIM
9 #define GRAPE_DIM 3
10 #endif
11 
12 #if GRAPE_DIM==3
13 typedef HELEMENT3D HELEMENT;
14 typedef ELEMENT3D ELEMENT;
15 typedef HMESH3D HMESH;
16 typedef HMESH GRAPEMESH;
17 typedef GENMESH3D GENMESHnD;
18 typedef HELEMENT3D_DESCRIPTION H_ELEMENT_DESCRIPTION;
19 typedef ELEMENT3D_DESCRIPTION ELEMENT_DESCRIPTION;
20 typedef F_HDATA3D F_DATA;
21 typedef F_HEL_INFO3D F_EL_INFO;
22 #define HMesh HMesh3d
23 #define GenMesh GenMesh3d
24 #define GrapeMesh HMesh
25 #else
26 typedef HELEMENT2D HELEMENT;
27 typedef ELEMENT2D ELEMENT;
28 typedef GENMESH2D GENMESHnD;
29 typedef HELEMENT2D_DESCRIPTION H_ELEMENT_DESCRIPTION;
30 typedef ELEMENT2D_DESCRIPTION ELEMENT_DESCRIPTION;
31 typedef F_HEL_INFO2D F_EL_INFO;
32 
33 // definitions for using HPMesh2d
34 typedef HPMESH2D HMESH;
35 typedef F_HPDATA2D F_DATA;
36 #define HMesh HPMesh2d
37 
38 // definitions for using Mesh2d
39 //typedef HMESH2D HMESH;
40 //typedef F_HDATA2D F_DATA;
41 //#define HMesh HMesh2d
42 
43 typedef HMESH GRAPEMESH;
44 #define GenMesh GenMesh2d
45 #define GrapeMesh HMesh
46 #endif
47 
48 /**************************************************************************/
49 /* element types, see dune/grid/common/grid.hh and grapegriddisplay.hh */
50 enum GR_ElementType
51  {gr_vertex=6,gr_line=7,
52  // here consecutive numbering from zero that this numbers can be used
53  // in an array starting from 0
54  gr_triangle=0, gr_quadrilateral=1,gr_tetrahedron=2,
55  gr_pyramid=3, gr_prism=4, gr_hexahedron=5,
56  gr_iso_triangle=8, gr_iso_quadrilateral=9,
57  gr_unknown=127};
58 enum { numberOfUsedGrapeElementTypes = 6 };
59 
60 /*****************************************************************************
61 * HELEMENT2D_DESCRIPTION for Triangles *
62 *****************************************************************************/
63 
64 
65 static HELEMENT2D_DESCRIPTION triangle_description;
66 
67 static double triangle_local_coordinate_vector_0[3] = {0.,0.,0.};
68 static double triangle_local_coordinate_vector_1[3] = {1.,0.,0.};
69 static double triangle_local_coordinate_vector_2[3] = {0.,1.,0.};
70 
71 static G_CONST double *triangle_local_coordinate_system[3] = {triangle_local_coordinate_vector_0,
72  triangle_local_coordinate_vector_1,
73  triangle_local_coordinate_vector_2};
74 
75 /* inheritance-rules:
76  2 0 1
77  /\ /| |\
78  / \ C0 / | | \ C1
79  / \ => / | | \
80  / \ / | | \
81 0--------1 1----2 2----0
82 */
83 
84 // NOTE: To be revised
85 static VINHERIT inheritance_rule_in_child_0[3];
86 static VINHERIT inheritance_rule_in_child_1[3];
87 
88 static double pweight_point_0_or_1[1] = {1.0};
89 
90 static int pindex_point_0_in_child_0[1] = {2};
91 static VINHERIT vinherit_point_0_in_child_0 = {1,
92  pindex_point_0_in_child_0,
93  pweight_point_0_or_1};
94 
95 
96 static int pindex_point_1_in_child_0[1] = {0};
97 static VINHERIT vinherit_point_1_in_child_0 = {1,
98  pindex_point_1_in_child_0,
99  pweight_point_0_or_1};
100 
101 static int pindex_point_0_in_child_1[1] = {1};
102 static VINHERIT vinherit_point_0_in_child_1 = {1,
103  pindex_point_0_in_child_1,
104  pweight_point_0_or_1};
105 
106 static int pindex_point_1_in_child_1[1] = {2};
107 static VINHERIT vinherit_point_1_in_child_1 = {1,
108  pindex_point_1_in_child_1,
109  pweight_point_0_or_1};
110 
111 static int pindex_point_2[2] = {0 ,1 };
112 static double pweight_point_2[2] = {0.5,0.5};
113 static VINHERIT vinherit_point_2 = {2,pindex_point_2,pweight_point_2};
114 
115 
116 /*****************************************************************************
117 ******************************************************************************
118 ** **
119 ** Die HEL_DESCR Routinen "neighbour, boundary, check_inside, **
120 ** world2coord, coord2world" **
121 ** **
122 ******************************************************************************
123 *****************************************************************************/
124 
125 inline static HELEMENT2D * triangle_neighbour(HELEMENT2D *el, int np, int flag,
126 
127  double * coord, double * xyz, MESH_ELEMENT_FLAGS p) {
128  printf(" neighbour nicht implementiert \n");
129  return el ;
130 }
131 
132 inline int triangle_boundary(HELEMENT2D * el, int np) {
133  return ((DUNE_ELEM *)el->user_data)->bnd[np] ;
134 }
135 
136 /***********************************************************************
137  *
138  * the functions check_inside, world2coord and coord2world
139  * work for all types of elements
140  *
141  ***********************************************************************/
142 
143 /* the 2d versions */
144 inline int el_check_inside(HELEMENT2D * e, const double * coord)
145 {
146  DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data;
147  return dat->check_inside((DUNE_ELEM *) e->user_data, coord);
148 }
149 
150 inline int world2coord(HELEMENT2D * e, const double * xyz,double * coord)
151 {
152  DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data;
153  return dat->wtoc((DUNE_ELEM *) e->user_data, xyz, coord);
154 }
155 
156 inline void coord2world(HELEMENT2D * e, const double * coord,double * xyz)
157 {
158  DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data;
159  dat->ctow((DUNE_ELEM *) e->user_data, coord, xyz);
160 }
161 
162 /* the 3d versions */
163 inline int el_check_inside_3d(HELEMENT3D * e, double * coord)
164 {
165  DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data;
166  return dat->check_inside((DUNE_ELEM *) e->user_data, coord);
167 }
168 
169 inline static int world2coord_3d(HELEMENT3D * e, const double * xyz,
170  double * coord)
171 {
172  DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data;
173  return dat->wtoc((DUNE_ELEM *) e->user_data, xyz, coord);
174 }
175 
176 inline static void coord2world_3d(HELEMENT3D * e, const double * coord,
177  double * xyz)
178 {
179  DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data;
180  dat->ctow((DUNE_ELEM *) e->user_data, coord, xyz);
181 }
182 
183 /*****************************************************************************
184 * HELEMENT2D_DESCRIPTION for Quadrilaterals *
185 *****************************************************************************/
186 
187 /****************************************************************************/
188 /* Eckpunkte :
189  *
190  *
191  * (0,1) 3---------2 (1,1)
192  * | |
193  * | |
194  * | |
195  * | |
196  * | |
197  * (0,0) 0---------1 (1,0)
198  *
199  * this is the dune local coordinate system
200  ***************************************************************************/
201 
202 static bool Grape_ReferenceElementsInitialized = false ;
203 
204 static HELEMENT2D_DESCRIPTION quadrilateral_description;
205 
206 static double quadrilateral_local_coordinate_vector_0[3] = {0.,0.,0.};
207 static double quadrilateral_local_coordinate_vector_1[3] = {1.,0.,0.};
208 static double quadrilateral_local_coordinate_vector_2[3] = {1.,1.,0.};
209 static double quadrilateral_local_coordinate_vector_3[3] = {0.,1.,0.};
210 
211 static G_CONST double *quadrilateral_local_coordinate_system[4] = {quadrilateral_local_coordinate_vector_0,
212  quadrilateral_local_coordinate_vector_1,quadrilateral_local_coordinate_vector_2,
213  quadrilateral_local_coordinate_vector_3};
214 
215 
216 
217 /*****************************************************************************
218  * HELEMENT3D_DESCRIPTION for Tetrahedra *
219 *****************************************************************************/
220 
221 static HELEMENT3D_DESCRIPTION tetra_description;
222 
223 /* vertex indices of the polygons (faces) for a tetrahedron */
224 static int t_v0_e[3] = {1,3,2}, t_v1_e[3] = {0,2,3};
225 static int t_v2_e[3] = {0,3,1}, t_v3_e[3] = {0,1,2};
226 
227 /* polygon adjacencies for a tetrahedron */
228 static int t_p0_e[3] = {2,1,3}, t_p1_e[3] = {3,0,2};
229 static int t_p2_e[3] = {1,0,3}, t_p3_e[3] = {2,0,1};
230 
231 /* local coordinates of the vertices for a tetrahedron in barycentric
232  * coords */
233 //static double t_c0[4] = {1.,0.,0.,0.}, t_c1[4] = {0.,1.,0.,0.};
234 //static double t_c2[4] = {0.,0.,1.,0.}, t_c3[4] = {0.,0.,0.,1.};
235 /* local coordinates of the vertices for a tetrahedron */
236 static double t_c0[3] = {0.,0.,0.}, t_c1[3] = {1.,0.,0.};
237 static double t_c2[3] = {0.,1.,0.}, t_c3[3] = {0.,0.,1.};
238 
239 static int tetra_polygon_length[4] = {3, 3, 3, 3};
240 static G_CONST int *tetra_vertex_e[4] = {t_v0_e,t_v1_e,t_v2_e,t_v3_e};
241 static G_CONST int *tetra_next_polygon_e[4] = {t_p0_e,t_p1_e,t_p2_e,t_p3_e};
242 static G_CONST double *tetra_local_coordinate_system[4] = {t_c0,t_c1,t_c2,t_c3};
243 
244 /*****************************************************************************
245 ******************************************************************************
246 ** **
247 ** Die HEL_DESCR Routinen "neighbour, boundary, check_inside, **
248 ** world2coord, coord2world" **
249 ** **
250 ******************************************************************************
251 *****************************************************************************/
252 
253 inline static HELEMENT3D * dummy_neighbour(HELEMENT3D *el, int np, int flag,
254 
255  double * coord, double * xyz, MESH_ELEMENT_FLAGS p) {
256 
257  printf(" neighbour nicht implementiert \n");
258  return el ;
259 
260 }
261 
262 inline static int wrap_boundary(HELEMENT3D * el, int np)
263 {
264  return ((DUNE_ELEM *)el->user_data)->bnd[np] ;
265 }
266 
267 /*****************************************************************************
268  * HELEMENT3D_DESCRIPTION for Hexahedra *
269 *****************************************************************************/
270 /****************************************************************************/
271 /* Eckpunkte und Seitenflaechen in GRAPE:
272  * 7---------6
273  * /. /|
274  * / . 1 / |
275  * / . / |
276  * 4---------5 | <-- 4 (hinten)
277  * 5 --> | . | 3 |
278  * | 3.....|...2
279  * | . | /
280  * | . 2 | / <-- 0 (unten)
281  * |. |/
282  * 0---------1
283  *
284  * this is the GRAPE local coordinate system
285  *
286  ***************************************************************************
287  *
288  * Eckpunkte und Seitenflaechen in DUNE:
289  *
290  * 6---------7
291  * /. /|
292  * / . 5 / |
293  * / . / |
294  * 4---------5 | <-- 3 (hinten)
295  * 0 --> | . | 1 |
296  * | 2.....|...3
297  * | . | /
298  * | . 2 | / <-- 4 (unten)
299  * |. |/
300  * 0---------1
301  *
302  * this is the DUNE local coordinate system
303  ***************************************************************************/
304 static HELEMENT3D_DESCRIPTION cube_description;
305 
306 
307 static VEC3 cc1={0.,0.,0.},cc2={1.,0.,0.},cc3={1.,1.,0.},cc4={0.,1.,0.},
308  cc5={0.,0.,1.},cc6={1.,0.,1.},cc7={1.,1.,1.},cc8={0.,1.,1.};
309 static G_CONST double *cube_local_coordinate_system[8] = {cc1,cc2,cc3,cc4,cc5,cc6,cc7,cc8};
310 // how many polygons on which face
311 static int cube_polygon_length[6] = {4,4,4,4,4,4};
312 // vertices of the faces
313 static int cv1[4]={0,3,2,1},cv2[4]={4,5,6,7},cv3[4]={0,1,5,4},
314  cv4[4]={1,2,6,5},cv5[4]={2,3,7,6},cv6[4]={0,4,7,3};
315 static G_CONST int *cube_polygon_vertex[6] = {cv1,cv2,cv3,cv4,cv5,cv6};
316 static int cn1[4]={5,4,3,2},cn2[4]={2,3,4,5},cn3[4]={0,3,1,5},
317  cn4[4]={0,4,1,2},cn5[4]={0,5,1,3},cn6[4]={2,1,4,0};
318 static G_CONST int *cube_polygon_neighbour[6] = {cn1,cn2,cn3,cn4,cn5,cn6};
319 
320 
321 /*****************************************************************************/
322 /*****************************************************************************/
323 /*****************************************************************************/
324 /*****************************************************************************/
325 /*****************************************************************************/
326 /*****************************************************************************
327  * HELEMENT3D_DESCRIPTION for Pyramids *
328 *****************************************************************************/
329 static HELEMENT3D_DESCRIPTION pyra_description;
330 
331 static VEC3 pyc1={0.,0.,0.},pyc2={1.,0.,0.},pyc3={1.,1.,0.},
332  pyc4={0.,1.,0.},pyc5={0.,0.,1.};
333 static G_CONST double *pyra_local_coordinate_system[5] = {pyc1,pyc2,pyc3,pyc4,pyc5};
334 
335 static int pyra_polygon_length[5] = {4,3,3,3,3};
336 static int pyv1[4]={0,1,2,3},pyv2[3]={0,4,1},pyv3[3]={1,4,2},
337  pyv4[3]={2,4,3} ,pyv5[3]={0,3,4};
338 static G_CONST int *pyra_polygon_vertex[5] = {pyv1,pyv2,pyv3,pyv4,pyv5};
339 
340 static int pyn1[4]={5,4,3,2},pyn2[3]={0,2,4},pyn3[3]={0,3,1},
341  pyn4[3]={0,4,2} ,pyn5[3]={0,1,3};
342 static G_CONST int *pyra_polygon_neighbour[5] = {pyn1,pyn2,pyn3,pyn4,pyn5};
343 
344 /*****************************************************************************/
345 /*****************************************************************************/
346 /*****************************************************************************/
347 /*****************************************************************************/
348 /*****************************************************************************/
349 /*****************************************************************************/
350 /*****************************************************************************
351  * HELEMENT3D_DESCRIPTION for Prism *
352 *****************************************************************************/
353 static HELEMENT3D_DESCRIPTION prism_description;
354 
355 static VEC3 prc1={0.,0.,0.},prc2={1.,0.,0.},prc3={0.,1.,0.},
356  prc4={0.,0.,1.},prc5={1.,0.,1.},prc6={0.,1.,1.};
357 static G_CONST double *prism_local_coordinate_system[6] = {prc1,prc2,prc3,prc4,prc5,prc6};
358 
359 // how many polygons on which face
360 static int prism_polygon_length[5] = {3,4,4,4,3};
361 
362 // vertices of the faces
363 static int prv1[3]={0,1,2}, prv2[4]={0,1,4,3},prv3[4]={1,2,5,4},
364  prv4[4]={2,0,3,5},prv5[3]={3,4,5};
365 
366 static G_CONST int *prism_polygon_vertex[5] = {prv1,prv2,prv3,prv4,prv5};
367 
368 static int prn1[4]={5,4,3,2},prn2[4]={2,3,4,5},prn3[4]={0,3,1,5},
369  prn4[4]={0,4,1,2},prn5[4]={0,5,1,3},prn6[4]={2,1,4,0};
370 static G_CONST int *prism_polygon_neighbour[6] = {prn1,prn2,prn3,prn4,prn5,prn6};
371 
372 /* Standard description */
373 /****************************************************************************/
374 /* fill the upper reference elements */
375 inline void setupReferenceElements()
376 {
377  if( ! Grape_ReferenceElementsInitialized )
378  {
379  /* fill the helement description in 2D*/
380 
381  triangle_description.dindex = gr_triangle; // index of description
382  triangle_description.number_of_vertices = 3;
383  /* dimension of local coords */
384  triangle_description.dimension_of_coord = GRAPE_DIM;
385  triangle_description.coord = triangle_local_coordinate_system;
386  triangle_description.parametric_degree = 1;
387  triangle_description.world_to_coord = world2coord;
388  triangle_description.coord_to_world = coord2world;
389  triangle_description.check_inside = el_check_inside;
390  triangle_description.neighbour = triangle_neighbour;
391  triangle_description.boundary = triangle_boundary;
392 
393 
394  quadrilateral_description.dindex = gr_quadrilateral; // index of description
395  quadrilateral_description.number_of_vertices = 4;
396  quadrilateral_description.dimension_of_coord = GRAPE_DIM;
397  quadrilateral_description.coord = quadrilateral_local_coordinate_system;
398  quadrilateral_description.parametric_degree = 1;
399  quadrilateral_description.world_to_coord = world2coord;
400  quadrilateral_description.coord_to_world = coord2world;
401  quadrilateral_description.check_inside = el_check_inside;
402  quadrilateral_description.neighbour = triangle_neighbour;
403  quadrilateral_description.boundary = triangle_boundary;
404 
405  /* fill the helement description in 3D*/
406 
407  tetra_description.dindex = gr_tetrahedron; // index of description
408  tetra_description.number_of_vertices = 4;
409  tetra_description.number_of_polygons = 4; // i.e. number of faces
410  tetra_description.polygon_length = tetra_polygon_length;
411  tetra_description.polygon_vertex = tetra_vertex_e;
412  tetra_description.polygon_neighbour = tetra_next_polygon_e;
413  tetra_description.dimension_of_coord = 3; // GRAPE_DIM
414  tetra_description.coord = tetra_local_coordinate_system;
415  tetra_description.parametric_degree = 1;
416  tetra_description.world_to_coord = world2coord_3d;
417  tetra_description.coord_to_world = coord2world_3d;
418  tetra_description.check_inside = el_check_inside_3d;
419  tetra_description.neighbour = dummy_neighbour;
420  tetra_description.boundary = wrap_boundary;
421  tetra_description.get_boundary_vertex_estimate = NULL;
422  tetra_description.get_boundary_face_estimate = NULL;
423  tetra_description.coord_of_parent = NULL;
424 
425  /* pyramid */
426  pyra_description.dindex = gr_pyramid; // index of description , see element type
427  pyra_description.number_of_vertices = 5;
428  pyra_description.number_of_polygons = 5; // i.e. number of faces
429  pyra_description.polygon_length = pyra_polygon_length;
430  pyra_description.polygon_vertex = pyra_polygon_vertex;
431  pyra_description.polygon_neighbour = pyra_polygon_neighbour;
432  pyra_description.dimension_of_coord = 3; // GRAPE_DIM
433  pyra_description.coord = pyra_local_coordinate_system;
434  pyra_description.parametric_degree = 1;
435  pyra_description.world_to_coord = world2coord_3d;
436  pyra_description.coord_to_world = coord2world_3d;
437  pyra_description.check_inside = el_check_inside_3d;
438  pyra_description.neighbour = dummy_neighbour;
439  pyra_description.boundary = wrap_boundary;
440  pyra_description.get_boundary_vertex_estimate = NULL;
441  pyra_description.get_boundary_face_estimate = NULL;
442  pyra_description.coord_of_parent = NULL;
443 
444  /* prism */
445  prism_description.dindex = gr_prism; // index of description
446  prism_description.number_of_vertices = 6;
447  prism_description.number_of_polygons = 5; // i.e. number of faces
448  prism_description.polygon_length = prism_polygon_length;
449  prism_description.polygon_vertex = prism_polygon_vertex;
450  prism_description.polygon_neighbour = prism_polygon_neighbour;
451  prism_description.dimension_of_coord = 3; // GRAPE_DIM
452  prism_description.coord = prism_local_coordinate_system;
453  prism_description.parametric_degree = 1;
454  prism_description.world_to_coord = world2coord_3d;
455  prism_description.coord_to_world = coord2world_3d;
456  prism_description.check_inside = el_check_inside_3d;
457  prism_description.neighbour = dummy_neighbour;
458  prism_description.boundary = wrap_boundary;
459  prism_description.get_boundary_vertex_estimate = NULL;
460  prism_description.get_boundary_face_estimate = NULL;
461  prism_description.coord_of_parent = NULL;
462 
463  /* Hexahedrons */
464  cube_description.dindex = gr_hexahedron; // index of description
465  cube_description.number_of_vertices = 8;
466  cube_description.number_of_polygons = 6; // i.e. number of faces
467  cube_description.polygon_length = cube_polygon_length;
468  cube_description.polygon_vertex = cube_polygon_vertex;
469  cube_description.polygon_neighbour = cube_polygon_neighbour;
470  cube_description.dimension_of_coord = 3; // GRAPE_DIM
471  cube_description.coord = cube_local_coordinate_system;
472  cube_description.parametric_degree = 1;
473  cube_description.world_to_coord = world2coord_3d;
474  cube_description.coord_to_world = coord2world_3d;
475  cube_description.check_inside = el_check_inside_3d;
476  cube_description.neighbour = dummy_neighbour;
477  cube_description.boundary = wrap_boundary;
478  cube_description.get_boundary_vertex_estimate = NULL;
479  cube_description.get_boundary_face_estimate = NULL;
480  cube_description.coord_of_parent = NULL;
481 
482 
483  /* inheritance rules */
484  inheritance_rule_in_child_0[0] = vinherit_point_0_in_child_0;
485  inheritance_rule_in_child_0[1] = vinherit_point_1_in_child_0;
486  inheritance_rule_in_child_0[2] = vinherit_point_2;
487 
488  inheritance_rule_in_child_1[0] = vinherit_point_0_in_child_1;
489  inheritance_rule_in_child_1[1] = vinherit_point_1_in_child_1;
490  inheritance_rule_in_child_1[2] = vinherit_point_2;
491 
492  Grape_ReferenceElementsInitialized = true ;
493  }
494 }
495 
496 //vector holding the descriptions enumerated after it's index
497 static void *
498 elementDescriptions[numberOfUsedGrapeElementTypes] = {
499  (void *) &triangle_description,
500  (void *) &quadrilateral_description,
501  (void *) &tetra_description,
502  (void *) &pyra_description,
503  (void *) &prism_description,
504  (void *) &cube_description
505 };
506 
507 // the mapping of the reference elements
508 static const int dune2GrapeDefaultMap[MAX_EL_DOF] = {0,1,2,3,4,5,6,7};
509 static const int * dune2GrapeTriangle = dune2GrapeDefaultMap;
510 static const int * dune2GrapeTetrahedron = dune2GrapeDefaultMap;
511 static const int * dune2GrapePrism = dune2GrapeDefaultMap;
512 
513 // for quads the vertices 2,3 are swaped
514 static const int dune2GrapeQuadrilateral[MAX_EL_DOF] = {0,1,3,2,4,5,6,7};
515 // for hexas the vertices 2,3 and 6,7 are swaped
516 static const int dune2GrapeHexahedron[MAX_EL_DOF] = {0,1,3,2,4,5,7,6};
517 
518 // For pyramids the vertices 2,3 are swapped (in the generic geometries)
519 static const int dune2GrapePyramid[ MAX_EL_DOF ] = {0,1,3,2,4,5,6,7};
520 
521 // mapping from dune to grape
522 static const int *
523 dune2GrapeVertex[numberOfUsedGrapeElementTypes] = {
524  dune2GrapeTriangle ,
525  dune2GrapeQuadrilateral ,
526  dune2GrapeTetrahedron,
527  dune2GrapePyramid ,
528  dune2GrapePrism ,
529  dune2GrapeHexahedron
530 };
532 // face mappings
534 
535 // the mapping of the reference faces
536 static const int dune2GrapeDefaultFace[MAX_EL_FACE] = {0,1,2,3,4,5};
537 
538 // triangle face mapping
539 static const int dune2GrapeTriangleFace[MAX_EL_FACE] = {2,1,0,3,4,5};
540 
541 // tetrahedron face mapping
542 static const int dune2GrapeTetrahedronFace[MAX_EL_FACE] = {3,2,1,0,4,5};
543 
544 // hexahedron face mapping
545 static const int dune2GrapeHexahedronFace[MAX_EL_FACE] = {5,3,2,4,0,1};
546 
547 // using default mapping here
548 static const int * dune2GrapeQuadrilateralFace = dune2GrapeDefaultFace;
549 static const int * dune2GrapePrismFace = dune2GrapeDefaultFace;
550 static const int * dune2GrapePyramidFace = dune2GrapeDefaultFace;
551 
552 // mapping from dune to grape
553 static const int *
554 dune2GrapeFace[numberOfUsedGrapeElementTypes] = {
555  dune2GrapeTriangleFace ,
556  dune2GrapeQuadrilateralFace ,
557  dune2GrapeTetrahedronFace,
558  dune2GrapePyramidFace ,
559  dune2GrapePrismFace ,
560  dune2GrapeHexahedronFace
561 };
562 
563 static H_ELEMENT_DESCRIPTION * getElementDescription( int type )
564 {
565  assert( type >= 0 );
566  assert( type < numberOfUsedGrapeElementTypes );
567  return (H_ELEMENT_DESCRIPTION * )elementDescriptions[type];
568 }
569 #endif
570 
571 #endif