From 14975f5329eaf3d787e1bbc27371fe6dc44bae8a Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 25 Oct 2021 06:50:59 +0200 Subject: [PATCH] Introduce TriaAccessor::combined_face_orientation() --- include/deal.II/grid/tria_accessor.h | 19 ++++++++++++ .../deal.II/grid/tria_accessor.templates.h | 30 +++++++++++++++++++ source/numerics/data_out_faces.cc | 6 +--- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 2dbd027010..8e5641cbbc 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -899,6 +899,13 @@ public: * @{ */ + /** + * Return an integer representation that uniquely encodes the orientation, + * flip, and rotation of a @p face. + */ + unsigned char + combined_face_orientation(const unsigned int face) const; + /** * Return whether the face with index @p face has its normal pointing in the * standard direction (@p true) or whether it is the opposite (@p false). @@ -2104,6 +2111,12 @@ public: * @{ */ + /** + * @brief Always return 0 + */ + static unsigned char + combined_face_orientation(const unsigned int face); + /** * @brief Always return false */ @@ -2570,6 +2583,12 @@ public: * @{ */ + /** + * @brief Always return 0 + */ + static unsigned char + combined_face_orientation(const unsigned int face); + /** * @brief Always return false */ diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index b656d517c5..f19b16feed 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -1188,6 +1188,17 @@ TriaAccessor::quad_index(const unsigned int i) const +template +inline unsigned char +TriaAccessor::combined_face_orientation( + const unsigned int face) const +{ + return this->face_orientation(face) + 4 * this->face_flip(face) + + 2 * this->face_rotation(face); +} + + + template inline bool TriaAccessor::face_orientation( @@ -2527,6 +2538,16 @@ TriaAccessor<0, dim, spacedim>::measure() const +template +inline unsigned char +TriaAccessor<0, dim, spacedim>::combined_face_orientation( + const unsigned int /*face*/) +{ + return 0; +} + + + template inline bool TriaAccessor<0, dim, spacedim>::face_orientation(const unsigned int /*face*/) @@ -2959,6 +2980,15 @@ TriaAccessor<0, 1, spacedim>::manifold_id() const } +template +inline unsigned char +TriaAccessor<0, 1, spacedim>::combined_face_orientation( + const unsigned int /*face*/) +{ + return 0; +} + + template inline bool TriaAccessor<0, 1, spacedim>::face_orientation(const unsigned int /*face*/) diff --git a/source/numerics/data_out_faces.cc b/source/numerics/data_out_faces.cc index aaca186ddc..bcc04bff84 100644 --- a/source/numerics/data_out_faces.cc +++ b/source/numerics/data_out_faces.cc @@ -117,11 +117,7 @@ DataOutFaces::build_one_patch( const Point vertex_reference_coordinates = cell->reference_cell().template vertex( cell->reference_cell().face_to_cell_vertices( - face_number, - vertex, - cell->face_orientation(face_number) + - 4 * cell->face_flip(face_number) + - 2 * cell->face_rotation(face_number))); + face_number, vertex, cell->combined_face_orientation(face_number))); const Point vertex_real_coordinates = data.mapping_collection[0].transform_unit_to_real_cell( -- 2.39.5