From 7c0b206cfc04ac499034e36f73565ec93bdaa6a8 Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 22 Jan 2025 19:53:13 -0500 Subject: [PATCH] Introduce numbers::default_geometric_orientation. --- include/deal.II/base/types.h | 10 +++ include/deal.II/dofs/dof_accessor.h | 5 +- include/deal.II/dofs/dof_tools.h | 2 +- include/deal.II/fe/fe.h | 9 +- include/deal.II/fe/fe_q_base.h | 9 +- include/deal.II/fe/fe_system.h | 9 +- include/deal.II/grid/connectivity.h | 4 +- include/deal.II/grid/reference_cell.h | 35 ++++---- include/deal.II/grid/tria_accessor.h | 22 +++-- .../deal.II/grid/tria_objects_orientations.h | 8 +- include/deal.II/non_matching/mapping_info.h | 4 +- .../vector_tools_boundary.templates.h | 4 +- source/base/qprojector.cc | 17 ++-- source/distributed/tria.cc | 9 +- source/fe/fe.cc | 9 +- source/fe/fe_abf.cc | 2 +- source/fe/fe_bdm.cc | 2 +- source/fe/fe_nedelec.cc | 43 +++++---- source/fe/fe_q_base.cc | 8 +- source/fe/fe_raviart_thomas.cc | 12 +-- source/fe/fe_rt_bubbles.cc | 2 +- source/fe/fe_simplex_p.cc | 4 +- source/fe/fe_simplex_p_bubbles.cc | 4 +- source/grid/grid_tools_dof_handlers.cc | 2 +- source/grid/reference_cell.cc | 4 +- source/grid/tria.cc | 87 +++++++++---------- tests/bits/periodicity_09.cc | 2 +- tests/fe/fe_conformity_test.h | 4 +- tests/grid/extrude_orientation_01.cc | 2 +- tests/grid/extrude_orientation_02.cc | 2 +- tests/grid/extrude_orientation_03.cc | 2 +- tests/grid/grid_generator_10.cc | 4 +- ...erator_non_standard_orientation_mesh_2d.cc | 2 +- ...erator_non_standard_orientation_mesh_3d.cc | 2 +- tests/grid/reference_cell_type_05.cc | 2 +- tests/simplex/orientation_03.cc | 4 +- tests/simplex/orientation_04.cc | 4 +- 37 files changed, 171 insertions(+), 185 deletions(-) diff --git a/include/deal.II/base/types.h b/include/deal.II/base/types.h index 5e4a5aca98..2b4923f434 100644 --- a/include/deal.II/base/types.h +++ b/include/deal.II/base/types.h @@ -337,6 +337,16 @@ namespace numbers const types::manifold_id flat_manifold_id = static_cast(-1); + /** + * Value indicating that a face or line is in its default orientation. + * + * See the + * @ref GlossFaceOrientation "glossary" + * for more information. + */ + const types::geometric_orientation default_geometric_orientation = + static_cast(0b001); + /** * A special id for an invalid subdomain id. This value may not be used as a * valid id but is used, for example, for default arguments to indicate a diff --git a/include/deal.II/dofs/dof_accessor.h b/include/deal.II/dofs/dof_accessor.h index decc696067..1041345773 100644 --- a/include/deal.II/dofs/dof_accessor.h +++ b/include/deal.II/dofs/dof_accessor.h @@ -3169,8 +3169,7 @@ namespace internal for (const auto line : accessor.line_indices()) { const auto line_orientation = line_orientations[line]; - if (line_orientation == - ReferenceCell::default_combined_face_orientation()) + if (line_orientation == numbers::default_geometric_orientation) dof_operation.process_dofs( accessor.get_dof_handler(), 0, @@ -3211,7 +3210,7 @@ namespace internal accessor.combined_face_orientation(face_no); const unsigned int quad_index = accessor.quad_index(face_no); if (combined_orientation == - ReferenceCell::default_combined_face_orientation()) + numbers::default_geometric_orientation) dof_operation.process_dofs( accessor.get_dof_handler(), 0, diff --git a/include/deal.II/dofs/dof_tools.h b/include/deal.II/dofs/dof_tools.h index c9a7f04fe8..58edf05095 100644 --- a/include/deal.II/dofs/dof_tools.h +++ b/include/deal.II/dofs/dof_tools.h @@ -960,7 +960,7 @@ namespace DoFTools AffineConstraints &constraints, const ComponentMask &component_mask = {}, const types::geometric_orientation combined_orientation = - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, const FullMatrix &matrix = FullMatrix(), const std::vector &first_vector_components = std::vector(), diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index 117ad435e1..5bd664af84 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -1534,11 +1534,10 @@ public: * freedom actually represent. */ virtual unsigned int - face_to_cell_index( - const unsigned int face_dof_index, - const unsigned int face, - const types::geometric_orientation combined_orientation = - ReferenceCell::default_combined_face_orientation()) const; + face_to_cell_index(const unsigned int face_dof_index, + const unsigned int face, + const types::geometric_orientation combined_orientation = + numbers::default_geometric_orientation) const; /** * Given a local dof @p index on a line and the orientation @p diff --git a/include/deal.II/fe/fe_q_base.h b/include/deal.II/fe/fe_q_base.h index b1741c8fc8..aad7da51a1 100644 --- a/include/deal.II/fe/fe_q_base.h +++ b/include/deal.II/fe/fe_q_base.h @@ -190,11 +190,10 @@ public: * dofs_per_cell. */ virtual unsigned int - face_to_cell_index( - const unsigned int face_dof_index, - const unsigned int face, - const types::geometric_orientation combined_orientation = - ReferenceCell::default_combined_face_orientation()) const override; + face_to_cell_index(const unsigned int face_dof_index, + const unsigned int face, + const types::geometric_orientation combined_orientation = + numbers::default_geometric_orientation) const override; /** * Return a list of constant modes of the element. For this element, the diff --git a/include/deal.II/fe/fe_system.h b/include/deal.II/fe/fe_system.h index cea1eb59a1..ce895be7b1 100644 --- a/include/deal.II/fe/fe_system.h +++ b/include/deal.II/fe/fe_system.h @@ -886,11 +886,10 @@ public: * dofs_per_cell. */ virtual unsigned int - face_to_cell_index( - const unsigned int face_dof_index, - const unsigned int face, - const types::geometric_orientation combined_orientation = - ReferenceCell::default_combined_face_orientation()) const override; + face_to_cell_index(const unsigned int face_dof_index, + const unsigned int face, + const types::geometric_orientation combined_orientation = + numbers::default_geometric_orientation) const override; /** * Implementation of the respective function in the base class. diff --git a/include/deal.II/grid/connectivity.h b/include/deal.II/grid/connectivity.h index d7585b326a..8ca6d35cfc 100644 --- a/include/deal.II/grid/connectivity.h +++ b/include/deal.II/grid/connectivity.h @@ -1306,7 +1306,7 @@ namespace internal // only faces with default orientation have to do something if (ori_cq.get_combined_orientation(f_) != - ReferenceCell::default_combined_face_orientation()) + numbers::default_geometric_orientation) continue; // determine entity type of face @@ -1340,7 +1340,7 @@ namespace internal // ... comparison gives orientation ori_ql.set_combined_orientation( con_ql.ptr[f] + l, - same ? ReferenceCell::default_combined_face_orientation() : + same ? numbers::default_geometric_orientation : ReferenceCell::reversed_combined_line_orientation()); } } diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 2b739b983b..b5119fc401 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -430,7 +431,11 @@ public: /** * Return the default combined face orientation flag (i.e., the default set of * orientations, defined by orientation, rotate, and flip for a face in 3d). + * + * @deprecated Use numbers::default_geometric_orientation instead. */ + DEAL_II_DEPRECATED_EARLY_WITH_COMMENT( + "Use numbers::default_geometric_orientation instead.") static constexpr types::geometric_orientation default_combined_face_orientation(); @@ -488,7 +493,7 @@ public: child_cell_on_face(const unsigned int face, const unsigned int subface, const types::geometric_orientation face_orientation = - default_combined_face_orientation()) const; + numbers::default_geometric_orientation) const; /** * For a given vertex in a cell, return a pair of a face index and a @@ -564,7 +569,7 @@ public: * is identical to calling * `reference_cell.vertex( * reference_cell.face_to_cell_vertices( - f, v, ReferenceCell::default_combined_face_orientation()))`. + f, v, numbers::default_geometric_orientation))`. */ template Point @@ -2060,10 +2065,7 @@ ReferenceCell::face_reference_cell(const unsigned int face_no) const inline constexpr types::geometric_orientation ReferenceCell::default_combined_face_orientation() { - // Our convention is that 'orientation' has a default value of true and - // occupies the least-significant bit while rotate and flip have default - // values of 'false' and occupy the second and third bits. - return 0b001; + return numbers::default_geometric_orientation; } @@ -2448,8 +2450,7 @@ ReferenceCell::face_to_cell_vertices( // TODO: once the default orientation is switched to 0 then we can remove this // special case for 1D. if (get_dimension() == 1) - Assert(combined_face_orientation == - ReferenceCell::default_combined_face_orientation(), + Assert(combined_face_orientation == numbers::default_geometric_orientation, ExcMessage("In 1D, all faces must have the default orientation.")); else AssertIndexRange(combined_face_orientation, n_face_orientations(face)); @@ -2475,7 +2476,7 @@ ReferenceCell::face_to_cell_vertices( {{{0, 1}}, {{1, 2}}, {{2, 0}}}}; return table[face][combined_face_orientation == - default_combined_face_orientation() ? + numbers::default_geometric_orientation ? vertex : (1 - vertex)]; } @@ -2549,8 +2550,8 @@ ReferenceCell::face_vertex_location(const unsigned int face, "the current reference cell lives. You have dim=" + std::to_string(dim) + " but the reference cell is " + std::to_string(get_dimension()) + " dimensional.")); - return this->template vertex( - face_to_cell_vertices(face, vertex, default_combined_face_orientation())); + return this->template vertex(face_to_cell_vertices( + face, vertex, numbers::default_geometric_orientation)); } @@ -2570,7 +2571,7 @@ ReferenceCell::standard_to_real_face_vertex( DEAL_II_NOT_IMPLEMENTED(); break; case ReferenceCells::Line: - Assert(face_orientation == default_combined_face_orientation(), + Assert(face_orientation == numbers::default_geometric_orientation, ExcMessage( "In 1D, all faces must have the default orientation.")); return vertex; @@ -3272,7 +3273,7 @@ ReferenceCell::face_to_cell_line_orientation( const types::geometric_orientation combined_face_orientation, const types::geometric_orientation line_orientation) const { - constexpr auto D = ReferenceCell::default_combined_face_orientation(); + constexpr auto D = numbers::default_geometric_orientation; constexpr auto R = ReferenceCell::reversed_combined_line_orientation(); if (*this == ReferenceCells::Hexahedron) { @@ -3283,7 +3284,7 @@ ReferenceCell::face_to_cell_line_orientation( const bool match = line_orientation == table[face_line_no / 2][combined_face_orientation]; - return match ? ReferenceCell::default_combined_face_orientation() : + return match ? numbers::default_geometric_orientation : ReferenceCell::reversed_combined_line_orientation(); } else if (*this == ReferenceCells::Tetrahedron) @@ -3305,13 +3306,13 @@ ReferenceCell::face_to_cell_line_orientation( const bool match = line_orientation == table[combined_line][combined_face_orientation]; - return match ? ReferenceCell::default_combined_face_orientation() : + return match ? numbers::default_geometric_orientation : ReferenceCell::reversed_combined_line_orientation(); } else // TODO: This might actually be wrong for some of the other // kinds of objects. We should check this - return ReferenceCell::default_combined_face_orientation(); + return numbers::default_geometric_orientation; } @@ -3466,7 +3467,7 @@ ReferenceCell::get_combined_orientation( // vertex_vertex_permutations once we make 0 the default orientation. (void)vertex_vertex_permutations; if (vertices_0[0] == vertices_1[0]) - return default_combined_face_orientation(); + return numbers::default_geometric_orientation; break; case ReferenceCells::Line: return compute_orientation(line_vertex_permutations); diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 6bd6ac1503..fd9d3bd634 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -4906,13 +4906,12 @@ namespace internal AssertIndexRange(face, accessor.n_faces()); if (dim == 1) - Assert(combined_orientation == - ReferenceCell::default_combined_face_orientation(), + Assert(combined_orientation == numbers::default_geometric_orientation, ExcMessage("In 1d, faces do not have an orientation, so the " "only valid value is the default.")); else if (dim == 2) Assert(combined_orientation == - ReferenceCell::default_combined_face_orientation() || + numbers::default_geometric_orientation || combined_orientation == ReferenceCell::reversed_combined_line_orientation(), ExcMessage( @@ -5421,14 +5420,14 @@ TriaAccessor::combined_face_orientation( (void)face; if constexpr (structdim == 1) - return ReferenceCell::default_combined_face_orientation(); + return numbers::default_geometric_orientation; else if constexpr (structdim == 2) { // if all elements are quads (or if we have a very special consistently // oriented triangular mesh) then we do not store this array if (this->tria->levels[this->present_level] ->face_orientations.n_objects() == 0) - return ReferenceCell::default_combined_face_orientation(); + return numbers::default_geometric_orientation; else return this->tria->levels[this->present_level] ->face_orientations.get_orientation( @@ -5461,7 +5460,7 @@ TriaAccessor::face_orientation( return true; else if constexpr (structdim == 2) return this->line_orientation(face) == - ReferenceCell::default_combined_face_orientation(); + numbers::default_geometric_orientation; else return this->tria->levels[this->present_level] ->face_orientations.get_orientation( @@ -5530,13 +5529,12 @@ TriaAccessor::line_orientation( (void)line; if constexpr (structdim == 1) - return ReferenceCell::default_combined_face_orientation(); + return numbers::default_geometric_orientation; else if constexpr (structdim == 2 && dim == 2) // lines in 2d are faces { const auto combined_orientation = combined_face_orientation(line); - Assert(combined_orientation == - ReferenceCell::default_combined_face_orientation() || + Assert(combined_orientation == numbers::default_geometric_orientation || combined_orientation == ReferenceCell::reversed_combined_line_orientation(), ExcInternalError()); @@ -5552,7 +5550,7 @@ TriaAccessor::line_orientation( Assert(index < this->tria->faces->quads_line_orientations.size(), ExcInternalError()); return this->tria->faces->quads_line_orientations[index] ? - ReferenceCell::default_combined_face_orientation() : + numbers::default_geometric_orientation : ReferenceCell::reversed_combined_line_orientation(); } else if constexpr (structdim == 3 && dim == 3) @@ -5612,7 +5610,7 @@ TriaAccessor::set_line_orientation( Assert(index < this->tria->faces->quads_line_orientations.size(), ExcInternalError()); this->tria->faces->quads_line_orientations[index] = - value == ReferenceCell::default_combined_face_orientation(); + value == numbers::default_geometric_orientation; } } @@ -6878,7 +6876,7 @@ inline types::geometric_orientation TriaAccessor<0, dim, spacedim>::combined_face_orientation( const unsigned int /*face*/) { - return ReferenceCell::default_combined_face_orientation(); + return numbers::default_geometric_orientation; } diff --git a/include/deal.II/grid/tria_objects_orientations.h b/include/deal.II/grid/tria_objects_orientations.h index dcfb1bd5d0..bc08b8fa42 100644 --- a/include/deal.II/grid/tria_objects_orientations.h +++ b/include/deal.II/grid/tria_objects_orientations.h @@ -151,8 +151,8 @@ namespace internal TriaObjectsOrientations::reinit(const unsigned int n_objects) { n_stored_objects = n_objects; - object_orientations.assign( - n_objects, ReferenceCell::default_combined_face_orientation()); + object_orientations.assign(n_objects, + numbers::default_geometric_orientation); } @@ -160,8 +160,8 @@ namespace internal inline void TriaObjectsOrientations::resize(const unsigned int n_objects) { - object_orientations.resize( - n_objects, ReferenceCell::default_combined_face_orientation()); + object_orientations.resize(n_objects, + numbers::default_geometric_orientation); n_stored_objects = n_objects; } diff --git a/include/deal.II/non_matching/mapping_info.h b/include/deal.II/non_matching/mapping_info.h index 249e2f8aa6..d083fca14b 100644 --- a/include/deal.II/non_matching/mapping_info.h +++ b/include/deal.II/non_matching/mapping_info.h @@ -1540,9 +1540,9 @@ namespace NonMatching Assert( cell_m->combined_face_orientation(f_m) == - ReferenceCell::default_combined_face_orientation() && + numbers::default_geometric_orientation && cell_p->combined_face_orientation(f_p) == - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, ExcMessage( "Non standard face orientation is currently not implemented.")); diff --git a/include/deal.II/numerics/vector_tools_boundary.templates.h b/include/deal.II/numerics/vector_tools_boundary.templates.h index 26f248aada..28df3a5d5d 100644 --- a/include/deal.II/numerics/vector_tools_boundary.templates.h +++ b/include/deal.II/numerics/vector_tools_boundary.templates.h @@ -1124,9 +1124,9 @@ namespace VectorTools // Note, assuming that the edge orientations are "standard", i.e., // cell->line_orientation(line) = - // ReferenceCell::default_combined_face_orientation() + // numbers::default_geometric_orientation Assert(cell->line_orientation(line) == - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, ExcMessage("Edge orientation does not meet expectation.")); // Next, translate from face to cell. Note, this might be assuming // that the edge orientations are "standard" diff --git a/source/base/qprojector.cc b/source/base/qprojector.cc index 1a3a0d8682..c6b31e9dc5 100644 --- a/source/base/qprojector.cc +++ b/source/base/qprojector.cc @@ -1381,11 +1381,10 @@ QProjector::DataSetDescriptor::face( reference_cell == ReferenceCells::Tetrahedron) { if (dim == 2) - return {(2 * face_no + - (combined_orientation == - ReferenceCell::default_combined_face_orientation() ? - 1 : - 0)) * + return {(2 * face_no + (combined_orientation == + numbers::default_geometric_orientation ? + 1 : + 0)) * n_quadrature_points}; else if (dim == 3) { @@ -1476,10 +1475,10 @@ QProjector::DataSetDescriptor::face( offset += scale[i] * quadrature[i].size(); if (dim == 2) - return {offset + - (combined_orientation == - ReferenceCell::default_combined_face_orientation()) * - quadrature[quadrature.size() == 1 ? 0 : face_no].size()}; + return { + offset + + (combined_orientation == numbers::default_geometric_orientation) * + quadrature[quadrature.size() == 1 ? 0 : face_no].size()}; else if (dim == 3) { return {offset + diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index df0304cf6f..70a46d6274 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -3805,11 +3805,10 @@ namespace parallel if (dim == 2) { AssertIndexRange(face_pair.orientation, 2); - p4est_orientation = - face_pair.orientation == - ReferenceCell::default_combined_face_orientation() ? - 0u : - 1u; + p4est_orientation = face_pair.orientation == + numbers::default_geometric_orientation ? + 0u : + 1u; } else { diff --git a/source/fe/fe.cc b/source/fe/fe.cc index 127c96ff59..adfd95a439 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -575,8 +575,7 @@ FiniteElement::face_to_cell_index( // assertion -- in essence, derived classes have to implement // an overloaded version of this function if we are to use any // other than default (standard) orientation - if (combined_orientation != - ReferenceCell::default_combined_face_orientation()) + if (combined_orientation != numbers::default_geometric_orientation) Assert((this->n_dofs_per_line() <= 1) && (this->n_dofs_per_quad(face) <= 1), ExcMessage( "The function in this base class can not handle this case. " @@ -678,8 +677,7 @@ FiniteElement::adjust_line_dof_index_for_line_orientation( const unsigned int index, const types::geometric_orientation combined_orientation) const { - Assert(combined_orientation == - ReferenceCell::default_combined_face_orientation() || + Assert(combined_orientation == numbers::default_geometric_orientation || combined_orientation == ReferenceCell::reversed_combined_line_orientation(), ExcInternalError()); @@ -688,8 +686,7 @@ FiniteElement::adjust_line_dof_index_for_line_orientation( Assert(adjust_line_dof_index_for_line_orientation_table.size() == this->n_dofs_per_line(), ExcInternalError()); - if (combined_orientation == - ReferenceCell::default_combined_face_orientation()) + if (combined_orientation == numbers::default_geometric_orientation) return index; else return index + adjust_line_dof_index_for_line_orientation_table[index]; diff --git a/source/fe/fe_abf.cc b/source/fe/fe_abf.cc index b251bfa2dc..ee2c917ada 100644 --- a/source/fe/fe_abf.cc +++ b/source/fe/fe_abf.cc @@ -625,7 +625,7 @@ FE_ABF::convert_generalized_support_point_values_to_dof_values( unsigned int k = QProjector::DataSetDescriptor::face( this->reference_cell(), face, - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, n_face_points); for (unsigned int i = 0; i < boundary_weights_abf.size(1); ++i) nodal_values[start_abf_dofs + i] += diff --git a/source/fe/fe_bdm.cc b/source/fe/fe_bdm.cc index 5690427735..547e159928 100644 --- a/source/fe/fe_bdm.cc +++ b/source/fe/fe_bdm.cc @@ -392,7 +392,7 @@ FE_BDM::initialize_support_points(const unsigned int deg) const auto offset = QProjector::DataSetDescriptor::face( this->reference_cell(), f, - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, face_points.size()); for (unsigned int k = 0; k < face_points.size(); ++k) this->generalized_support_points[face_points.size() * f + k] = diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index 207d3a846b..cc3e1ac90e 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -324,13 +324,12 @@ FE_Nedelec<2>::initialize_support_points(const unsigned int order) for (unsigned int line = 0; line < GeometryInfo::lines_per_cell; ++line) this->generalized_support_points[line * n_edge_points + q_point] = - edge_quadrature.point( - QProjector::DataSetDescriptor::face( - this->reference_cell(), - line, - ReferenceCell::default_combined_face_orientation(), - n_edge_points) + - q_point); + edge_quadrature.point(QProjector::DataSetDescriptor::face( + this->reference_cell(), + line, + numbers::default_geometric_orientation, + n_edge_points) + + q_point); for (unsigned int i = 0; i < order; ++i) boundary_weights(q_point, i) = @@ -354,13 +353,12 @@ FE_Nedelec<2>::initialize_support_points(const unsigned int order) ++line) for (unsigned int q_point = 0; q_point < n_edge_points; ++q_point) this->generalized_support_points[line * n_edge_points + q_point] = - edge_quadrature.point( - QProjector::DataSetDescriptor::face( - this->reference_cell(), - line, - ReferenceCell::default_combined_face_orientation(), - n_edge_points) + - q_point); + edge_quadrature.point(QProjector::DataSetDescriptor::face( + this->reference_cell(), + line, + numbers::default_geometric_orientation, + n_edge_points) + + q_point); } } @@ -427,7 +425,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) QProjector::DataSetDescriptor::face( ReferenceCells::get_hypercube(), line, - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, n_edge_points) + q_point); @@ -492,13 +490,12 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) this->generalized_support_points[face * n_face_points + q_point + GeometryInfo::lines_per_cell * n_edge_points] = - face_quadrature.point( - QProjector::DataSetDescriptor::face( - this->reference_cell(), - face, - ReferenceCell::default_combined_face_orientation(), - n_face_points) + - q_point); + face_quadrature.point(QProjector::DataSetDescriptor::face( + this->reference_cell(), + face, + numbers::default_geometric_orientation, + n_face_points) + + q_point); } // Create support points in the interior. @@ -525,7 +522,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) QProjector::DataSetDescriptor::face( ReferenceCells::get_hypercube(), line, - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, n_edge_points) + q_point); diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index bf03ef3595..240bf5f811 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -1155,8 +1155,7 @@ FE_Q_Base::face_to_cell_index( break; case 2: - if (combined_orientation == - ReferenceCell::default_combined_face_orientation()) + if (combined_orientation == numbers::default_geometric_orientation) adjusted_dof_index_on_line = dof_index_on_line; else adjusted_dof_index_on_line = @@ -1173,7 +1172,7 @@ FE_Q_Base::face_to_cell_index( // case where everything is in standard orientation Assert((this->n_dofs_per_line() <= 1) || combined_orientation == - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, ExcNotImplemented()); adjusted_dof_index_on_line = dof_index_on_line; break; @@ -1202,8 +1201,7 @@ FE_Q_Base::face_to_cell_index( // just have to draw a bunch of pictures. in the meantime, // we can implement the Q2 case in which it is simple Assert((this->n_dofs_per_quad(face) <= 1) || - combined_orientation == - ReferenceCell::default_combined_face_orientation(), + combined_orientation == numbers::default_geometric_orientation, ExcNotImplemented()); return (this->get_first_quad_index(face) + index); } diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index 3f88c9e6a4..81e8c879ad 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -210,12 +210,12 @@ FE_RaviartThomas::initialize_support_points(const unsigned int deg) ++current) { // Enter the support point into the vector - this->generalized_support_points[current] = faces.point( - current + QProjector::DataSetDescriptor::face( - this->reference_cell(), - 0, - ReferenceCell::default_combined_face_orientation(), - n_face_points)); + this->generalized_support_points[current] = + faces.point(current + QProjector::DataSetDescriptor::face( + this->reference_cell(), + 0, + numbers::default_geometric_orientation, + n_face_points)); } } diff --git a/source/fe/fe_rt_bubbles.cc b/source/fe/fe_rt_bubbles.cc index 97a3304a00..bf72375dcb 100644 --- a/source/fe/fe_rt_bubbles.cc +++ b/source/fe/fe_rt_bubbles.cc @@ -191,7 +191,7 @@ FE_RT_Bubbles::initialize_support_points(const unsigned int deg) faces.point(k + QProjector::DataSetDescriptor::face( this->reference_cell(), 0, - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, this->n_dofs_per_face(face_no))); current = diff --git a/source/fe/fe_simplex_p.cc b/source/fe/fe_simplex_p.cc index 1522a51420..bc27b22098 100644 --- a/source/fe/fe_simplex_p.cc +++ b/source/fe/fe_simplex_p.cc @@ -44,9 +44,7 @@ namespace for (const auto face_vertex_no : face_reference_cell.vertex_indices()) { const auto vertex_no = reference_cell.face_to_cell_vertices( - face_no, - face_vertex_no, - ReferenceCell::default_combined_face_orientation()); + face_no, face_vertex_no, numbers::default_geometric_orientation); midpoint += reference_cell.template vertex(vertex_no); } diff --git a/source/fe/fe_simplex_p_bubbles.cc b/source/fe/fe_simplex_p_bubbles.cc index 98463d7ecc..a2f1837a8c 100644 --- a/source/fe/fe_simplex_p_bubbles.cc +++ b/source/fe/fe_simplex_p_bubbles.cc @@ -94,7 +94,7 @@ namespace FE_P_BubblesImplementation reference_cell.face_to_cell_vertices( face_no, face_vertex_no, - ReferenceCell::default_combined_face_orientation()); + numbers::default_geometric_orientation); midpoint += reference_cell.template vertex(vertex_no); @@ -177,7 +177,7 @@ namespace FE_P_BubblesImplementation vertices.push_back(reference_cell.face_to_cell_vertices( face_no, face_vertex_no, - ReferenceCell::default_combined_face_orientation())); + numbers::default_geometric_orientation)); Assert(vertices.size() == 3, ExcInternalError()); auto b = diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index 7c3999f0f0..ea88f877fb 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -2283,7 +2283,7 @@ namespace GridTools for (unsigned int i = size_old; i < size_new; ++i) { Assert(matched_pairs[i].orientation == - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, ExcMessage( "Found a face match with non standard orientation. " "This function is only suitable for meshes with cells " diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 78a331b5a8..0641515c04 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -1017,7 +1017,7 @@ ReferenceCell::closest_point(const Point &p) const std::array, 3> vertices; for (unsigned int vertex_no = 0; vertex_no < 3; ++vertex_no) vertices[vertex_no] = vertex(face_to_cell_vertices( - face_no, vertex_no, default_combined_face_orientation())); + face_no, vertex_no, numbers::default_geometric_orientation)); auto pair = project_to_quad(vertices, p, face_cell); if (pair.second < min_distance_square) @@ -1036,7 +1036,7 @@ ReferenceCell::closest_point(const Point &p) const const auto cell_line_no = face_to_cell_lines(face_no, face_line_no, - default_combined_face_orientation()); + numbers::default_geometric_orientation); const auto v0 = vertex(line_to_cell_vertices(cell_line_no, 0)); const auto v1 = diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 835d4f4a3e..987fe0d0ff 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -1836,12 +1836,11 @@ namespace const types::geometric_orientation line_orientation) { AssertIndexRange(child_no, ReferenceCells::Line.template n_children<1>()); - Assert(line_orientation == - ReferenceCell::default_combined_face_orientation() || + Assert(line_orientation == numbers::default_geometric_orientation || line_orientation == ReferenceCell::reversed_combined_line_orientation(), ExcInternalError()); - constexpr auto D = ReferenceCell::default_combined_face_orientation(); + constexpr auto D = numbers::default_geometric_orientation; if (child_no == 0) return line_orientation == D ? 0 : 1; else @@ -3329,7 +3328,7 @@ namespace internal // orientation for a line Assert( combined_orientation == - ReferenceCell::default_combined_face_orientation() || + numbers::default_geometric_orientation || combined_orientation == ReferenceCell::reversed_combined_line_orientation(), ExcInternalError()); @@ -3339,7 +3338,7 @@ namespace internal faces.quads_line_orientations [q * ReferenceCells::max_n_lines<2>() + j] = combined_orientation == - ReferenceCell::default_combined_face_orientation(); + numbers::default_geometric_orientation; } } } @@ -3363,7 +3362,7 @@ namespace internal const auto &orientations = connectivity.entity_orientations(1); for (unsigned int i = 0; i < orientations.n_objects(); ++i) if (orientations.get_combined_orientation(i) != - ReferenceCell::default_combined_face_orientation()) + numbers::default_geometric_orientation) { orientation_needed = true; break; @@ -4084,7 +4083,7 @@ namespace internal // set flags denoting deviations from standard orientation of // faces back to initialization values cell->child(child)->set_combined_face_orientation( - f, ReferenceCell::default_combined_face_orientation()); + f, numbers::default_geometric_orientation); cell->child(child)->clear_used_flag(); } @@ -5177,8 +5176,7 @@ namespace internal 12> new_lines; std::array inherited_orientations; - inherited_orientations.fill( - ReferenceCell::default_combined_face_orientation()); + inherited_orientations.fill(numbers::default_geometric_orientation); unsigned int lmin = 0; unsigned int lmax = 0; @@ -5224,7 +5222,7 @@ namespace internal const auto combined_orientation = cell->combined_face_orientation(face_no); Assert(combined_orientation == - ReferenceCell::default_combined_face_orientation() || + numbers::default_geometric_orientation || combined_orientation == ReferenceCell::reversed_combined_line_orientation(), ExcInternalError()); @@ -5357,7 +5355,7 @@ namespace internal if (cell->reference_cell() == ReferenceCells::Triangle) for (unsigned int face_no : cell->face_indices()) subcells[3]->set_combined_face_orientation( - face_no, ReferenceCell::default_combined_face_orientation()); + face_no, numbers::default_geometric_orientation); for (unsigned int i = 0; i < n_children / 2; ++i) cell->set_children(2 * i, subcells[2 * i]->index()); @@ -6579,7 +6577,7 @@ namespace internal new_quad->set_manifold_id(hex->manifold_id()); for (const auto j : new_quads[i]->line_indices()) new_quad->set_line_orientation( - j, ReferenceCell::default_combined_face_orientation()); + j, numbers::default_geometric_orientation); } // we always get 8 children per refined cell @@ -6623,8 +6621,7 @@ namespace internal // reset faces that are at the boundary of the mother cube for (const auto f : new_hex->face_indices()) new_hex->set_combined_face_orientation( - f, - ReferenceCell::default_combined_face_orientation()); + f, numbers::default_geometric_orientation); } for (unsigned int i = 0; i < n_new_hexes / 2; ++i) hex->set_children(2 * i, new_hexes[2 * i]->index()); @@ -7729,8 +7726,7 @@ namespace internal j < GeometryInfo::lines_per_face; ++j) new_quad->set_line_orientation( - j, - ReferenceCell::default_combined_face_orientation()); + j, numbers::default_geometric_orientation); } // now set the line orientation of children of // outer lines correctly, the lines in the @@ -8395,8 +8391,7 @@ namespace internal j < GeometryInfo::lines_per_face; ++j) new_quad->set_line_orientation( - j, - ReferenceCell::default_combined_face_orientation()); + j, numbers::default_geometric_orientation); } // now set the line orientation of children of // outer lines correctly, the lines in the @@ -8548,8 +8543,7 @@ namespace internal j < GeometryInfo::lines_per_face; ++j) new_quads[i]->set_line_orientation( - j, - ReferenceCell::default_combined_face_orientation()); + j, numbers::default_geometric_orientation); } types::subdomain_id subdomainid = hex->subdomain_id(); @@ -8597,8 +8591,7 @@ namespace internal for (const unsigned int f : GeometryInfo::face_indices()) new_hexes[i]->set_combined_face_orientation( - f, - ReferenceCell::default_combined_face_orientation()); + f, numbers::default_geometric_orientation); } // note these hexes as children to the present cell for (unsigned int i = 0; i < n_new_hexes / 2; ++i) @@ -8781,8 +8774,8 @@ namespace internal for (unsigned int i = 0; i < 4; ++i) if (lines[i]->vertex_index(i % 2) == middle_vertices[i % 2]) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -9009,8 +9002,8 @@ namespace internal for (unsigned int i = 0; i < 4; ++i) if (lines[i]->vertex_index(i % 2) == middle_vertices[i % 2]) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -9239,8 +9232,8 @@ namespace internal for (unsigned int i = 0; i < 4; ++i) if (lines[i]->vertex_index(i % 2) == middle_vertices[i % 2]) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -9557,8 +9550,8 @@ namespace internal // face for (unsigned int i = 0; i < 4; ++i) if (lines[i]->vertex_index(0) == middle_vertices[i]) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -9579,8 +9572,8 @@ namespace internal if (lines[i]->vertex_index((i + 1) % 2) == middle_vertex_index( hex->face(3 + i / 4))) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -9595,7 +9588,7 @@ namespace internal // always true, since it was just constructed // that way line_orientation[12] = - ReferenceCell::default_combined_face_orientation(); + numbers::default_geometric_orientation; // set up the 4 quads, numbered as follows (left // quad numbering, right line numbering @@ -9994,8 +9987,8 @@ namespace internal // line is 'true', if vertex 0 is on the front for (unsigned int i = 0; i < 4; ++i) if (lines[i]->vertex_index(0) == middle_vertices[i]) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -10016,8 +10009,8 @@ namespace internal if (lines[i]->vertex_index((i + 1) % 2) == middle_vertex_index( hex->face(1 + i / 4))) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way @@ -10033,7 +10026,7 @@ namespace internal // always true, since it was just constructed // that way line_orientation[12] = - ReferenceCell::default_combined_face_orientation(); + numbers::default_geometric_orientation; // set up the 4 quads, numbered as follows (left // quad numbering, right line numbering @@ -10447,8 +10440,8 @@ namespace internal // line is 'true', if vertex 0 is on the front for (unsigned int i = 0; i < 4; ++i) if (lines[i]->vertex_index(0) == middle_vertices[i]) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -10469,8 +10462,8 @@ namespace internal if (lines[i]->vertex_index((i + 1) % 2) == middle_vertex_index( hex->face(i / 4 - 1))) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way round then @@ -10484,7 +10477,7 @@ namespace internal // for the last line the line orientation is always // the default, since it was just constructed that way line_orientation[12] = - ReferenceCell::default_combined_face_orientation(); + numbers::default_geometric_orientation; // set up the 4 quads, numbered as follows (left // quad numbering, right line numbering @@ -11036,8 +11029,8 @@ namespace internal for (unsigned int i = 0; i < 24; ++i) if (lines[i]->vertex_index((i + 1) % 2) == vertex_indices[i / 4]) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; else { // it must be the other way @@ -11052,8 +11045,8 @@ namespace internal // always true, since they were just constructed // that way for (unsigned int i = 24; i < 30; ++i) - line_orientation[i] = ReferenceCell:: - default_combined_face_orientation(); + line_orientation[i] = + numbers::default_geometric_orientation; // set up the 12 quads, numbered as follows // (left quad numbering, right line numbering diff --git a/tests/bits/periodicity_09.cc b/tests/bits/periodicity_09.cc index 013b6e907c..5481eda0e2 100644 --- a/tests/bits/periodicity_09.cc +++ b/tests/bits/periodicity_09.cc @@ -72,7 +72,7 @@ test() (std::next(dof_handler.begin(0)))->face(1), cm, ComponentMask(), - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, FullMatrix(), std::vector(), periodicity_factor); diff --git a/tests/fe/fe_conformity_test.h b/tests/fe/fe_conformity_test.h index df239860cd..fe83418ce0 100644 --- a/tests/fe/fe_conformity_test.h +++ b/tests/fe/fe_conformity_test.h @@ -192,7 +192,7 @@ namespace FEConforimityTest { deallog << " {" << line_index << " -> " << (cell->line_orientation(line_index) == - ReferenceCell::default_combined_face_orientation()) + numbers::default_geometric_orientation) << "}" << std::endl; } // line_index } // cell @@ -245,7 +245,7 @@ namespace FEConforimityTest { deallog << " {" << line_index << " -> " << (cell->line_orientation(line_index) == - ReferenceCell::default_combined_face_orientation()) + numbers::default_geometric_orientation) << "}" << std::endl; } // line_index } // cell diff --git a/tests/grid/extrude_orientation_01.cc b/tests/grid/extrude_orientation_01.cc index 45f6748fe9..af4cb6ba19 100644 --- a/tests/grid/extrude_orientation_01.cc +++ b/tests/grid/extrude_orientation_01.cc @@ -69,7 +69,7 @@ test(std::ostream &out) for (unsigned int e = 0; e < GeometryInfo<3>::lines_per_cell; ++e) deallog << " edge=" << e << (c->line_orientation(e) == - ReferenceCell::default_combined_face_orientation() ? + numbers::default_geometric_orientation ? " -> true" : " -> false") << std::endl; diff --git a/tests/grid/extrude_orientation_02.cc b/tests/grid/extrude_orientation_02.cc index 571f5cc878..b4807915af 100644 --- a/tests/grid/extrude_orientation_02.cc +++ b/tests/grid/extrude_orientation_02.cc @@ -62,7 +62,7 @@ test() for (unsigned int e = 0; e < GeometryInfo<3>::lines_per_cell; ++e) deallog << " edge=" << e << (c->line_orientation(e) == - ReferenceCell::default_combined_face_orientation() ? + numbers::default_geometric_orientation ? " -> true" : " -> false") << std::endl; diff --git a/tests/grid/extrude_orientation_03.cc b/tests/grid/extrude_orientation_03.cc index 48b2dd8ed2..2022b03b0a 100644 --- a/tests/grid/extrude_orientation_03.cc +++ b/tests/grid/extrude_orientation_03.cc @@ -61,7 +61,7 @@ test() for (unsigned int e = 0; e < GeometryInfo<3>::lines_per_cell; ++e) deallog << " edge=" << e << (c->line_orientation(e) == - ReferenceCell::default_combined_face_orientation() ? + numbers::default_geometric_orientation ? " -> true" : " -> false") << std::endl; diff --git a/tests/grid/grid_generator_10.cc b/tests/grid/grid_generator_10.cc index 16f776486f..033017d7b7 100644 --- a/tests/grid/grid_generator_10.cc +++ b/tests/grid/grid_generator_10.cc @@ -108,12 +108,12 @@ check_grid() { deallog << line << ": " << (cell->line_orientation(line) == - ReferenceCell::default_combined_face_orientation() ? + numbers::default_geometric_orientation ? "true" : "false") << std::endl; Assert(cell->line_orientation(line) == - ReferenceCell::default_combined_face_orientation(), + numbers::default_geometric_orientation, ExcInternalError()); } } diff --git a/tests/grid/grid_generator_non_standard_orientation_mesh_2d.cc b/tests/grid/grid_generator_non_standard_orientation_mesh_2d.cc index 07b0c71f8f..de69ab6c91 100644 --- a/tests/grid/grid_generator_non_standard_orientation_mesh_2d.cc +++ b/tests/grid/grid_generator_non_standard_orientation_mesh_2d.cc @@ -56,7 +56,7 @@ plot_all_info(const Triangulation &tria) ++line_index) { deallog << (cell->line_orientation(line_index) == - ReferenceCell::default_combined_face_orientation()) + numbers::default_geometric_orientation) << " "; } // line_index deallog << '}' << std::endl << std::endl; diff --git a/tests/grid/grid_generator_non_standard_orientation_mesh_3d.cc b/tests/grid/grid_generator_non_standard_orientation_mesh_3d.cc index d8d87fb994..44303d3d87 100644 --- a/tests/grid/grid_generator_non_standard_orientation_mesh_3d.cc +++ b/tests/grid/grid_generator_non_standard_orientation_mesh_3d.cc @@ -57,7 +57,7 @@ plot_all_info(const Triangulation &tria) ++line_index) { deallog << (cell->line_orientation(line_index) == - ReferenceCell::default_combined_face_orientation()) + numbers::default_geometric_orientation) << " "; } // line_index deallog << '}' << std::endl << std::endl; diff --git a/tests/grid/reference_cell_type_05.cc b/tests/grid/reference_cell_type_05.cc index 45cba2a5cb..a3421cd7f7 100644 --- a/tests/grid/reference_cell_type_05.cc +++ b/tests/grid/reference_cell_type_05.cc @@ -39,7 +39,7 @@ test(const ReferenceCell &reference_cell) Assert(reference_cell.face_vertex_location(f, v) == reference_cell.vertex( reference_cell.face_to_cell_vertices( - f, v, ReferenceCell::default_combined_face_orientation())), + f, v, numbers::default_geometric_orientation)), ExcInternalError()); } } diff --git a/tests/simplex/orientation_03.cc b/tests/simplex/orientation_03.cc index 38f5d807fa..a80a54fac1 100644 --- a/tests/simplex/orientation_03.cc +++ b/tests/simplex/orientation_03.cc @@ -39,7 +39,7 @@ test_face(const std::vector> &vertices_, Point<3> extra_vertex; for (unsigned int i = 0; i < 3; ++i) extra_vertex += ref_cell.template vertex<3>(ref_cell.face_to_cell_vertices( - face_n, i, ReferenceCell::default_combined_face_orientation())); + face_n, i, numbers::default_geometric_orientation)); extra_vertex /= 3.0; extra_vertex += ref_cell.template unit_normal_vectors<3>(face_n); @@ -50,7 +50,7 @@ test_face(const std::vector> &vertices_, cell_data.back().vertices.resize(0); for (unsigned int i = 0; i < 3; ++i) cell_data.back().vertices.push_back(ref_cell.face_to_cell_vertices( - face_n, i, ref_cell.default_combined_face_orientation())); + face_n, i, numbers::default_geometric_orientation)); cell_data.back().vertices.push_back(ref_cell.n_vertices()); std::sort(cell_data.back().vertices.begin(), cell_data.back().vertices.end()); diff --git a/tests/simplex/orientation_04.cc b/tests/simplex/orientation_04.cc index 7f3025ada9..ff4f4c2d84 100644 --- a/tests/simplex/orientation_04.cc +++ b/tests/simplex/orientation_04.cc @@ -57,7 +57,7 @@ create_triangulation(const std::vector> &vertices_, Point<3> extra_vertex; for (unsigned int i = 0; i < 3; ++i) extra_vertex += ref_cell.template vertex<3>(ref_cell.face_to_cell_vertices( - face_n, i, ReferenceCell::default_combined_face_orientation())); + face_n, i, numbers::default_geometric_orientation)); extra_vertex /= 3.0; extra_vertex += ref_cell.template unit_normal_vectors<3>(face_n); @@ -68,7 +68,7 @@ create_triangulation(const std::vector> &vertices_, cell_data.back().vertices.resize(0); for (unsigned int i = 0; i < 3; ++i) cell_data.back().vertices.push_back(ref_cell.face_to_cell_vertices( - face_n, i, ref_cell.default_combined_face_orientation())); + face_n, i, numbers::default_geometric_orientation)); cell_data.back().vertices.push_back(ref_cell.n_vertices()); std::sort(cell_data.back().vertices.begin(), cell_data.back().vertices.end()); -- 2.39.5