From c0c8a7851b73070d0e1a5824f6aecc9379b10aed Mon Sep 17 00:00:00 2001 From: Bruno Date: Thu, 1 Apr 2021 17:33:28 -0400 Subject: [PATCH] Apply first round of comments --- include/deal.II/grid/grid_generator.h | 2 +- source/grid/grid_generator.cc | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/include/deal.II/grid/grid_generator.h b/include/deal.II/grid/grid_generator.h index 565ca2917f..adb763cf52 100644 --- a/include/deal.II/grid/grid_generator.h +++ b/include/deal.II/grid/grid_generator.h @@ -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 diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 160681e6ef..36f95200a6 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -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> 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, -- 2.39.5