From fe63f438814037a762f5eba61d1709fa5bf4c269 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 29 Dec 2022 14:09:04 -0700 Subject: [PATCH] Improve documentation. --- include/deal.II/grid/reference_cell.h | 33 +++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 1d764eec3d..b166ca41fa 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -564,7 +564,16 @@ public: /** * Determine the orientation of the current entity described by its - * vertices @p var_1 relative to an entity described by @p var_0. + * vertices @p vertices_1 relative to an entity described by @p var_0. + * The two arrays given as arguments can be arrays of global vertex + * indices or local vertex indices, arrays of vertex locations, or + * arrays of any other objects identifying the vertices. + * + * The size of the arrays, i.e., the template argument `N`, + * must be equal to or larger than the number of vertices of the current + * entity. If it is larger, only those elements of the input and output + * arrays are read from or written to that correspond to valid vertex + * indices. */ template unsigned char @@ -572,7 +581,15 @@ public: const std::array &vertices_1) const; /** - * Inverse function of compute_orientation(). + * Inverse function of compute_orientation(): Given a set of + * vertex-associated objects (such as vertex indices, locations, etc.) + * a desired orientation permutation, return the permuted vertex information. + * + * The size of the input and output arrays, i.e., the template argument `N`, + * must be equal to or larger than the number of vertices of the current + * entity. If it is larger, only those elements of the input and output + * arrays are read from or written to that correspond to valid vertex + * indices. */ template std::array @@ -2373,7 +2390,11 @@ inline unsigned char ReferenceCell::compute_orientation(const std::array &vertices_0, const std::array &vertices_1) const { - AssertIndexRange(n_vertices(), N + 1); + Assert(N >= n_vertices(), + ExcMessage("The number of array elements must be equal to or " + "greater than the number of vertices of the cell " + "referenced by this object.")); + if (*this == ReferenceCells::Line) { const std::array i{{vertices_0[0], vertices_0[1]}}; @@ -2469,8 +2490,12 @@ ReferenceCell::permute_according_orientation( const std::array &vertices, const unsigned int orientation) const { - std::array temp; + Assert(N >= n_vertices(), + ExcMessage("The number of array elements must be equal to or " + "greater than the number of vertices of the cell " + "referenced by this object.")); + std::array temp; if (*this == ReferenceCells::Line) { switch (orientation) -- 2.39.5