-Changed: FiniteElement::adjust_quad_dof_index_for_face_orientation() and
-FiniteElement::face_to_cell_index() now use the standardized
-<tt>combined_orientation</tt> orientation encoding as input arguments rather
-than three booleans.
+Changed: FiniteElement::adjust_quad_dof_index_for_face_orientation(),
+FiniteElement::face_to_cell_index(), and
+FiniteElement::adjust_line_dof_index_for_line_orientation() now use the
+standardized <tt>combined_orientation</tt> orientation encoding as input
+arguments rather than one or three booleans.
<br>
(David Wells, 2023/12/21)
ReferenceCell::default_combined_face_orientation()) const;
/**
- * For lines with non-standard line_orientation in 3d, the dofs on lines
- * have to be permuted in order to be combined with the correct shape
- * functions. Given a local dof @p index on a line, return the local index,
- * if the line has non-standard line_orientation. In 2d and 1d there is no
- * need for permutation, so the given index is simply returned.
+ * Given a local dof @p index on a line and the orientation @p
+ * combined_orientation of that line, return the local dof which accounts for
+ * @p combined_orientation.
+ *
+ * @note In both 1d and all-quadrilateral meshes in 2d all lines have the
+ * standard orientation.
*/
unsigned int
- adjust_line_dof_index_for_line_orientation(const unsigned int index,
- const bool line_orientation) const;
+ adjust_line_dof_index_for_line_orientation(
+ const unsigned int index,
+ const unsigned char combined_orientation) const;
/**
* Return in which of the vector components of this finite element the @p
* cell->line_orientation(), 1d specialization
*/
template <int dim, int spacedim>
- static std::array<unsigned int, 1>
+ static std::array<unsigned char, 1>
get_line_orientations_of_cell(const TriaAccessor<1, dim, spacedim> &)
{
Assert(false, ExcInternalError());
* cell->line_orientation(), 2d specialization
*/
template <int dim, int spacedim>
- static std::array<bool, 4>
+ static std::array<unsigned char, 4>
get_line_orientations_of_cell(const TriaAccessor<2, dim, spacedim> &cell)
{
// For 2d cells the access cell->line_orientation() is already
// efficient
- std::array<bool, 4> line_orientations = {};
+ std::array<unsigned char, 4> line_orientations = {};
for (const unsigned int line : cell.line_indices())
- line_orientations[line] = cell.line_orientation(line);
+ line_orientations[line] =
+ cell.line_orientation(line) == true ?
+ ReferenceCell::default_combined_face_orientation() :
+ ReferenceCell::reversed_combined_line_orientation();
return line_orientations;
}
* cell->line_orientation(), 3d specialization
*/
template <int dim, int spacedim>
- static std::array<bool, 12>
+ static std::array<unsigned char, 12>
get_line_orientations_of_cell(const TriaAccessor<3, dim, spacedim> &cell)
{
- std::array<bool, 12> line_orientations = {};
+ std::array<unsigned char, 12> line_orientations = {};
// For hexahedra, the classical access via quads -> lines is too
// inefficient. Unroll this code here to allow the compiler to inline
template <int dim, int spacedim>
unsigned int
FiniteElement<dim, spacedim>::adjust_line_dof_index_for_line_orientation(
- const unsigned int index,
- const bool line_orientation) const
+ const unsigned int index,
+ const unsigned char combined_orientation) const
{
// We orient quads (and 1D meshes are always oriented) so always skip those
// cases
//
// TODO - we may want to change this in the future: see also the notes in
// face_to_cell_index()
+ Assert(combined_orientation ==
+ ReferenceCell::default_combined_face_orientation() ||
+ combined_orientation ==
+ ReferenceCell::reversed_combined_line_orientation(),
+ ExcInternalError());
if (this->reference_cell() == ReferenceCells::Line ||
this->reference_cell() == ReferenceCells::Quadrilateral)
return index;
Assert(adjust_line_dof_index_for_line_orientation_table.size() ==
this->n_dofs_per_line(),
ExcInternalError());
- if (line_orientation)
+ if (combined_orientation ==
+ ReferenceCell::default_combined_face_orientation())
return index;
else
return index + adjust_line_dof_index_for_line_orientation_table[index];