From 8fd46e3e455e91381181004172ea705481ac0c45 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 1 Feb 2025 16:17:10 -0500 Subject: [PATCH] ReferenceCell::child_cell_on_face(): make the orientation mandatory. --- include/deal.II/grid/reference_cell.h | 37 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 032bc46af3..f179143b9e 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -452,6 +452,19 @@ public: static constexpr types::geometric_orientation reversed_combined_line_orientation(); + /** + * Return which child cells are adjacent to a certain face of the + * parent cell. + * + * @deprecated Use the version of this function which takes the orientation as + * the third parameter instead. + */ + DEAL_II_DEPRECATED_EARLY_WITH_COMMENT( + "Use the version of this function which takes the orientation as the third " + "parameter instead.") + unsigned int + child_cell_on_face(const unsigned int face, const unsigned int subface) const; + /** * Return which child cells are adjacent to a certain face of the * parent cell. @@ -496,8 +509,7 @@ public: unsigned int child_cell_on_face(const unsigned int face, const unsigned int subface, - const types::geometric_orientation face_orientation = - numbers::default_geometric_orientation) const; + const types::geometric_orientation face_orientation) const; /** * For a given vertex in a cell, return a pair of a face index and a @@ -2114,6 +2126,17 @@ ReferenceCell::reversed_combined_line_orientation() +inline unsigned int +ReferenceCell::child_cell_on_face(const unsigned int face, + const unsigned int subface) const +{ + return child_cell_on_face(face, + subface, + numbers::default_geometric_orientation); +} + + + inline unsigned int ReferenceCell::child_cell_on_face( const unsigned int face, @@ -2136,7 +2159,15 @@ ReferenceCell::child_cell_on_face( static constexpr ndarray subcells = { {{{0, 1}}, {{1, 2}}, {{2, 0}}}}; - return subcells[face][subface]; + Assert(combined_face_orientation == + numbers::default_geometric_orientation || + combined_face_orientation == + numbers::reverse_line_orientation, + ExcInternalError()); + return subcells[face][combined_face_orientation == + numbers::default_geometric_orientation ? + subface : + 1 - subface]; } case ReferenceCells::Quadrilateral: { -- 2.39.5