Skip to content

Commit

Permalink
Introduce TriaAccessor::combined_face_orientation()
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrum committed Oct 27, 2021
1 parent 21e7779 commit 14975f5
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
19 changes: 19 additions & 0 deletions include/deal.II/grid/tria_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,13 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
* @{
*/

/**
* 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).
Expand Down Expand Up @@ -2104,6 +2111,12 @@ class TriaAccessor<0, dim, spacedim>
* @{
*/

/**
* @brief Always return 0
*/
static unsigned char
combined_face_orientation(const unsigned int face);

/**
* @brief Always return false
*/
Expand Down Expand Up @@ -2570,6 +2583,12 @@ class TriaAccessor<0, 1, spacedim>
* @{
*/

/**
* @brief Always return 0
*/
static unsigned char
combined_face_orientation(const unsigned int face);

/**
* @brief Always return false
*/
Expand Down
30 changes: 30 additions & 0 deletions include/deal.II/grid/tria_accessor.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,17 @@ TriaAccessor<structdim, dim, spacedim>::quad_index(const unsigned int i) const



template <int structdim, int dim, int spacedim>
inline unsigned char
TriaAccessor<structdim, dim, spacedim>::combined_face_orientation(
const unsigned int face) const
{
return this->face_orientation(face) + 4 * this->face_flip(face) +
2 * this->face_rotation(face);
}



template <int structdim, int dim, int spacedim>
inline bool
TriaAccessor<structdim, dim, spacedim>::face_orientation(
Expand Down Expand Up @@ -2527,6 +2538,16 @@ TriaAccessor<0, dim, spacedim>::measure() const



template <int dim, int spacedim>
inline unsigned char
TriaAccessor<0, dim, spacedim>::combined_face_orientation(
const unsigned int /*face*/)
{
return 0;
}



template <int dim, int spacedim>
inline bool
TriaAccessor<0, dim, spacedim>::face_orientation(const unsigned int /*face*/)
Expand Down Expand Up @@ -2959,6 +2980,15 @@ TriaAccessor<0, 1, spacedim>::manifold_id() const
}


template <int spacedim>
inline unsigned char
TriaAccessor<0, 1, spacedim>::combined_face_orientation(
const unsigned int /*face*/)
{
return 0;
}


template <int spacedim>
inline bool
TriaAccessor<0, 1, spacedim>::face_orientation(const unsigned int /*face*/)
Expand Down
6 changes: 1 addition & 5 deletions source/numerics/data_out_faces.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ DataOutFaces<dim, spacedim>::build_one_patch(
const Point<dim> vertex_reference_coordinates =
cell->reference_cell().template vertex<dim>(
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<dim> vertex_real_coordinates =
data.mapping_collection[0].transform_unit_to_real_cell(
Expand Down

0 comments on commit 14975f5

Please sign in to comment.