]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix hypershell 96.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 12 Feb 2011 13:53:51 +0000 (13:53 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 12 Feb 2011 13:53:51 +0000 (13:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@23340 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/grid/grid_generator.cc

index 22162e6a59256134e10ce61940d630d2f3d46dc2..c071965ba73198a794e85e8ec3eaedca7e1c875f 100644 (file)
@@ -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<bool> 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<GeometryInfo<3>::faces_per_cell; ++f)
+         if (cell->at_boundary(f))
+           for (unsigned int v=0; v<GeometryInfo<3>::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<GeometryInfo<3>::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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.