From: Wolfgang Bangerth Date: Mon, 8 Feb 2021 04:46:04 +0000 (-0700) Subject: Also move get_hypercube/simplex() into namespace ReferenceCells. X-Git-Tag: v9.3.0-rc1~482^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=391ad8b20ce1e3a4ed6d2ea77fc9aa350e640a2a;p=dealii.git Also move get_hypercube/simplex() into namespace ReferenceCells. --- diff --git a/include/deal.II/base/qprojector.h b/include/deal.II/base/qprojector.h index e2f279ca47..739512014c 100644 --- a/include/deal.II/base/qprojector.h +++ b/include/deal.II/base/qprojector.h @@ -579,7 +579,7 @@ template Quadrature inline QProjector::project_to_all_faces( const Quadrature &quadrature) { - return project_to_all_faces(ReferenceCell::get_hypercube(), quadrature); + return project_to_all_faces(ReferenceCells::get_hypercube(), quadrature); } diff --git a/include/deal.II/fe/fe_poly_face.h b/include/deal.II/fe/fe_poly_face.h index 3038921d24..85ecba5713 100644 --- a/include/deal.II/fe/fe_poly_face.h +++ b/include/deal.II/fe/fe_poly_face.h @@ -178,7 +178,7 @@ protected: update_flags, mapping, hp::QCollection(QProjector::project_to_all_children( - ReferenceCell::get_hypercube(), quadrature)), + ReferenceCells::get_hypercube(), quadrature)), output_data); } diff --git a/include/deal.II/fe/mapping_q1.h b/include/deal.II/fe/mapping_q1.h index a4a6ccf64e..b5712068bc 100644 --- a/include/deal.II/fe/mapping_q1.h +++ b/include/deal.II/fe/mapping_q1.h @@ -84,7 +84,7 @@ public: * @note The use of this object should be avoided since it is only applicable * in cases where a mesh consists exclusively of quadrilaterals or hexahedra. * Use - * `ReferenceCell::get_hypercube().get_default_linear_mapping()` + * `ReferenceCells::get_hypercube().get_default_linear_mapping()` * instead. */ template diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 0a57525cc0..44e2e4895d 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -176,7 +176,7 @@ namespace GridTools double volume(const Triangulation &tria, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -194,7 +194,7 @@ namespace GridTools minimal_cell_diameter( const Triangulation &triangulation, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -212,7 +212,7 @@ namespace GridTools maximal_cell_diameter( const Triangulation &triangulation, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -1044,7 +1044,7 @@ namespace GridTools extract_used_vertices( const Triangulation &container, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -1872,7 +1872,7 @@ namespace GridTools const typename Triangulation::active_cell_iterator &cell, const Point & position, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -3272,7 +3272,7 @@ namespace GridTools !cell->face(face)->at_boundary()) { Assert(cell->reference_cell() == - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), ExcNotImplemented()); // this line has children @@ -3292,7 +3292,7 @@ namespace GridTools !cell->face(face)->at_boundary()) { Assert(cell->reference_cell() == - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), ExcNotImplemented()); // this face has hanging nodes diff --git a/include/deal.II/grid/grid_tools_cache.h b/include/deal.II/grid/grid_tools_cache.h index 6c326bf31e..d8ea235b03 100644 --- a/include/deal.II/grid/grid_tools_cache.h +++ b/include/deal.II/grid/grid_tools_cache.h @@ -76,7 +76,7 @@ namespace GridTools */ Cache(const Triangulation &tria, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index e6341c7b92..338310047d 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -80,24 +80,6 @@ namespace internal class ReferenceCell { public: - /** - * Return the correct simplex reference cell type for the given dimension - * `dim`. Depending on the template argument `dim`, this function returns a - * reference to either Vertex, Triangle, or Tetrahedron. - */ - template - static constexpr const ReferenceCell & - get_simplex(); - - /** - * Return the correct hypercube reference cell type for the given dimension - * `dim`. Depending on the template argument `dim`, this function returns a - * reference to either Vertex, Quadrilateral, or Hexahedron. - */ - template - static constexpr const ReferenceCell & - get_hypercube(); - /** * Return the correct ReferenceCell for a given structural * dimension and number of vertices. For example, if `dim==2` and @@ -297,12 +279,6 @@ private: -inline constexpr ReferenceCell::ReferenceCell() - : ReferenceCell(static_cast(-1)) -{} - - - inline constexpr ReferenceCell::ReferenceCell(const std::uint8_t kind) : kind(kind) {} @@ -381,10 +357,34 @@ namespace ReferenceCells DEAL_II_CONSTEXPR const ReferenceCell Invalid = internal::ReferenceCell::make_reference_cell_from_int( static_cast(-1)); + + /** + * Return the correct simplex reference cell type for the given dimension + * `dim`. Depending on the template argument `dim`, this function returns a + * reference to either Vertex, Triangle, or Tetrahedron. + */ + template + constexpr const ReferenceCell & + get_simplex(); + + /** + * Return the correct hypercube reference cell type for the given dimension + * `dim`. Depending on the template argument `dim`, this function returns a + * reference to either Vertex, Quadrilateral, or Hexahedron. + */ + template + constexpr const ReferenceCell & + get_hypercube(); } // namespace ReferenceCells +inline constexpr ReferenceCell::ReferenceCell() + : ReferenceCell(ReferenceCells::Invalid) +{} + + + template inline void ReferenceCell::serialize(Archive &archive, const unsigned int /*version*/) @@ -504,48 +504,50 @@ ReferenceCell::get_dimension() const -template -inline constexpr const ReferenceCell & -ReferenceCell::get_simplex() +namespace ReferenceCells { - switch (dim) - { - case 0: - return ReferenceCells::Vertex; - case 1: - return ReferenceCells::Line; - case 2: - return ReferenceCells::Triangle; - case 3: - return ReferenceCells::Tetrahedron; - default: - Assert(false, ExcNotImplemented()); - return ReferenceCells::Invalid; - } -} - + template + inline constexpr const ReferenceCell & + get_simplex() + { + switch (dim) + { + case 0: + return ReferenceCells::Vertex; + case 1: + return ReferenceCells::Line; + case 2: + return ReferenceCells::Triangle; + case 3: + return ReferenceCells::Tetrahedron; + default: + Assert(false, ExcNotImplemented()); + return ReferenceCells::Invalid; + } + } -template -inline constexpr const ReferenceCell & -ReferenceCell::get_hypercube() -{ - switch (dim) - { - case 0: - return ReferenceCells::Vertex; - case 1: - return ReferenceCells::Line; - case 2: - return ReferenceCells::Quadrilateral; - case 3: - return ReferenceCells::Hexahedron; - default: - Assert(false, ExcNotImplemented()); - return ReferenceCells::Invalid; - } -} + template + inline constexpr const ReferenceCell & + get_hypercube() + { + switch (dim) + { + case 0: + return ReferenceCells::Vertex; + case 1: + return ReferenceCells::Line; + case 2: + return ReferenceCells::Quadrilateral; + case 3: + return ReferenceCells::Hexahedron; + default: + Assert(false, ExcNotImplemented()); + return ReferenceCells::Invalid; + } + } +} // namespace ReferenceCells inline ReferenceCell @@ -596,7 +598,7 @@ ReferenceCell::d_linear_shape_function(const Point & xi, const unsigned int i) const { AssertDimension(dim, get_dimension()); - if (*this == get_hypercube()) + if (*this == ReferenceCells::get_hypercube()) return GeometryInfo::d_linear_shape_function(xi, i); if (*this == @@ -690,7 +692,7 @@ ReferenceCell::d_linear_shape_function_gradient(const Point & xi, const unsigned int i) const { AssertDimension(dim, get_dimension()); - if (*this == get_hypercube()) + if (*this == ReferenceCells::get_hypercube()) return GeometryInfo::d_linear_shape_function_gradient(xi, i); if (*this == @@ -722,7 +724,7 @@ ReferenceCell::unit_tangential_vectors(const unsigned int face_no, AssertDimension(dim, get_dimension()); AssertIndexRange(i, dim - 1); - if (*this == get_hypercube()) + if (*this == ReferenceCells::get_hypercube()) { AssertIndexRange(face_no, GeometryInfo::faces_per_cell); return GeometryInfo::unit_tangential_vectors[face_no][i]; diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 7c5d3c34d7..d51a855ba7 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -1756,7 +1756,7 @@ namespace internal Assert(index < dim, ExcInternalError()); if ((reference_cell == dealii::ReferenceCells::Invalid || - reference_cell == dealii::ReferenceCell::get_hypercube()) == + reference_cell == dealii::ReferenceCells::get_hypercube()) == false) { #ifdef DEAL_II_WITH_SIMPLEX_SUPPORT diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 000280ff1e..df3f382117 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -1481,7 +1481,7 @@ MatrixFree::initialize_indices( ++fe_no) shape_info_dummy(c, fe_no).reinit( dof_handlers[no]->get_fe(fe_no).reference_cell() == - ReferenceCell::get_hypercube() ? + ReferenceCells::get_hypercube() ? quad : quad_simplex, dof_handlers[no]->get_fe(fe_no), diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index e4f9dbd208..1ec957421e 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -317,7 +317,7 @@ namespace internal try { const dealii::ReferenceCell reference_cell = - dealii::ReferenceCell::get_simplex(); + dealii::ReferenceCells::get_simplex(); const auto quad_face = get_face_quadrature(quad); this->n_q_points_face = quad_face.size(); diff --git a/include/deal.II/numerics/vector_tools_constraints.h b/include/deal.II/numerics/vector_tools_constraints.h index e005f6b219..7d41e342a4 100644 --- a/include/deal.II/numerics/vector_tools_constraints.h +++ b/include/deal.II/numerics/vector_tools_constraints.h @@ -280,7 +280,7 @@ namespace VectorTools & function_map, AffineConstraints & constraints, const Mapping &mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -303,7 +303,7 @@ namespace VectorTools const std::set &boundary_ids, AffineConstraints & constraints, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -332,7 +332,7 @@ namespace VectorTools & function_map, AffineConstraints & constraints, const Mapping &mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -351,7 +351,7 @@ namespace VectorTools const std::set &boundary_ids, AffineConstraints & constraints, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); //@} diff --git a/include/deal.II/numerics/vector_tools_project.templates.h b/include/deal.II/numerics/vector_tools_project.templates.h index 4c543dbf21..dabf0be28d 100644 --- a/include/deal.II/numerics/vector_tools_project.templates.h +++ b/include/deal.II/numerics/vector_tools_project.templates.h @@ -183,7 +183,8 @@ namespace VectorTools Quadrature quadrature_mf; - if (dof.get_fe(0).reference_cell() == ReferenceCell::get_hypercube()) + if (dof.get_fe(0).reference_cell() == + ReferenceCells::get_hypercube()) quadrature_mf = QGauss(dof.get_fe().degree + 2); else // TODO: since we have currently only implemented a handful quadrature diff --git a/include/deal.II/particles/generators.h b/include/deal.II/particles/generators.h index a45fd50c09..b23cda76db 100644 --- a/include/deal.II/particles/generators.h +++ b/include/deal.II/particles/generators.h @@ -69,7 +69,7 @@ namespace Particles const std::vector> & particle_reference_locations, ParticleHandler & particle_handler, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -108,7 +108,7 @@ namespace Particles const types::particle_index id, std::mt19937 & random_number_generator, const Mapping &mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping())); /** @@ -164,7 +164,7 @@ namespace Particles const types::particle_index n_particles_to_create, ParticleHandler & particle_handler, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping()), const unsigned int random_number_seed = 5432); @@ -211,7 +211,7 @@ namespace Particles & global_bounding_boxes, ParticleHandler &particle_handler, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping()), const ComponentMask & components = ComponentMask(), const std::vector> &properties = {}); @@ -256,7 +256,7 @@ namespace Particles & global_bounding_boxes, ParticleHandler &particle_handler, const Mapping & mapping = - (ReferenceCell::get_hypercube() + (ReferenceCells::get_hypercube() .template get_default_linear_mapping()), const std::vector> &properties = {}); } // namespace Generators diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index bc6a797e13..746e2d9653 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -293,7 +293,7 @@ namespace DataOutBase (n_data_sets + spacedim) : n_data_sets, patch.data.n_rows())); - Assert(patch.reference_cell != ReferenceCell::get_hypercube() || + Assert(patch.reference_cell != ReferenceCells::get_hypercube() || (n_data_sets == 0) || (patch.data.n_cols() == Utilities::fixed_power(n_subdivisions + 1)), @@ -615,7 +615,7 @@ namespace if (write_higher_order_cells) { - if (patch.reference_cell == ReferenceCell::get_hypercube()) + if (patch.reference_cell == ReferenceCells::get_hypercube()) { const std::array cell_type_by_dim{ {VTK_VERTEX, @@ -671,7 +671,7 @@ namespace vtk_cell_id[0] = VTK_PYRAMID; vtk_cell_id[1] = 1; } - else if (patch.reference_cell == ReferenceCell::get_hypercube()) + else if (patch.reference_cell == ReferenceCells::get_hypercube()) { const std::array cell_type_by_dim{ {VTK_VERTEX, VTK_LINE, VTK_QUAD, VTK_HEXAHEDRON}}; @@ -683,7 +683,7 @@ namespace Assert(false, ExcNotImplemented()); } - if (patch.reference_cell != ReferenceCell::get_hypercube() || + if (patch.reference_cell != ReferenceCells::get_hypercube() || write_higher_order_cells) vtk_cell_id[2] = patch.data.n_cols(); else @@ -919,7 +919,7 @@ namespace for (const auto &patch : patches) { // The following formula doesn't hold for non-tensor products. - if (patch.reference_cell == ReferenceCell::get_hypercube()) + if (patch.reference_cell == ReferenceCells::get_hypercube()) { n_nodes += Utilities::fixed_power(patch.n_subdivisions + 1); n_cells += Utilities::fixed_power(patch.n_subdivisions); @@ -950,7 +950,7 @@ namespace for (const auto &patch : patches) { // The following formulas don't hold for non-tensor products. - if (patch.reference_cell == ReferenceCell::get_hypercube()) + if (patch.reference_cell == ReferenceCells::get_hypercube()) { n_nodes += Utilities::fixed_power(patch.n_subdivisions + 1); @@ -1866,7 +1866,7 @@ namespace DataOutBase : patch_index(no_neighbor) , n_subdivisions(1) , points_are_available(false) - , reference_cell(ReferenceCell::get_hypercube()) + , reference_cell(ReferenceCells::get_hypercube()) // all the other data has a constructor of its own, except for the "neighbors" // field, which we set to invalid values. { @@ -1968,7 +1968,7 @@ namespace DataOutBase Patch<0, spacedim>::Patch() : patch_index(no_neighbor) , points_are_available(false) - , reference_cell(ReferenceCell::get_hypercube<0>()) + , reference_cell(ReferenceCells::get_hypercube<0>()) { Assert(spacedim <= 3, ExcNotImplemented()); } @@ -2631,7 +2631,7 @@ namespace DataOutBase // special treatment of simplices since they are not subdivided, such // that no new nodes have to be created, but the precomputed ones can be // used - if (patch.reference_cell != ReferenceCell::get_hypercube()) + if (patch.reference_cell != ReferenceCells::get_hypercube()) { Point node; @@ -2675,7 +2675,7 @@ namespace DataOutBase for (const auto &patch : patches) { // special treatment of simplices since they are not subdivided - if (patch.reference_cell != ReferenceCell::get_hypercube()) + if (patch.reference_cell != ReferenceCells::get_hypercube()) { out.write_cell_single(count++, first_vertex_of_patch, @@ -2727,7 +2727,7 @@ namespace DataOutBase for (const auto &patch : patches) { - if (patch.reference_cell != ReferenceCell::get_hypercube()) + if (patch.reference_cell != ReferenceCells::get_hypercube()) { connectivity.resize(patch.data.n_cols()); @@ -8668,16 +8668,16 @@ XDMFEntry::get_xdmf_content(const unsigned int indent_level) const { case 0: return get_xdmf_content(indent_level, - ReferenceCell::get_hypercube<0>()); + ReferenceCells::get_hypercube<0>()); case 1: return get_xdmf_content(indent_level, - ReferenceCell::get_hypercube<1>()); + ReferenceCells::get_hypercube<1>()); case 2: return get_xdmf_content(indent_level, - ReferenceCell::get_hypercube<2>()); + ReferenceCells::get_hypercube<2>()); case 3: return get_xdmf_content(indent_level, - ReferenceCell::get_hypercube<3>()); + ReferenceCells::get_hypercube<3>()); default: Assert(false, ExcNotImplemented()); } diff --git a/source/base/qprojector.cc b/source/base/qprojector.cc index 9535a117be..0a310707ce 100644 --- a/source/base/qprojector.cc +++ b/source/base/qprojector.cc @@ -1239,7 +1239,7 @@ Quadrature QProjector::project_to_child(const Quadrature &quadrature, const unsigned int child_no) { - return project_to_child(ReferenceCell::get_hypercube(), + return project_to_child(ReferenceCells::get_hypercube(), quadrature, child_no); } @@ -1252,7 +1252,7 @@ QProjector::project_to_child(const ReferenceCell reference_cell, const Quadrature &quadrature, const unsigned int child_no) { - Assert(reference_cell == ReferenceCell::get_hypercube(), + Assert(reference_cell == ReferenceCells::get_hypercube(), ExcNotImplemented()); (void)reference_cell; @@ -1282,7 +1282,7 @@ template Quadrature QProjector::project_to_all_children(const Quadrature &quadrature) { - return project_to_all_children(ReferenceCell::get_hypercube(), + return project_to_all_children(ReferenceCells::get_hypercube(), quadrature); } @@ -1293,7 +1293,7 @@ Quadrature QProjector::project_to_all_children(const ReferenceCell reference_cell, const Quadrature &quadrature) { - Assert(reference_cell == ReferenceCell::get_hypercube(), + Assert(reference_cell == ReferenceCells::get_hypercube(), ExcNotImplemented()); (void)reference_cell; @@ -1325,7 +1325,7 @@ QProjector::project_to_line(const Quadrature<1> &quadrature, const Point & p1, const Point & p2) { - return project_to_line(ReferenceCell::get_hypercube(), + return project_to_line(ReferenceCells::get_hypercube(), quadrature, p1, p2); @@ -1340,7 +1340,7 @@ QProjector::project_to_line(const ReferenceCell reference_cell, const Point & p1, const Point & p2) { - Assert(reference_cell == ReferenceCell::get_hypercube(), + Assert(reference_cell == ReferenceCells::get_hypercube(), ExcNotImplemented()); (void)reference_cell; @@ -1369,7 +1369,7 @@ QProjector::DataSetDescriptor::face(const unsigned int face_no, const bool face_rotation, const unsigned int n_quadrature_points) { - return face(ReferenceCell::get_hypercube(), + return face(ReferenceCells::get_hypercube(), face_no, face_orientation, face_flip, @@ -1401,7 +1401,7 @@ QProjector::DataSetDescriptor::face(const ReferenceCell reference_cell, } } - Assert(reference_cell == ReferenceCell::get_hypercube(), + Assert(reference_cell == ReferenceCells::get_hypercube(), ExcNotImplemented()); Assert(face_no < GeometryInfo::faces_per_cell, ExcInternalError()); @@ -1519,7 +1519,7 @@ QProjector::DataSetDescriptor::face( } } - Assert(reference_cell == ReferenceCell::get_hypercube(), + Assert(reference_cell == ReferenceCells::get_hypercube(), ExcNotImplemented()); Assert(face_no < GeometryInfo::faces_per_cell, ExcInternalError()); @@ -1982,7 +1982,7 @@ Quadrature QProjector::project_to_face(const SubQuadrature &quadrature, const unsigned int face_no) { - return project_to_face(ReferenceCell::get_hypercube(), + return project_to_face(ReferenceCells::get_hypercube(), quadrature, face_no); } @@ -1995,7 +1995,7 @@ QProjector::project_to_face(const ReferenceCell reference_cell, const SubQuadrature &quadrature, const unsigned int face_no) { - Assert(reference_cell == ReferenceCell::get_hypercube(), + Assert(reference_cell == ReferenceCells::get_hypercube(), ExcNotImplemented()); (void)reference_cell; @@ -2013,7 +2013,7 @@ QProjector::project_to_subface(const SubQuadrature & quadrature, const unsigned int subface_no, const RefinementCase &ref_case) { - return project_to_subface(ReferenceCell::get_hypercube(), + return project_to_subface(ReferenceCells::get_hypercube(), quadrature, face_no, subface_no, @@ -2030,7 +2030,7 @@ QProjector::project_to_subface(const ReferenceCell reference_cell, const unsigned int subface_no, const RefinementCase &ref_case) { - Assert(reference_cell == ReferenceCell::get_hypercube(), + Assert(reference_cell == ReferenceCells::get_hypercube(), ExcNotImplemented()); (void)reference_cell; diff --git a/source/base/tensor_product_polynomials.cc b/source/base/tensor_product_polynomials.cc index ac9a0a8af6..4917076f64 100644 --- a/source/base/tensor_product_polynomials.cc +++ b/source/base/tensor_product_polynomials.cc @@ -382,7 +382,7 @@ TensorProductPolynomials::evaluate( else for (indices[0] = 0; indices[0] < n_polynomials; ++indices[0], ++ind) { - unsigned int i = index_map_inverse[ind]; + const unsigned int i = index_map_inverse[ind]; if (update_values) { diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index 996609a80b..d8867eaefc 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -381,7 +381,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) const unsigned int n_edge_points = reference_edge_quadrature.size(); const Quadrature &edge_quadrature = QProjector::project_to_all_faces( - ReferenceCell::get_hypercube(), reference_edge_quadrature); + ReferenceCells::get_hypercube(), reference_edge_quadrature); if (order > 0) { @@ -414,7 +414,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) q_point] = edge_quadrature.point( QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), line, true, false, @@ -515,7 +515,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) q_point] = edge_quadrature.point( QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), line, true, false, diff --git a/source/fe/fe_nothing.cc b/source/fe/fe_nothing.cc index 586d9ef140..1fe83c4f3b 100644 --- a/source/fe/fe_nothing.cc +++ b/source/fe/fe_nothing.cc @@ -51,7 +51,7 @@ FE_Nothing::FE_Nothing(const ReferenceCell &type, template FE_Nothing::FE_Nothing(const unsigned int n_components, const bool dominate) - : FE_Nothing(ReferenceCell::get_hypercube(), + : FE_Nothing(ReferenceCells::get_hypercube(), n_components, dominate) {} @@ -75,7 +75,7 @@ FE_Nothing::get_name() const namebuf << "FE_Nothing<" << Utilities::dim_string(dim, spacedim) << ">("; std::vector name_components; - if (this->reference_cell() != ReferenceCell::get_hypercube()) + if (this->reference_cell() != ReferenceCells::get_hypercube()) name_components.push_back(this->reference_cell().to_string()); if (this->n_components() > 1) name_components.push_back(std::to_string(this->n_components())); diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index db96b251e4..122f0a3017 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -263,22 +263,22 @@ struct FE_Q_Base::Implementation // line 5: use line 9 QProjector::project_to_subface( - ReferenceCell::get_hypercube(), qline, 0, 0, p_line); + ReferenceCells::get_hypercube(), qline, 0, 0, p_line); for (unsigned int i = 0; i < n; ++i) constraint_points.push_back(p_line[i] + Point(0.5, 0)); // line 6: use line 10 QProjector::project_to_subface( - ReferenceCell::get_hypercube(), qline, 0, 1, p_line); + ReferenceCells::get_hypercube(), qline, 0, 1, p_line); for (unsigned int i = 0; i < n; ++i) constraint_points.push_back(p_line[i] + Point(0.5, 0)); // line 7: use line 13 QProjector::project_to_subface( - ReferenceCell::get_hypercube(), qline, 2, 0, p_line); + ReferenceCells::get_hypercube(), qline, 2, 0, p_line); for (unsigned int i = 0; i < n; ++i) constraint_points.push_back(p_line[i] + Point(0, 0.5)); // line 8: use line 14 QProjector::project_to_subface( - ReferenceCell::get_hypercube(), qline, 2, 1, p_line); + ReferenceCells::get_hypercube(), qline, 2, 1, p_line); for (unsigned int i = 0; i < n; ++i) constraint_points.push_back(p_line[i] + Point(0, 0.5)); @@ -291,7 +291,7 @@ struct FE_Q_Base::Implementation ++subface) { QProjector::project_to_subface( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), qline, face, subface, diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index 3837e8255f..0cb01fa4ee 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -134,9 +134,8 @@ MappingCartesian::get_face_data( AssertDimension(quadrature.size(), 1); std::unique_ptr::InternalDataBase> data_ptr = - std::make_unique( - QProjector::project_to_all_faces(ReferenceCell::get_hypercube(), - quadrature[0])); + std::make_unique(QProjector::project_to_all_faces( + ReferenceCells::get_hypercube(), quadrature[0])); auto &data = dynamic_cast(*data_ptr); // verify that we have computed the transitive hull of the required @@ -161,7 +160,7 @@ MappingCartesian::get_subface_data( { std::unique_ptr::InternalDataBase> data_ptr = std::make_unique(QProjector::project_to_all_subfaces( - ReferenceCell::get_hypercube(), quadrature)); + ReferenceCells::get_hypercube(), quadrature)); auto &data = dynamic_cast(*data_ptr); // verify that we have computed the transitive hull of the required @@ -244,7 +243,7 @@ MappingCartesian::maybe_update_face_quadrature_points( if (data.update_each & update_quadrature_points) { const auto offset = QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, cell->face_orientation(face_no), cell->face_flip(face_no), @@ -277,7 +276,7 @@ MappingCartesian::maybe_update_subface_quadrature_points( if (data.update_each & update_quadrature_points) { const auto offset = QProjector::DataSetDescriptor::subface( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, sub_no, cell->face_orientation(face_no), diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index a1fa54b47a..9859e547ec 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -645,7 +645,7 @@ MappingFEField::get_face_data( std::make_unique(euler_dof_handler->get_fe(), fe_mask); auto & data = dynamic_cast(*data_ptr); const Quadrature q( - QProjector::project_to_all_faces(ReferenceCell::get_hypercube(), + QProjector::project_to_all_faces(ReferenceCells::get_hypercube(), quadrature[0])); this->compute_face_data(update_flags, q, quadrature[0].size(), data); @@ -663,7 +663,7 @@ MappingFEField::get_subface_data( std::make_unique(euler_dof_handler->get_fe(), fe_mask); auto & data = dynamic_cast(*data_ptr); const Quadrature q(QProjector::project_to_all_subfaces( - ReferenceCell::get_hypercube(), quadrature)); + ReferenceCells::get_hypercube(), quadrature)); this->compute_face_data(update_flags, q, quadrature.size(), data); return data_ptr; @@ -1727,7 +1727,7 @@ MappingFEField::fill_fe_face_values( face_no, numbers::invalid_unsigned_int, QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, cell->face_orientation(face_no), cell->face_flip(face_no), @@ -1768,7 +1768,7 @@ MappingFEField::fill_fe_subface_values( face_no, numbers::invalid_unsigned_int, QProjector::DataSetDescriptor::subface( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, subface_no, cell->face_orientation(face_no), diff --git a/source/fe/mapping_manifold.cc b/source/fe/mapping_manifold.cc index bc67670abb..988aa5d661 100644 --- a/source/fe/mapping_manifold.cc +++ b/source/fe/mapping_manifold.cc @@ -292,7 +292,7 @@ MappingManifold::get_face_data( auto &data = dynamic_cast(*data_ptr); data.initialize_face(this->requires_update_flags(update_flags), QProjector::project_to_all_faces( - ReferenceCell::get_hypercube(), quadrature[0]), + ReferenceCells::get_hypercube(), quadrature[0]), quadrature[0].size()); return data_ptr; @@ -311,7 +311,7 @@ MappingManifold::get_subface_data( auto &data = dynamic_cast(*data_ptr); data.initialize_face(this->requires_update_flags(update_flags), QProjector::project_to_all_subfaces( - ReferenceCell::get_hypercube(), quadrature), + ReferenceCells::get_hypercube(), quadrature), quadrature.size()); return data_ptr; @@ -1228,7 +1228,7 @@ MappingManifold::fill_fe_face_values( face_no, numbers::invalid_unsigned_int, QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, cell->face_orientation(face_no), cell->face_flip(face_no), @@ -1263,7 +1263,7 @@ MappingManifold::fill_fe_subface_values( face_no, subface_no, QProjector::DataSetDescriptor::subface( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, subface_no, cell->face_orientation(face_no), diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index f3d7e73037..3e420a2160 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -887,7 +887,7 @@ MappingQGeneric::get_face_data( auto &data = dynamic_cast(*data_ptr); data.initialize_face(this->requires_update_flags(update_flags), QProjector::project_to_all_faces( - ReferenceCell::get_hypercube(), quadrature[0]), + ReferenceCells::get_hypercube(), quadrature[0]), quadrature[0].size()); return data_ptr; @@ -906,7 +906,7 @@ MappingQGeneric::get_subface_data( auto &data = dynamic_cast(*data_ptr); data.initialize_face(this->requires_update_flags(update_flags), QProjector::project_to_all_subfaces( - ReferenceCell::get_hypercube(), quadrature), + ReferenceCells::get_hypercube(), quadrature), quadrature.size()); return data_ptr; @@ -1172,7 +1172,7 @@ MappingQGeneric::fill_fe_face_values( face_no, numbers::invalid_unsigned_int, QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, cell->face_orientation(face_no), cell->face_flip(face_no), @@ -1220,7 +1220,7 @@ MappingQGeneric::fill_fe_subface_values( face_no, subface_no, QProjector::DataSetDescriptor::subface( - ReferenceCell::get_hypercube(), + ReferenceCells::get_hypercube(), face_no, subface_no, cell->face_orientation(face_no), diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 973fdf2019..197d3504ba 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -1722,7 +1722,7 @@ namespace GridGenerator { AssertDimension(dim, reference_cell.get_dimension()); - if (reference_cell == ReferenceCell::get_hypercube()) + if (reference_cell == ReferenceCells::get_hypercube()) { GridGenerator::hyper_cube(tria, 0, 1); } diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 554990ea6f..48f8f9806a 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -897,7 +897,7 @@ FlatManifold::normal_vector( const auto face_reference_cell = face->reference_cell(); - if (face_reference_cell == ReferenceCell::get_hypercube()) + if (face_reference_cell == ReferenceCells::get_hypercube()) { for (unsigned int i = 0; i < facedim; ++i) xi[i] = 1. / 2; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index d063481595..1fd8e850c1 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -13539,7 +13539,7 @@ Triangulation::all_reference_cells_are_hyper_cube() const "cells used by this triangulation if the " "triangulation doesn't yet have any cells in it.")); return (this->reference_cells.size() == 1 && - this->reference_cells[0] == ReferenceCell::get_hypercube()); + this->reference_cells[0] == ReferenceCells::get_hypercube()); } diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index d0bf64f84c..19e7047342 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -165,7 +165,7 @@ namespace MGTools // TODO: This assumes that the dofs per face on all faces coincide! const unsigned int face_no = 0; - Assert(fe.reference_cell() == ReferenceCell::get_hypercube(), + Assert(fe.reference_cell() == ReferenceCells::get_hypercube(), ExcNotImplemented()); unsigned int increment = @@ -345,7 +345,7 @@ namespace MGTools // TODO: This assumes that the dofs per face on all faces coincide! const unsigned int face_no = 0; - Assert(fe.reference_cell() == ReferenceCell::get_hypercube(), + Assert(fe.reference_cell() == ReferenceCells::get_hypercube(), ExcNotImplemented()); Assert(couplings.n_rows() == fe.n_components(), diff --git a/source/numerics/data_out.cc b/source/numerics/data_out.cc index 27358100c9..610e1b5060 100644 --- a/source/numerics/data_out.cc +++ b/source/numerics/data_out.cc @@ -148,7 +148,7 @@ DataOut::build_one_patch( (cell_and_index->first->at_boundary() || (DoFHandlerType::dimension != DoFHandlerType::space_dimension))) || (cell_and_index->first->reference_cell() != - ReferenceCell::get_hypercube())) + ReferenceCells::get_hypercube())) { Assert(patch.space_dim == DoFHandlerType::space_dimension, ExcInternalError()); diff --git a/source/simplex/fe_lib.cc b/source/simplex/fe_lib.cc index 9d0c897662..fef6d1f953 100644 --- a/source/simplex/fe_lib.cc +++ b/source/simplex/fe_lib.cc @@ -1615,7 +1615,7 @@ namespace Simplex // basis. const auto polys = get_basis(degree); return FiniteElementData(get_dpo_vector(degree), - ReferenceCell::get_simplex(), + ReferenceCells::get_simplex(), 1, // n_components polys.degree(), FiniteElementData::H1); diff --git a/tests/simplex/cell_measure_01.cc b/tests/simplex/cell_measure_01.cc index 2c706767dd..a21e5837c8 100644 --- a/tests/simplex/cell_measure_01.cc +++ b/tests/simplex/cell_measure_01.cc @@ -47,7 +47,7 @@ process(const std::vector> &vertices, AssertDimension(reference_cells.size(), 1); - if (reference_cells[0] == ReferenceCell::get_simplex()) + if (reference_cells[0] == ReferenceCells::get_simplex()) mapping = std::make_shared>(Simplex::FE_P(1)); else if (reference_cells[0] == ReferenceCells::Wedge) mapping = std::make_shared>(Simplex::FE_WedgeP(1));