From e0dcfd7e7e19f1df6583bfd82b3a90e8738726b5 Mon Sep 17 00:00:00 2001 From: kanschat Date: Thu, 7 Jun 2007 22:41:22 +0000 Subject: [PATCH] rhombic dodecahedron implemented... need OpenDX for testing, though git-svn-id: https://svn.dealii.org/trunk@14766 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/grid_generator.cc | 63 +++++++++++++++---- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index 0741e91c57..8f7f154eb9 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -47,7 +47,7 @@ namespace #if deal_II_dimension == 3 // Corner points of the cube [-1,1]^3 - const Point<3> hexagon[8] = + const Point<3> hexahedron[8] = { Point<3>(-1,-1,-1), Point<3>(+1,-1,-1), @@ -2091,18 +2091,18 @@ void GridGenerator::hyper_shell (Triangulation& tria, if (n <= 6) { for (unsigned int i=0;i<8;++i) - vertices.push_back(p+hexagon[i]*irad); + vertices.push_back(p+hexahedron[i]*irad); for (unsigned int i=0;i<8;++i) - vertices.push_back(p+hexagon[i]*orad); - // one needs to draw the seven cubes to - // understand what's going on here + vertices.push_back(p+hexahedron[i]*orad); + const unsigned int n_cells = 6; - const int cell_vertices[n_cells][8] = {{8, 9, 10, 11, 0, 1, 2, 3}, // bottom - {9, 11, 1, 3, 13, 15, 5, 7}, // right - {12, 13, 4, 5, 14, 15, 6, 7}, // top - {8, 0, 10, 2, 12, 4, 14, 6}, // left - {8, 9, 0, 1, 12, 13, 4, 5}, // front - {10, 2, 11, 3, 14, 6, 15, 7}}; // back + const int cell_vertices[n_cells][8] = + {{8, 9, 10, 11, 0, 1, 2, 3}, // bottom + {9, 11, 1, 3, 13, 15, 5, 7}, // right + {12, 13, 4, 5, 14, 15, 6, 7}, // top + {8, 0, 10, 2, 12, 4, 14, 6}, // left + {8, 9, 0, 1, 12, 13, 4, 5}, // front + {10, 2, 11, 3, 14, 6, 15, 7}}; // back cells.resize(n_cells, CellData()); @@ -2112,6 +2112,47 @@ void GridGenerator::hyper_shell (Triangulation& tria, cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } + } + // A more regular subdivision can + // be obtained by two nested + // rhombic dodecahedra + else if (n <= 12) + { + for (unsigned int i=0;i<8;++i) + vertices.push_back(p+hexahedron[i]*irad); + for (unsigned int i=0;i<6;++i) + vertices.push_back(p+octahedron[i]*inner_radius); + for (unsigned int i=0;i<8;++i) + vertices.push_back(p+hexahedron[i]*orad); + for (unsigned int i=0;i<6;++i) + vertices.push_back(p+octahedron[i]*outer_radius); + + const unsigned int n_cells = 12; + const unsigned int rhombi[n_cells][4] = + {{ 10, 4, 0, 8}, + { 4, 13, 8, 6}, + { 10, 5, 4, 13}, + { 1, 9, 10, 5}, + { 9, 7, 5, 13}, + { 7, 11, 13, 6}, + { 9, 3, 7, 11}, + { 1, 12, 9, 3}, + { 12, 2, 3, 11}, + { 2, 8, 11, 6}, + { 12, 0, 2, 8}, + { 1, 10, 12, 0}}; + + cells.resize(n_cells, CellData()); + + for (unsigned int i=0; i