From: wolf Date: Wed, 6 Aug 2003 14:15:38 +0000 (+0000) Subject: Reenable hyperball in 3d (but doesn't work presently), and fix a bug in the cylinder... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a36dea8e12c5a6ece2732d89a28c236c70bbf31;p=dealii-svn.git Reenable hyperball in 3d (but doesn't work presently), and fix a bug in the cylinder code in which we didn't pass a consistent ordering of cells. git-svn-id: https://svn.dealii.org/trunk@7905 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index 87144cebde..8645257c57 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -794,30 +795,10 @@ GridGenerator::hyper_L (Triangulation<3> &tria, void -GridGenerator::hyper_ball (Triangulation<3> &/*tria*/, - const Point<3> &/*p*/, - const double /*radius*/) +GridGenerator::hyper_ball (Triangulation<3> &tria, + const Point<3> &p, + const double radius) { - // this function used to be - // implemented by the code below, - // but it turned out that it didn't - // work as expected: there were - // faces that we used in both - // orientations, leading the - // triangulation function to - // believe that the faces were - // external, even though they were - // in fact internal to the - // ball. this leads to strange - // results. - // - // since we haven't found a working - // enumeration of cell vertices and - // faces, this function is disabled - // altogether - Assert(false, ExcNotImplemented()); - -/* const double a = 1./(1+std::sqrt(3.0)); // equilibrate cell sizes at transition // from the inner part to the radial // cells @@ -828,34 +809,34 @@ GridGenerator::hyper_ball (Triangulation<3> &/*tria*/, // cell p+Point<3>(-1,-1,-1)*(radius/std::sqrt(3.0)*a), p+Point<3>(+1,-1,-1)*(radius/std::sqrt(3.0)*a), - p+Point<3>(+1,+1,-1)*(radius/std::sqrt(3.0)*a), - p+Point<3>(-1,+1,-1)*(radius/std::sqrt(3.0)*a), - p+Point<3>(-1,-1,+1)*(radius/std::sqrt(3.0)*a), p+Point<3>(+1,-1,+1)*(radius/std::sqrt(3.0)*a), + p+Point<3>(-1,-1,+1)*(radius/std::sqrt(3.0)*a), + p+Point<3>(-1,+1,-1)*(radius/std::sqrt(3.0)*a), + p+Point<3>(+1,+1,-1)*(radius/std::sqrt(3.0)*a), p+Point<3>(+1,+1,+1)*(radius/std::sqrt(3.0)*a), p+Point<3>(-1,+1,+1)*(radius/std::sqrt(3.0)*a), // now the eight vertices at // the outer sphere p+Point<3>(-1,-1,-1)*(radius/std::sqrt(3.0)), p+Point<3>(+1,-1,-1)*(radius/std::sqrt(3.0)), - p+Point<3>(+1,+1,-1)*(radius/std::sqrt(3.0)), - p+Point<3>(-1,+1,-1)*(radius/std::sqrt(3.0)), - p+Point<3>(-1,-1,+1)*(radius/std::sqrt(3.0)), p+Point<3>(+1,-1,+1)*(radius/std::sqrt(3.0)), + p+Point<3>(-1,-1,+1)*(radius/std::sqrt(3.0)), + p+Point<3>(-1,+1,-1)*(radius/std::sqrt(3.0)), + p+Point<3>(+1,+1,-1)*(radius/std::sqrt(3.0)), p+Point<3>(+1,+1,+1)*(radius/std::sqrt(3.0)), - p+Point<3>(-1,+1,+1)*(radius/std::sqrt(3.0)) + p+Point<3>(-1,+1,+1)*(radius/std::sqrt(3.0)), }; // one needs to draw the seven cubes to // understand what's going on here const unsigned int n_cells = 7; - const int cell_vertices[n_cells][8] = {{0, 1, 2, 3, 4, 5, 6, 7}, - {8, 9, 10, 11, 0, 1, 2, 3}, - {9, 13, 14, 10, 1, 5, 6, 2}, - {12, 4, 7, 15, 13, 5, 6, 14}, - {8, 0, 3, 11, 12, 4, 7, 15}, - {11, 10,14, 15, 3, 2, 6, 7}, - {8, 9, 13, 12, 0, 1, 5, 4}}; + const int cell_vertices[n_cells][8] = {{0, 1, 2, 3, 4, 5, 6, 7}, // center + {8, 9, 1, 0, 12, 13, 5, 4}, // bottom + {9, 13, 14, 10, 1, 5, 6, 2}, // right + {11, 10, 14, 15, 3, 2, 6, 7}, // top + {8, 0, 3, 11, 12, 4, 7, 15}, // left + {8, 9, 10, 11, 0, 1, 2, 3}, // front + {12, 4, 7, 15, 13, 5, 6, 14}}; // back std::vector > cells (n_cells, CellData<3>()); @@ -865,11 +846,12 @@ GridGenerator::hyper_ball (Triangulation<3> &/*tria*/, cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; }; + + GridReordering<3>::reorder_cells (cells); tria.create_triangulation (std::vector >(&vertices[0], &vertices[n_vertices]), cells, SubCellData()); // no boundary information -*/ } @@ -937,6 +919,8 @@ GridGenerator::cylinder (Triangulation<3> &tria, cells[i].material_id = 0; }; + GridReordering<3>::reorder_cells (cells); + tria.create_triangulation (std::vector >(&vertices[0], &vertices[24]), cells, SubCellData()); // no boundary information