- Home
- About DUNE
- Download
- Documentation
- Community
- Development
00001 #ifndef __GRAPE_ELDESC_H__ 00002 #define __GRAPE_ELDESC_H__ 00003 00004 #if HAVE_GRAPE 00005 00006 #include "ghmesh.hh" 00007 00008 #ifndef GRAPE_DIM 00009 #define GRAPE_DIM 3 00010 #endif 00011 00012 #if GRAPE_DIM==3 00013 typedef HELEMENT3D HELEMENT; 00014 typedef ELEMENT3D ELEMENT; 00015 typedef HMESH3D HMESH; 00016 typedef HMESH GRAPEMESH; 00017 typedef GENMESH3D GENMESHnD; 00018 typedef HELEMENT3D_DESCRIPTION H_ELEMENT_DESCRIPTION; 00019 typedef ELEMENT3D_DESCRIPTION ELEMENT_DESCRIPTION; 00020 typedef F_HDATA3D F_DATA; 00021 typedef F_HEL_INFO3D F_EL_INFO; 00022 #define HMesh HMesh3d 00023 #define GenMesh GenMesh3d 00024 #define GrapeMesh HMesh 00025 #else 00026 typedef HELEMENT2D HELEMENT; 00027 typedef ELEMENT2D ELEMENT; 00028 typedef GENMESH2D GENMESHnD; 00029 typedef HELEMENT2D_DESCRIPTION H_ELEMENT_DESCRIPTION; 00030 typedef ELEMENT2D_DESCRIPTION ELEMENT_DESCRIPTION; 00031 typedef F_HEL_INFO2D F_EL_INFO; 00032 00033 // definitions for using HPMesh2d 00034 typedef HPMESH2D HMESH; 00035 typedef F_HPDATA2D F_DATA; 00036 #define HMesh HPMesh2d 00037 00038 // definitions for using Mesh2d 00039 //typedef HMESH2D HMESH; 00040 //typedef F_HDATA2D F_DATA; 00041 //#define HMesh HMesh2d 00042 00043 typedef HMESH GRAPEMESH; 00044 #define GenMesh GenMesh2d 00045 #define GrapeMesh HMesh 00046 #endif 00047 00048 /**************************************************************************/ 00049 /* element types, see dune/grid/common/grid.hh and grapegriddisplay.hh */ 00050 enum GR_ElementType 00051 {gr_vertex=6,gr_line=7, 00052 // here consecutive numbering from zero that this numbers can be used 00053 // in an array starting from 0 00054 gr_triangle=0, gr_quadrilateral=1,gr_tetrahedron=2, 00055 gr_pyramid=3, gr_prism=4, gr_hexahedron=5, 00056 gr_iso_triangle=8, gr_iso_quadrilateral=9, 00057 gr_unknown=127}; 00058 enum { numberOfUsedGrapeElementTypes = 6 }; 00059 00060 /***************************************************************************** 00061 * HELEMENT2D_DESCRIPTION for Triangles * 00062 *****************************************************************************/ 00063 00064 00065 static HELEMENT2D_DESCRIPTION triangle_description; 00066 00067 static double triangle_local_coordinate_vector_0[3] = {0.,0.,0.}; 00068 static double triangle_local_coordinate_vector_1[3] = {1.,0.,0.}; 00069 static double triangle_local_coordinate_vector_2[3] = {0.,1.,0.}; 00070 00071 static G_CONST double *triangle_local_coordinate_system[3] = {triangle_local_coordinate_vector_0, 00072 triangle_local_coordinate_vector_1, 00073 triangle_local_coordinate_vector_2}; 00074 00075 /* inheritance-rules: 00076 2 0 1 00077 /\ /| |\ 00078 / \ C0 / | | \ C1 00079 / \ => / | | \ 00080 / \ / | | \ 00081 0--------1 1----2 2----0 00082 */ 00083 00084 // NOTE: To be revised 00085 static VINHERIT inheritance_rule_in_child_0[3]; 00086 static VINHERIT inheritance_rule_in_child_1[3]; 00087 00088 static double pweight_point_0_or_1[1] = {1.0}; 00089 00090 static int pindex_point_0_in_child_0[1] = {2}; 00091 static VINHERIT vinherit_point_0_in_child_0 = {1, 00092 pindex_point_0_in_child_0, 00093 pweight_point_0_or_1}; 00094 00095 00096 static int pindex_point_1_in_child_0[1] = {0}; 00097 static VINHERIT vinherit_point_1_in_child_0 = {1, 00098 pindex_point_1_in_child_0, 00099 pweight_point_0_or_1}; 00100 00101 static int pindex_point_0_in_child_1[1] = {1}; 00102 static VINHERIT vinherit_point_0_in_child_1 = {1, 00103 pindex_point_0_in_child_1, 00104 pweight_point_0_or_1}; 00105 00106 static int pindex_point_1_in_child_1[1] = {2}; 00107 static VINHERIT vinherit_point_1_in_child_1 = {1, 00108 pindex_point_1_in_child_1, 00109 pweight_point_0_or_1}; 00110 00111 static int pindex_point_2[2] = {0 ,1 }; 00112 static double pweight_point_2[2] = {0.5,0.5}; 00113 static VINHERIT vinherit_point_2 = {2,pindex_point_2,pweight_point_2}; 00114 00115 00116 /***************************************************************************** 00117 ****************************************************************************** 00118 ** ** 00119 ** Die HEL_DESCR Routinen "neighbour, boundary, check_inside, ** 00120 ** world2coord, coord2world" ** 00121 ** ** 00122 ****************************************************************************** 00123 *****************************************************************************/ 00124 00125 inline static HELEMENT2D * triangle_neighbour(HELEMENT2D *el, int np, int flag, 00126 00127 double * coord, double * xyz, MESH_ELEMENT_FLAGS p) { 00128 printf(" neighbour nicht implementiert \n"); 00129 return el ; 00130 } 00131 00132 inline int triangle_boundary(HELEMENT2D * el, int np) { 00133 return ((DUNE_ELEM *)el->user_data)->bnd[np] ; 00134 } 00135 00136 /*********************************************************************** 00137 * 00138 * the functions check_inside, world2coord and coord2world 00139 * work for all types of elements 00140 * 00141 ***********************************************************************/ 00142 00143 /* the 2d versions */ 00144 inline int el_check_inside(HELEMENT2D * e, const double * coord) 00145 { 00146 DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data; 00147 return dat->check_inside((DUNE_ELEM *) e->user_data, coord); 00148 } 00149 00150 inline int world2coord(HELEMENT2D * e, const double * xyz,double * coord) 00151 { 00152 DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data; 00153 return dat->wtoc((DUNE_ELEM *) e->user_data, xyz, coord); 00154 } 00155 00156 inline void coord2world(HELEMENT2D * e, const double * coord,double * xyz) 00157 { 00158 DUNE_DAT * dat = (DUNE_DAT *) ((HMESH2D *) e->mesh)->user_data; 00159 dat->ctow((DUNE_ELEM *) e->user_data, coord, xyz); 00160 } 00161 00162 /* the 3d versions */ 00163 inline int el_check_inside_3d(HELEMENT3D * e, double * coord) 00164 { 00165 DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data; 00166 return dat->check_inside((DUNE_ELEM *) e->user_data, coord); 00167 } 00168 00169 inline static int world2coord_3d(HELEMENT3D * e, const double * xyz, 00170 double * coord) 00171 { 00172 DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data; 00173 return dat->wtoc((DUNE_ELEM *) e->user_data, xyz, coord); 00174 } 00175 00176 inline static void coord2world_3d(HELEMENT3D * e, const double * coord, 00177 double * xyz) 00178 { 00179 DUNE_DAT * dat = (DUNE_DAT *) ((HMESH3D *) e->mesh)->user_data; 00180 dat->ctow((DUNE_ELEM *) e->user_data, coord, xyz); 00181 } 00182 00183 /***************************************************************************** 00184 * HELEMENT2D_DESCRIPTION for Quadrilaterals * 00185 *****************************************************************************/ 00186 00187 /****************************************************************************/ 00188 /* Eckpunkte : 00189 * 00190 * 00191 * (0,1) 3---------2 (1,1) 00192 * | | 00193 * | | 00194 * | | 00195 * | | 00196 * | | 00197 * (0,0) 0---------1 (1,0) 00198 * 00199 * this is the dune local coordinate system 00200 ***************************************************************************/ 00201 00202 static bool Grape_ReferenceElementsInitialized = false ; 00203 00204 static HELEMENT2D_DESCRIPTION quadrilateral_description; 00205 00206 static double quadrilateral_local_coordinate_vector_0[3] = {0.,0.,0.}; 00207 static double quadrilateral_local_coordinate_vector_1[3] = {1.,0.,0.}; 00208 static double quadrilateral_local_coordinate_vector_2[3] = {1.,1.,0.}; 00209 static double quadrilateral_local_coordinate_vector_3[3] = {0.,1.,0.}; 00210 00211 static G_CONST double *quadrilateral_local_coordinate_system[4] = {quadrilateral_local_coordinate_vector_0, 00212 quadrilateral_local_coordinate_vector_1,quadrilateral_local_coordinate_vector_2, 00213 quadrilateral_local_coordinate_vector_3}; 00214 00215 00216 00217 /***************************************************************************** 00218 * HELEMENT3D_DESCRIPTION for Tetrahedra * 00219 *****************************************************************************/ 00220 00221 static HELEMENT3D_DESCRIPTION tetra_description; 00222 00223 /* vertex indices of the polygons (faces) for a tetrahedron */ 00224 static int t_v0_e[3] = {1,3,2}, t_v1_e[3] = {0,2,3}; 00225 static int t_v2_e[3] = {0,3,1}, t_v3_e[3] = {0,1,2}; 00226 00227 /* polygon adjacencies for a tetrahedron */ 00228 static int t_p0_e[3] = {2,1,3}, t_p1_e[3] = {3,0,2}; 00229 static int t_p2_e[3] = {1,0,3}, t_p3_e[3] = {2,0,1}; 00230 00231 /* local coordinates of the vertices for a tetrahedron in barycentric 00232 * coords */ 00233 //static double t_c0[4] = {1.,0.,0.,0.}, t_c1[4] = {0.,1.,0.,0.}; 00234 //static double t_c2[4] = {0.,0.,1.,0.}, t_c3[4] = {0.,0.,0.,1.}; 00235 /* local coordinates of the vertices for a tetrahedron */ 00236 static double t_c0[3] = {0.,0.,0.}, t_c1[3] = {1.,0.,0.}; 00237 static double t_c2[3] = {0.,1.,0.}, t_c3[3] = {0.,0.,1.}; 00238 00239 static int tetra_polygon_length[4] = {3, 3, 3, 3}; 00240 static G_CONST int *tetra_vertex_e[4] = {t_v0_e,t_v1_e,t_v2_e,t_v3_e}; 00241 static G_CONST int *tetra_next_polygon_e[4] = {t_p0_e,t_p1_e,t_p2_e,t_p3_e}; 00242 static G_CONST double *tetra_local_coordinate_system[4] = {t_c0,t_c1,t_c2,t_c3}; 00243 00244 /***************************************************************************** 00245 ****************************************************************************** 00246 ** ** 00247 ** Die HEL_DESCR Routinen "neighbour, boundary, check_inside, ** 00248 ** world2coord, coord2world" ** 00249 ** ** 00250 ****************************************************************************** 00251 *****************************************************************************/ 00252 00253 inline static HELEMENT3D * dummy_neighbour(HELEMENT3D *el, int np, int flag, 00254 00255 double * coord, double * xyz, MESH_ELEMENT_FLAGS p) { 00256 00257 printf(" neighbour nicht implementiert \n"); 00258 return el ; 00259 00260 } 00261 00262 inline static int wrap_boundary(HELEMENT3D * el, int np) 00263 { 00264 return ((DUNE_ELEM *)el->user_data)->bnd[np] ; 00265 } 00266 00267 /***************************************************************************** 00268 * HELEMENT3D_DESCRIPTION for Hexahedra * 00269 *****************************************************************************/ 00270 /****************************************************************************/ 00271 /* Eckpunkte und Seitenflaechen in GRAPE: 00272 * 7---------6 00273 * /. /| 00274 * / . 1 / | 00275 * / . / | 00276 * 4---------5 | <-- 4 (hinten) 00277 * 5 --> | . | 3 | 00278 * | 3.....|...2 00279 * | . | / 00280 * | . 2 | / <-- 0 (unten) 00281 * |. |/ 00282 * 0---------1 00283 * 00284 * this is the GRAPE local coordinate system 00285 * 00286 *************************************************************************** 00287 * 00288 * Eckpunkte und Seitenflaechen in DUNE: 00289 * 00290 * 6---------7 00291 * /. /| 00292 * / . 5 / | 00293 * / . / | 00294 * 4---------5 | <-- 3 (hinten) 00295 * 0 --> | . | 1 | 00296 * | 2.....|...3 00297 * | . | / 00298 * | . 2 | / <-- 4 (unten) 00299 * |. |/ 00300 * 0---------1 00301 * 00302 * this is the DUNE local coordinate system 00303 ***************************************************************************/ 00304 static HELEMENT3D_DESCRIPTION cube_description; 00305 00306 00307 static VEC3 cc1={0.,0.,0.},cc2={1.,0.,0.},cc3={1.,1.,0.},cc4={0.,1.,0.}, 00308 cc5={0.,0.,1.},cc6={1.,0.,1.},cc7={1.,1.,1.},cc8={0.,1.,1.}; 00309 static G_CONST double *cube_local_coordinate_system[8] = {cc1,cc2,cc3,cc4,cc5,cc6,cc7,cc8}; 00310 // how many polygons on which face 00311 static int cube_polygon_length[6] = {4,4,4,4,4,4}; 00312 // vertices of the faces 00313 static int cv1[4]={0,3,2,1},cv2[4]={4,5,6,7},cv3[4]={0,1,5,4}, 00314 cv4[4]={1,2,6,5},cv5[4]={2,3,7,6},cv6[4]={0,4,7,3}; 00315 static G_CONST int *cube_polygon_vertex[6] = {cv1,cv2,cv3,cv4,cv5,cv6}; 00316 static int cn1[4]={5,4,3,2},cn2[4]={2,3,4,5},cn3[4]={0,3,1,5}, 00317 cn4[4]={0,4,1,2},cn5[4]={0,5,1,3},cn6[4]={2,1,4,0}; 00318 static G_CONST int *cube_polygon_neighbour[6] = {cn1,cn2,cn3,cn4,cn5,cn6}; 00319 00320 00321 /*****************************************************************************/ 00322 /*****************************************************************************/ 00323 /*****************************************************************************/ 00324 /*****************************************************************************/ 00325 /*****************************************************************************/ 00326 /***************************************************************************** 00327 * HELEMENT3D_DESCRIPTION for Pyramids * 00328 *****************************************************************************/ 00329 static HELEMENT3D_DESCRIPTION pyra_description; 00330 00331 static VEC3 pyc1={0.,0.,0.},pyc2={1.,0.,0.},pyc3={1.,1.,0.}, 00332 pyc4={0.,1.,0.},pyc5={0.,0.,1.}; 00333 static G_CONST double *pyra_local_coordinate_system[5] = {pyc1,pyc2,pyc3,pyc4,pyc5}; 00334 00335 static int pyra_polygon_length[5] = {4,3,3,3,3}; 00336 static int pyv1[4]={0,1,2,3},pyv2[3]={0,4,1},pyv3[3]={1,4,2}, 00337 pyv4[3]={2,4,3} ,pyv5[3]={0,3,4}; 00338 static G_CONST int *pyra_polygon_vertex[5] = {pyv1,pyv2,pyv3,pyv4,pyv5}; 00339 00340 static int pyn1[4]={5,4,3,2},pyn2[3]={0,2,4},pyn3[3]={0,3,1}, 00341 pyn4[3]={0,4,2} ,pyn5[3]={0,1,3}; 00342 static G_CONST int *pyra_polygon_neighbour[5] = {pyn1,pyn2,pyn3,pyn4,pyn5}; 00343 00344 /*****************************************************************************/ 00345 /*****************************************************************************/ 00346 /*****************************************************************************/ 00347 /*****************************************************************************/ 00348 /*****************************************************************************/ 00349 /*****************************************************************************/ 00350 /***************************************************************************** 00351 * HELEMENT3D_DESCRIPTION for Prism * 00352 *****************************************************************************/ 00353 static HELEMENT3D_DESCRIPTION prism_description; 00354 00355 static VEC3 prc1={0.,0.,0.},prc2={1.,0.,0.},prc3={0.,1.,0.}, 00356 prc4={0.,0.,1.},prc5={1.,0.,1.},prc6={0.,1.,1.}; 00357 static G_CONST double *prism_local_coordinate_system[6] = {prc1,prc2,prc3,prc4,prc5,prc6}; 00358 00359 // how many polygons on which face 00360 static int prism_polygon_length[5] = {3,4,4,4,3}; 00361 00362 // vertices of the faces 00363 static int prv1[3]={0,1,2}, prv2[4]={0,1,4,3},prv3[4]={1,2,5,4}, 00364 prv4[4]={2,0,3,5},prv5[3]={3,4,5}; 00365 00366 static G_CONST int *prism_polygon_vertex[5] = {prv1,prv2,prv3,prv4,prv5}; 00367 00368 static int prn1[4]={5,4,3,2},prn2[4]={2,3,4,5},prn3[4]={0,3,1,5}, 00369 prn4[4]={0,4,1,2},prn5[4]={0,5,1,3},prn6[4]={2,1,4,0}; 00370 static G_CONST int *prism_polygon_neighbour[6] = {prn1,prn2,prn3,prn4,prn5,prn6}; 00371 00372 /* Standard description */ 00373 /****************************************************************************/ 00374 /* fill the upper reference elements */ 00375 inline void setupReferenceElements() 00376 { 00377 if( ! Grape_ReferenceElementsInitialized ) 00378 { 00379 /* fill the helement description in 2D*/ 00380 00381 triangle_description.dindex = gr_triangle; // index of description 00382 triangle_description.number_of_vertices = 3; 00383 /* dimension of local coords */ 00384 triangle_description.dimension_of_coord = GRAPE_DIM; 00385 triangle_description.coord = triangle_local_coordinate_system; 00386 triangle_description.parametric_degree = 1; 00387 triangle_description.world_to_coord = world2coord; 00388 triangle_description.coord_to_world = coord2world; 00389 triangle_description.check_inside = el_check_inside; 00390 triangle_description.neighbour = triangle_neighbour; 00391 triangle_description.boundary = triangle_boundary; 00392 00393 00394 quadrilateral_description.dindex = gr_quadrilateral; // index of description 00395 quadrilateral_description.number_of_vertices = 4; 00396 quadrilateral_description.dimension_of_coord = GRAPE_DIM; 00397 quadrilateral_description.coord = quadrilateral_local_coordinate_system; 00398 quadrilateral_description.parametric_degree = 1; 00399 quadrilateral_description.world_to_coord = world2coord; 00400 quadrilateral_description.coord_to_world = coord2world; 00401 quadrilateral_description.check_inside = el_check_inside; 00402 quadrilateral_description.neighbour = triangle_neighbour; 00403 quadrilateral_description.boundary = triangle_boundary; 00404 00405 /* fill the helement description in 3D*/ 00406 00407 tetra_description.dindex = gr_tetrahedron; // index of description 00408 tetra_description.number_of_vertices = 4; 00409 tetra_description.number_of_polygons = 4; // i.e. number of faces 00410 tetra_description.polygon_length = tetra_polygon_length; 00411 tetra_description.polygon_vertex = tetra_vertex_e; 00412 tetra_description.polygon_neighbour = tetra_next_polygon_e; 00413 tetra_description.dimension_of_coord = 3; // GRAPE_DIM 00414 tetra_description.coord = tetra_local_coordinate_system; 00415 tetra_description.parametric_degree = 1; 00416 tetra_description.world_to_coord = world2coord_3d; 00417 tetra_description.coord_to_world = coord2world_3d; 00418 tetra_description.check_inside = el_check_inside_3d; 00419 tetra_description.neighbour = dummy_neighbour; 00420 tetra_description.boundary = wrap_boundary; 00421 tetra_description.get_boundary_vertex_estimate = NULL; 00422 tetra_description.get_boundary_face_estimate = NULL; 00423 tetra_description.coord_of_parent = NULL; 00424 00425 /* pyramid */ 00426 pyra_description.dindex = gr_pyramid; // index of description , see element type 00427 pyra_description.number_of_vertices = 5; 00428 pyra_description.number_of_polygons = 5; // i.e. number of faces 00429 pyra_description.polygon_length = pyra_polygon_length; 00430 pyra_description.polygon_vertex = pyra_polygon_vertex; 00431 pyra_description.polygon_neighbour = pyra_polygon_neighbour; 00432 pyra_description.dimension_of_coord = 3; // GRAPE_DIM 00433 pyra_description.coord = pyra_local_coordinate_system; 00434 pyra_description.parametric_degree = 1; 00435 pyra_description.world_to_coord = world2coord_3d; 00436 pyra_description.coord_to_world = coord2world_3d; 00437 pyra_description.check_inside = el_check_inside_3d; 00438 pyra_description.neighbour = dummy_neighbour; 00439 pyra_description.boundary = wrap_boundary; 00440 pyra_description.get_boundary_vertex_estimate = NULL; 00441 pyra_description.get_boundary_face_estimate = NULL; 00442 pyra_description.coord_of_parent = NULL; 00443 00444 /* prism */ 00445 prism_description.dindex = gr_prism; // index of description 00446 prism_description.number_of_vertices = 6; 00447 prism_description.number_of_polygons = 5; // i.e. number of faces 00448 prism_description.polygon_length = prism_polygon_length; 00449 prism_description.polygon_vertex = prism_polygon_vertex; 00450 prism_description.polygon_neighbour = prism_polygon_neighbour; 00451 prism_description.dimension_of_coord = 3; // GRAPE_DIM 00452 prism_description.coord = prism_local_coordinate_system; 00453 prism_description.parametric_degree = 1; 00454 prism_description.world_to_coord = world2coord_3d; 00455 prism_description.coord_to_world = coord2world_3d; 00456 prism_description.check_inside = el_check_inside_3d; 00457 prism_description.neighbour = dummy_neighbour; 00458 prism_description.boundary = wrap_boundary; 00459 prism_description.get_boundary_vertex_estimate = NULL; 00460 prism_description.get_boundary_face_estimate = NULL; 00461 prism_description.coord_of_parent = NULL; 00462 00463 /* Hexahedrons */ 00464 cube_description.dindex = gr_hexahedron; // index of description 00465 cube_description.number_of_vertices = 8; 00466 cube_description.number_of_polygons = 6; // i.e. number of faces 00467 cube_description.polygon_length = cube_polygon_length; 00468 cube_description.polygon_vertex = cube_polygon_vertex; 00469 cube_description.polygon_neighbour = cube_polygon_neighbour; 00470 cube_description.dimension_of_coord = 3; // GRAPE_DIM 00471 cube_description.coord = cube_local_coordinate_system; 00472 cube_description.parametric_degree = 1; 00473 cube_description.world_to_coord = world2coord_3d; 00474 cube_description.coord_to_world = coord2world_3d; 00475 cube_description.check_inside = el_check_inside_3d; 00476 cube_description.neighbour = dummy_neighbour; 00477 cube_description.boundary = wrap_boundary; 00478 cube_description.get_boundary_vertex_estimate = NULL; 00479 cube_description.get_boundary_face_estimate = NULL; 00480 cube_description.coord_of_parent = NULL; 00481 00482 00483 /* inheritance rules */ 00484 inheritance_rule_in_child_0[0] = vinherit_point_0_in_child_0; 00485 inheritance_rule_in_child_0[1] = vinherit_point_1_in_child_0; 00486 inheritance_rule_in_child_0[2] = vinherit_point_2; 00487 00488 inheritance_rule_in_child_1[0] = vinherit_point_0_in_child_1; 00489 inheritance_rule_in_child_1[1] = vinherit_point_1_in_child_1; 00490 inheritance_rule_in_child_1[2] = vinherit_point_2; 00491 00492 Grape_ReferenceElementsInitialized = true ; 00493 } 00494 } 00495 00496 //vector holding the descriptions enumerated after it's index 00497 static void * 00498 elementDescriptions[numberOfUsedGrapeElementTypes] = { 00499 (void *) &triangle_description, 00500 (void *) &quadrilateral_description, 00501 (void *) &tetra_description, 00502 (void *) &pyra_description, 00503 (void *) &prism_description, 00504 (void *) &cube_description 00505 }; 00506 00507 // the mapping of the reference elements 00508 static const int dune2GrapeDefaultMap[MAX_EL_DOF] = {0,1,2,3,4,5,6,7}; 00509 static const int * dune2GrapeTriangle = dune2GrapeDefaultMap; 00510 static const int * dune2GrapeTetrahedron = dune2GrapeDefaultMap; 00511 static const int * dune2GrapePrism = dune2GrapeDefaultMap; 00512 00513 // for quads the vertices 2,3 are swaped 00514 static const int dune2GrapeQuadrilateral[MAX_EL_DOF] = {0,1,3,2,4,5,6,7}; 00515 // for hexas the vertices 2,3 and 6,7 are swaped 00516 static const int dune2GrapeHexahedron[MAX_EL_DOF] = {0,1,3,2,4,5,7,6}; 00517 00518 // For pyramids the vertices 2,3 are swapped (in the generic geometries) 00519 static const int dune2GrapePyramid[ MAX_EL_DOF ] = {0,1,3,2,4,5,6,7}; 00520 00521 // mapping from dune to grape 00522 static const int * 00523 dune2GrapeVertex[numberOfUsedGrapeElementTypes] = { 00524 dune2GrapeTriangle , 00525 dune2GrapeQuadrilateral , 00526 dune2GrapeTetrahedron, 00527 dune2GrapePyramid , 00528 dune2GrapePrism , 00529 dune2GrapeHexahedron 00530 }; 00532 // face mappings 00534 00535 // the mapping of the reference faces 00536 static const int dune2GrapeDefaultFace[MAX_EL_FACE] = {0,1,2,3,4,5}; 00537 00538 // triangle face mapping 00539 static const int dune2GrapeTriangleFace[MAX_EL_FACE] = {2,1,0,3,4,5}; 00540 00541 // tetrahedron face mapping 00542 static const int dune2GrapeTetrahedronFace[MAX_EL_FACE] = {3,2,1,0,4,5}; 00543 00544 // hexahedron face mapping 00545 static const int dune2GrapeHexahedronFace[MAX_EL_FACE] = {5,3,2,4,0,1}; 00546 00547 // using default mapping here 00548 static const int * dune2GrapeQuadrilateralFace = dune2GrapeDefaultFace; 00549 static const int * dune2GrapePrismFace = dune2GrapeDefaultFace; 00550 static const int * dune2GrapePyramidFace = dune2GrapeDefaultFace; 00551 00552 // mapping from dune to grape 00553 static const int * 00554 dune2GrapeFace[numberOfUsedGrapeElementTypes] = { 00555 dune2GrapeTriangleFace , 00556 dune2GrapeQuadrilateralFace , 00557 dune2GrapeTetrahedronFace, 00558 dune2GrapePyramidFace , 00559 dune2GrapePrismFace , 00560 dune2GrapeHexahedronFace 00561 }; 00562 00563 static H_ELEMENT_DESCRIPTION * getElementDescription( int type ) 00564 { 00565 assert( type >= 0 ); 00566 assert( type < numberOfUsedGrapeElementTypes ); 00567 return (H_ELEMENT_DESCRIPTION * )elementDescriptions[type]; 00568 } 00569 #endif 00570 00571 #endif
Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].