* 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
- // 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,
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;
// 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))
{
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,