From: Peter Munch Date: Tue, 30 Jun 2020 18:02:47 +0000 (+0200) Subject: Generalize line_orientation() for 2D general meshes X-Git-Tag: v9.3.0-rc1~1330^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10635%2Fhead;p=dealii.git Generalize line_orientation() for 2D general meshes --- diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index a28bc8ea83..19bf9412fb 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -724,10 +724,18 @@ namespace internal template inline static bool - line_orientation(const TriaAccessor<2, 2, spacedim> &, const unsigned int) + line_orientation(const TriaAccessor<2, 2, spacedim> &accessor, + const unsigned int line) { - // quads in 2d have no non-standard orientation - return true; + if (accessor.tria->levels[accessor.present_level] + ->face_orientations.size() == 0) + return true; // quads in 2d have no non-standard orientation and + // the array TriaLevel::face_orientations is left empty + else + return accessor.tria->levels[accessor.present_level] + ->face_orientations[accessor.present_index * + GeometryInfo<2>::faces_per_cell + + line]; }