]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Apply first round of comments
authorBruno <blais.bruno@gmail.com>
Thu, 1 Apr 2021 21:33:28 +0000 (17:33 -0400)
committerBruno <blais.bruno@gmail.com>
Thu, 1 Apr 2021 21:33:28 +0000 (17:33 -0400)
include/deal.II/grid/grid_generator.h
source/grid/grid_generator.cc

index 565ca2917fd367c1a0a3188ac7f482db3fa8de47..adb763cf525438fb3ba2cc309cf82c14fb70b1e5 100644 (file)
@@ -959,7 +959,7 @@ namespace GridGenerator
    * and its projection into the @p yz-plane is a circle of radius @p
    * radius. In two dimensions, the cylinder is a rectangle from
    * `x=-half_length` to `x=+half_length` and from `y=-radius` to
-   * `y=radius`.
+   * `y=radius`. This function is only implemented for dim==3.
    *
    * The boundaries are colored according to the following scheme: 0 for the
    * hull of the cylinder, 1 for the left hand face and 2 for the right hand
index 160681e6ef79dcc4b28bb43299b3c5cd33db2f4b..36f95200a6da05903d3b45e020037e99b2d6ce75 100644 (file)
@@ -5455,15 +5455,6 @@ namespace GridGenerator
 
 
 
-  // Implementation for 3D only
-  template <>
-  void cylinder(Triangulation<3> &tria,
-                const double      radius,
-                const double      half_length)
-  {
-    subdivided_cylinder(tria, 2, radius, half_length);
-  }
-
   // Implementation for 3D only
   template <>
   void subdivided_cylinder(Triangulation<3> & tria,
@@ -5476,7 +5467,6 @@ namespace GridGenerator
     const double d = radius / std::sqrt(2.0);
     const double a = d / (1 + std::sqrt(2.0));
 
-    // const unsigned int    npts_per_plane = 8;
     std::vector<Point<3>> vertices;
     const double          initial_height   = -half_length;
     const double          height_increment = 2. * half_length / x_subdivisions;
@@ -5547,12 +5537,9 @@ namespace GridGenerator
     // interior if one of its vertices
     // is at coordinates '+-a' as set
     // above
-    Triangulation<3>::cell_iterator cell = tria.begin();
-    Triangulation<3>::cell_iterator end  = tria.end();
-
     tria.set_all_manifold_ids_on_boundary(0);
 
-    for (; cell != end; ++cell)
+    for (const auto &cell : tria.cell_iterators())
       for (unsigned int i : GeometryInfo<3>::face_indices())
         if (cell->at_boundary(i))
           {
@@ -5594,7 +5581,14 @@ namespace GridGenerator
     tria.set_manifold(0, CylindricalManifold<3>());
   }
 
-
+  // Implementation for 3D only
+  template <>
+  void cylinder(Triangulation<3> &tria,
+                const double      radius,
+                const double      half_length)
+  {
+    subdivided_cylinder(tria, 2, radius, half_length);
+  }
 
   template <>
   void quarter_hyper_ball(Triangulation<3> &tria,

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.