From: Peter Munch Date: Mon, 25 Oct 2021 04:50:59 +0000 (+0200) Subject: Introduce TriaAccessor::combined_face_orientation() X-Git-Tag: v9.4.0-rc1~882^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12878%2Fhead;p=dealii.git Introduce TriaAccessor::combined_face_orientation() --- 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(