From 3e98b364f5d04c0db3ca910fa70323cdd7d49046 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 15 Nov 2021 18:17:30 -0700 Subject: [PATCH] Minor updates to the documentation of CellData. --- include/deal.II/grid/tria_description.h | 42 +++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/include/deal.II/grid/tria_description.h b/include/deal.II/grid/tria_description.h index ac9dfea989..b2c26cf4c3 100644 --- a/include/deal.II/grid/tria_description.h +++ b/include/deal.II/grid/tria_description.h @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -72,6 +73,20 @@ struct CellData * Indices of the vertices of this cell. These indices correspond * to entries in the vector of vertex locations passed to * Triangulation::create_triangulation(). + * + * By default, the constructor of this class initializes this variable to + * have as many entries as it takes to describe a hypercube cell (i.e., a + * ReferenceCells::Line, ReferenceCells::Quadrilateral, or + * ReferenceCells::Hexahedron). This is historical and dates back to the time + * where deal.II could only deal with these kinds of cells. If you want an + * object of the current type to describe, for example, a triangle or + * tetrahedron, then you either have to call this constructor with an explicit + * argument different from the default value, or manually resize the + * `vertices` member variable after construction. + * + * The kind of cell described by the current object is then determined by + * calling ReferenceCell::n_vertices_to_type() on the number of vertices + * described by this array. */ std::vector vertices; @@ -121,10 +136,20 @@ struct CellData * * - vertex indices to invalid values * - boundary or material id zero (the default for boundary or material ids) - * - manifold id to numbers::flat_manifold_id + * - manifold id to numbers::flat_manifold_id. + * + * By default, the constructor initializes the `vertices` member variable to + * have as many entries as it takes to describe a hypercube cell (i.e., a + * ReferenceCells::Line, ReferenceCells::Quadrilateral, or + * ReferenceCells::Hexahedron). This is historical and dates back to the time + * where deal.II could only deal with these kinds of cells. If you want an + * object of the current type to describe, for example, a triangle or + * tetrahedron, then you either have to call this constructor with an explicit + * argument different from the default value, or manually resize the + * `vertices` member variable after construction. */ - CellData( - const unsigned int n_vertices = GeometryInfo::vertices_per_cell); + CellData(const unsigned int n_vertices = + ReferenceCells::get_hypercube().n_vertices()); /** * Comparison operator. @@ -205,9 +230,10 @@ struct SubCellData { /** * A vector of CellData<1> objects that describe boundary and manifold - * information for edges of 2d or 3d triangulations. + * information for edges of 2d or 3d triangulations. For 2d triangulations, + * edges (lines) are of course the faces of the cells. * - * This vector may not be used in the creation of 1d triangulations. + * This vector must not be used in the creation of 1d triangulations. */ std::vector> boundary_lines; @@ -219,7 +245,11 @@ struct SubCellData * necessarily quadrilaterals. However, the variable is now also used to * describe boundary triangles for tetrahedral and mixed meshes. * - * This vector may not be used in the creation of 1d or 2d triangulations. + * Whether an element in this array describes a boundary triangle or a + * boundary quad is determined by how many elements the `vertices` + * member variable of `CellData<2>` stores. + * + * This vector must not be used in the creation of 1d or 2d triangulations. */ std::vector> boundary_quads; -- 2.39.5