From: Peter Munch Date: Mon, 25 May 2020 14:44:56 +0000 (+0200) Subject: Add missing docu to GeometryInfo X-Git-Tag: v9.3.0-rc1~1554^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=556e8754d9fef7b8e34f4440cef631fa856d5c72;p=dealii.git Add missing docu to GeometryInfo --- diff --git a/include/deal.II/base/geometry_info.h b/include/deal.II/base/geometry_info.h index f8000180d8..fb8534a184 100644 --- a/include/deal.II/base/geometry_info.h +++ b/include/deal.II/base/geometry_info.h @@ -2312,18 +2312,44 @@ struct GeometryInfo const bool face_flip = false, const bool face_rotation = false); + /** + * Map the vertex index @p vertex of a line in standard orientation to one of a + * face with arbitrary @p line_orientation. The value of this flag default to + * true. + */ static unsigned int - standard_to_real_line_vertex(const unsigned int line, - const bool face_orientation = true); + standard_to_real_line_vertex(const unsigned int vertex, + const bool line_orientation = true); + /** + * Decompose the vertex index in a quad into a pair of a line index and a + * vertex index within this line. + * + * @note Which line is selected is not of importance (and not exposed on + * purpose). + */ static std::array - standard_corner_to_line_vertex_index(const unsigned int corner); + standard_quad_vertex_to_line_vertex_index(const unsigned int vertex); + /** + * Decompose the vertex index in a hex into a pair of a quad index and a + * vertex index within this quad. + * + * @note Which quad is selected is not of importance (and not exposed on + * purpose). + */ static std::array - standard_corner_to_quad_vertex_index(const unsigned int corner); + standard_hex_vertex_to_quad_vertex_index(const unsigned int vertex); + /** + * Decompose the line index in a hex into a pair of a quad index and a line + * index within this quad. + * + * @note Which quad is selected is not of importance (and not exposed on + * purpose). + */ static std::array - standard_line_to_quad_line_index(const unsigned int line); + standard_hex_line_to_quad_line_index(const unsigned int line); /** * Map the line index @p line of a face with arbitrary @p face_orientation, @@ -4066,41 +4092,42 @@ GeometryInfo::standard_to_real_face_line(const unsigned int line, template <> inline unsigned int -GeometryInfo<2>::standard_to_real_line_vertex(const unsigned int corner, +GeometryInfo<2>::standard_to_real_line_vertex(const unsigned int vertex, const bool line_orientation) { - return line_orientation ? corner : (1 - corner); + return line_orientation ? vertex : (1 - vertex); } template inline unsigned int -GeometryInfo::standard_to_real_line_vertex(const unsigned int corner, +GeometryInfo::standard_to_real_line_vertex(const unsigned int vertex, const bool) { Assert(false, ExcNotImplemented()); - return corner; + return vertex; } template <> inline std::array -GeometryInfo<2>::standard_corner_to_line_vertex_index(const unsigned int corner) +GeometryInfo<2>::standard_quad_vertex_to_line_vertex_index( + const unsigned int vertex) { - return {{corner % 2, corner / 2}}; + return {{vertex % 2, vertex / 2}}; } template inline std::array -GeometryInfo::standard_corner_to_line_vertex_index( - const unsigned int corner) +GeometryInfo::standard_quad_vertex_to_line_vertex_index( + const unsigned int vertex) { Assert(false, ExcNotImplemented()); - (void)corner; + (void)vertex; return {{0, 0}}; } @@ -4108,7 +4135,7 @@ GeometryInfo::standard_corner_to_line_vertex_index( template <> inline std::array -GeometryInfo<3>::standard_line_to_quad_line_index(const unsigned int i) +GeometryInfo<3>::standard_hex_line_to_quad_line_index(const unsigned int i) { // set up a table that for each // line describes a) from which @@ -4138,10 +4165,10 @@ GeometryInfo<3>::standard_line_to_quad_line_index(const unsigned int i) template inline std::array -GeometryInfo::standard_line_to_quad_line_index(const unsigned int corner) +GeometryInfo::standard_hex_line_to_quad_line_index(const unsigned int line) { Assert(false, ExcNotImplemented()); - (void)corner; + (void)line; return {{0, 0}}; } @@ -4149,28 +4176,26 @@ GeometryInfo::standard_line_to_quad_line_index(const unsigned int corner) template <> inline std::array -GeometryInfo<3>::standard_corner_to_quad_vertex_index(const unsigned int corner) +GeometryInfo<3>::standard_hex_vertex_to_quad_vertex_index( + const unsigned int vertex) { - // get the corner indices by asking either - // the bottom or the top face for its - // vertices. handle non-standard faces by - // calling the vertex reordering function - // from GeometryInfo - - // bottom face (4) for first four vertices, - // top face (5) for the rest - return {{4 + corner / 4, corner % 4}}; + // get the corner indices by asking either the bottom or the top face for its + // vertices. handle non-standard faces by calling the vertex reordering + // function from GeometryInfo + + // bottom face (4) for first four vertices, top face (5) for the rest + return {{4 + vertex / 4, vertex % 4}}; } template inline std::array -GeometryInfo::standard_corner_to_quad_vertex_index( - const unsigned int corner) +GeometryInfo::standard_hex_vertex_to_quad_vertex_index( + const unsigned int vertex) { Assert(false, ExcNotImplemented()); - (void)corner; + (void)vertex; return {{0, 0}}; } diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 4232babdcd..e2b0bf35aa 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -632,7 +632,8 @@ namespace internal line_index(const TriaAccessor<3, dim, spacedim> &accessor, const unsigned int i) { - const auto pair = GeometryInfo<3>::standard_line_to_quad_line_index(i); + const auto pair = + GeometryInfo<3>::standard_hex_line_to_quad_line_index(i); const auto quad_index = pair[0]; const auto line_index = GeometryInfo<3>::standard_to_real_face_line( pair[1], @@ -1106,7 +1107,7 @@ namespace internal const unsigned int corner) { const auto pair = - GeometryInfo<2>::standard_corner_to_line_vertex_index(corner); + GeometryInfo<2>::standard_quad_vertex_to_line_vertex_index(corner); const auto line_index = pair[0]; const auto vertex_index = GeometryInfo<2>::standard_to_real_line_vertex( pair[1], accessor.line_orientation(line_index)); @@ -1122,7 +1123,7 @@ namespace internal const unsigned int corner) { const auto pair = - GeometryInfo<3>::standard_corner_to_quad_vertex_index(corner); + GeometryInfo<3>::standard_hex_vertex_to_quad_vertex_index(corner); const auto face_index = pair[0]; const auto vertex_index = GeometryInfo<3>::standard_to_real_face_vertex( pair[1],