From: Wolfgang Bangerth Date: Sat, 12 Feb 2011 13:53:51 +0000 (+0000) Subject: Fix hypershell 96. X-Git-Tag: v8.0.0~4358 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=981d2721fad5f01c668cfd99624c0880e8dc4e58;p=dealii.git Fix hypershell 96. git-svn-id: https://svn.dealii.org/trunk@23340 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/grid/grid_generator.cc b/deal.II/source/grid/grid_generator.cc index 22162e6a59..c071965ba7 100644 --- a/deal.II/source/grid/grid_generator.cc +++ b/deal.II/source/grid/grid_generator.cc @@ -2366,15 +2366,23 @@ GridGenerator::hyper_shell (Triangulation<3>& tria, tmp.set_boundary(1, boundary); tmp.refine_global (1); + // mark vertices we've already moved or + // that we want to ignore: we don't + // want to move vertices at the inner + // or outer boundaries std::vector vertex_already_treated (tmp.n_vertices(), false); + for (Triangulation<3>::active_cell_iterator cell = tmp.begin_active(); + cell != tmp.end(); ++cell) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (cell->at_boundary(f)) + for (unsigned int v=0; v::vertices_per_face; ++v) + vertex_already_treated[cell->face(f)->vertex_index(v)] = true; + + // now move the remaining vertices for (Triangulation<3>::active_cell_iterator cell = tmp.begin_active(); cell != tmp.end(); ++cell) for (unsigned int v=0; v::vertices_per_cell; ++v) - if ((cell->vertex(v).distance(p) > 1.05*inner_radius) - && - (cell->vertex(v).distance(p) > 0.95*outer_radius) - && - (vertex_already_treated[cell->vertex_index(v)] == false)) + if (vertex_already_treated[cell->vertex_index(v)] == false) { // this is a new interior // vertex. mesh refinement may