From 0510bab41c7c0448555ab6237c5f78136334d06c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 21 Jan 2021 12:22:56 -0700 Subject: [PATCH] Turn ReferenceCell::get_hypercube/simplex() into templates. --- include/deal.II/base/qprojector.h | 2 +- include/deal.II/fe/fe_poly_face.h | 2 +- include/deal.II/grid/grid_tools.h | 14 +-- include/deal.II/grid/grid_tools_cache.h | 2 +- include/deal.II/grid/reference_cell.h | 18 ++-- .../matrix_free/mapping_info.templates.h | 3 +- .../matrix_free/matrix_free.templates.h | 2 +- .../matrix_free/shape_info.templates.h | 3 +- .../numerics/vector_tools_constraints.h | 8 +- .../numerics/vector_tools_project.templates.h | 2 +- include/deal.II/particles/generators.h | 10 +-- source/base/data_out_base.cc | 41 ++++++--- source/base/qprojector.cc | 30 ++++--- source/fe/fe_nedelec.cc | 9 +- source/fe/fe_nothing.cc | 4 +- source/fe/fe_q_base.cc | 10 +-- source/fe/mapping_cartesian.cc | 8 +- source/fe/mapping_fe_field.cc | 88 +++++++++---------- source/fe/mapping_manifold.cc | 35 ++++---- source/fe/mapping_q_generic.cc | 35 ++++---- source/grid/manifold.cc | 2 +- source/grid/reference_cell.cc | 10 +-- source/grid/tria.cc | 2 +- source/multigrid/mg_tools.cc | 4 +- source/numerics/data_out.cc | 2 +- tests/simplex/cell_measure_01.cc | 2 +- 26 files changed, 186 insertions(+), 162 deletions(-) diff --git a/include/deal.II/base/qprojector.h b/include/deal.II/base/qprojector.h index 7ec022daf9..4036d1b4e1 100644 --- a/include/deal.II/base/qprojector.h +++ b/include/deal.II/base/qprojector.h @@ -602,7 +602,7 @@ template Quadrature inline QProjector::project_to_all_faces( const Quadrature &quadrature) { - return project_to_all_faces(ReferenceCell::get_hypercube(dim), quadrature); + return project_to_all_faces(ReferenceCell::get_hypercube(), quadrature); } diff --git a/include/deal.II/fe/fe_poly_face.h b/include/deal.II/fe/fe_poly_face.h index ba4ffe6d54..3038921d24 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(dim - 1), quadrature)), + ReferenceCell::get_hypercube(), quadrature)), output_data); } diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 6ac979c160..3f70a9e302 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -177,7 +177,7 @@ namespace GridTools volume(const Triangulation &tria, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Return an approximation of the diameter of the smallest active cell of a @@ -195,7 +195,7 @@ namespace GridTools const Triangulation &triangulation, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Return an approximation of the diameter of the largest active cell of a @@ -213,7 +213,7 @@ namespace GridTools const Triangulation &triangulation, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Given a list of vertices (typically obtained using @@ -1045,7 +1045,7 @@ namespace GridTools const Triangulation &container, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Find and return the index of the closest vertex to a given point in the @@ -1873,7 +1873,7 @@ namespace GridTools const Point & position, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Compute a globally unique index for each vertex and hanging node @@ -3261,7 +3261,7 @@ namespace GridTools !cell->face(face)->at_boundary()) { Assert(cell->reference_cell_type() == - ReferenceCell::get_hypercube(dim), + ReferenceCell::get_hypercube(), ExcNotImplemented()); // this line has children @@ -3281,7 +3281,7 @@ namespace GridTools !cell->face(face)->at_boundary()) { Assert(cell->reference_cell_type() == - ReferenceCell::get_hypercube(dim), + ReferenceCell::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 e2fbe37a48..e3dd0b8b20 100644 --- a/include/deal.II/grid/grid_tools_cache.h +++ b/include/deal.II/grid/grid_tools_cache.h @@ -77,7 +77,7 @@ namespace GridTools Cache(const Triangulation &tria, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Destructor. diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 12a6b8cd40..0a33f62393 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -366,8 +366,9 @@ namespace ReferenceCell * Return the correct simplex reference cell type for the given dimension * @p dim. */ - inline Type - get_simplex(const unsigned int dim) + template + inline const Type & + get_simplex() { switch (dim) { @@ -389,8 +390,9 @@ namespace ReferenceCell * Return the correct hypercube reference cell type for the given dimension * @p dim. */ - inline Type - get_hypercube(const unsigned int dim) + template + inline const Type & + get_hypercube() { switch (dim) { @@ -445,7 +447,7 @@ namespace ReferenceCell const unsigned int i) const { AssertDimension(dim, get_dimension()); - if (*this == get_hypercube(dim)) + if (*this == get_hypercube()) return GeometryInfo::d_linear_shape_function(xi, i); if (*this == Type::Tri) // see also Simplex::ScalarPolynomial::compute_value @@ -533,7 +535,7 @@ namespace ReferenceCell const unsigned int i) const { AssertDimension(dim, get_dimension()); - if (*this == get_hypercube(dim)) + if (*this == get_hypercube()) return GeometryInfo::d_linear_shape_function_gradient(xi, i); if (*this == Type::Tri) // see also Simplex::ScalarPolynomial::compute_grad @@ -563,7 +565,7 @@ namespace ReferenceCell AssertDimension(dim, get_dimension()); AssertIndexRange(i, dim - 1); - if (*this == get_hypercube(dim)) + if (*this == get_hypercube()) { AssertIndexRange(face_no, GeometryInfo::faces_per_cell); return GeometryInfo::unit_tangential_vectors[face_no][i]; @@ -638,7 +640,7 @@ namespace ReferenceCell { AssertDimension(dim, reference_cell.get_dimension()); - if (reference_cell == get_hypercube(dim)) + if (reference_cell == get_hypercube()) { AssertIndexRange(face_no, GeometryInfo::faces_per_cell); return GeometryInfo::unit_normal_vector[face_no]; diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 98c48fe756..29c506c454 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -1756,7 +1756,8 @@ namespace internal Assert(index < dim, ExcInternalError()); if ((reference_cell_type == ReferenceCell::Type::Invalid || - reference_cell_type == ReferenceCell::get_hypercube(dim)) == false) + reference_cell_type == ReferenceCell::get_hypercube()) == + false) { #ifdef DEAL_II_WITH_SIMPLEX_SUPPORT return index; diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 32ad86d9fc..bf45d40edb 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_type() == - ReferenceCell::get_hypercube(dim) ? + ReferenceCell::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 9a0bcf9b71..6b36dc12bc 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -316,7 +316,8 @@ namespace internal try { - const auto reference_cell_type = ReferenceCell::get_simplex(dim); + const auto reference_cell_type = + ReferenceCell::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 b952a11fc2..1c948d1b12 100644 --- a/include/deal.II/numerics/vector_tools_constraints.h +++ b/include/deal.II/numerics/vector_tools_constraints.h @@ -281,7 +281,7 @@ namespace VectorTools AffineConstraints & constraints, const Mapping &mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * This function does the same as the @@ -304,7 +304,7 @@ namespace VectorTools AffineConstraints & constraints, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Compute the constraints that correspond to boundary conditions of the @@ -333,7 +333,7 @@ namespace VectorTools AffineConstraints & constraints, const Mapping &mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * Same as above for homogeneous tangential-flux constraints. @@ -352,7 +352,7 @@ namespace VectorTools AffineConstraints & constraints, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); //@} } // namespace VectorTools diff --git a/include/deal.II/numerics/vector_tools_project.templates.h b/include/deal.II/numerics/vector_tools_project.templates.h index 3fdf7a4d6f..0f0c5a6ae2 100644 --- a/include/deal.II/numerics/vector_tools_project.templates.h +++ b/include/deal.II/numerics/vector_tools_project.templates.h @@ -184,7 +184,7 @@ namespace VectorTools Quadrature quadrature_mf; if (dof.get_fe(0).reference_cell_type() == - ReferenceCell::get_hypercube(dim)) + ReferenceCell::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 994ef896ed..ca1c12d621 100644 --- a/include/deal.II/particles/generators.h +++ b/include/deal.II/particles/generators.h @@ -70,7 +70,7 @@ namespace Particles ParticleHandler & particle_handler, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * A function that generates one particle at a random location in cell @p cell and with @@ -109,7 +109,7 @@ namespace Particles std::mt19937 & random_number_generator, const Mapping &mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim))); + ReferenceCell::get_hypercube())); /** * A function that generates particles randomly in the domain with a @@ -165,7 +165,7 @@ namespace Particles ParticleHandler & particle_handler, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim)), + ReferenceCell::get_hypercube()), const unsigned int random_number_seed = 5432); @@ -212,7 +212,7 @@ namespace Particles ParticleHandler &particle_handler, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim)), + ReferenceCell::get_hypercube()), const ComponentMask & components = ComponentMask(), const std::vector> &properties = {}); @@ -257,7 +257,7 @@ namespace Particles ParticleHandler &particle_handler, const Mapping & mapping = ReferenceCell::get_default_linear_mapping( - ReferenceCell::get_hypercube(dim)), + ReferenceCell::get_hypercube()), const std::vector> &properties = {}); } // namespace Generators } // namespace Particles diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 5e266f128b..300918747c 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -294,7 +294,7 @@ namespace DataOutBase n_data_sets, patch.data.n_rows())); Assert(patch.reference_cell_type != - ReferenceCell::get_hypercube(dim) || + ReferenceCell::get_hypercube() || (n_data_sets == 0) || (patch.data.n_cols() == Utilities::fixed_power(n_subdivisions + 1)), @@ -616,7 +616,7 @@ namespace if (write_higher_order_cells) { - if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim)) + if (patch.reference_cell_type == ReferenceCell::get_hypercube()) { const std::array cell_type_by_dim{ {VTK_VERTEX, @@ -667,7 +667,7 @@ namespace vtk_cell_id[0] = VTK_PYRAMID; vtk_cell_id[1] = 1; } - else if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim)) + else if (patch.reference_cell_type == ReferenceCell::get_hypercube()) { const std::array cell_type_by_dim{ {VTK_VERTEX, VTK_LINE, VTK_QUAD, VTK_HEXAHEDRON}}; @@ -679,7 +679,7 @@ namespace Assert(false, ExcNotImplemented()); } - if (patch.reference_cell_type != ReferenceCell::get_hypercube(dim) || + if (patch.reference_cell_type != ReferenceCell::get_hypercube() || write_higher_order_cells) vtk_cell_id[2] = patch.data.n_cols(); else @@ -915,7 +915,7 @@ namespace for (const auto &patch : patches) { // The following formula doesn't hold for non-tensor products. - if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim)) + if (patch.reference_cell_type == ReferenceCell::get_hypercube()) { n_nodes += Utilities::fixed_power(patch.n_subdivisions + 1); n_cells += Utilities::fixed_power(patch.n_subdivisions); @@ -946,7 +946,7 @@ namespace for (const auto &patch : patches) { // The following formulas don't hold for non-tensor products. - if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim)) + if (patch.reference_cell_type == ReferenceCell::get_hypercube()) { n_nodes += Utilities::fixed_power(patch.n_subdivisions + 1); @@ -1862,7 +1862,7 @@ namespace DataOutBase : patch_index(no_neighbor) , n_subdivisions(1) , points_are_available(false) - , reference_cell_type(ReferenceCell::get_hypercube(dim)) + , reference_cell_type(ReferenceCell::get_hypercube()) // all the other data has a constructor of its own, except for the "neighbors" // field, which we set to invalid values. { @@ -1964,7 +1964,7 @@ namespace DataOutBase Patch<0, spacedim>::Patch() : patch_index(no_neighbor) , points_are_available(false) - , reference_cell_type(ReferenceCell::get_hypercube(0)) + , reference_cell_type(ReferenceCell::get_hypercube<0>()) { Assert(spacedim <= 3, ExcNotImplemented()); } @@ -2627,7 +2627,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_type != ReferenceCell::get_hypercube(dim)) + if (patch.reference_cell_type != ReferenceCell::get_hypercube()) { Point node; @@ -2671,7 +2671,7 @@ namespace DataOutBase for (const auto &patch : patches) { // special treatment of simplices since they are not subdivided - if (patch.reference_cell_type != ReferenceCell::get_hypercube(dim)) + if (patch.reference_cell_type != ReferenceCell::get_hypercube()) { out.write_cell_single(count++, first_vertex_of_patch, @@ -8643,8 +8643,25 @@ namespace std::string XDMFEntry::get_xdmf_content(const unsigned int indent_level) const { - return get_xdmf_content(indent_level, - ReferenceCell::get_hypercube(dimension)); + switch (dimension) + { + case 0: + return get_xdmf_content(indent_level, + ReferenceCell::get_hypercube<0>()); + case 1: + return get_xdmf_content(indent_level, + ReferenceCell::get_hypercube<1>()); + case 2: + return get_xdmf_content(indent_level, + ReferenceCell::get_hypercube<2>()); + case 3: + return get_xdmf_content(indent_level, + ReferenceCell::get_hypercube<3>()); + default: + Assert(false, ExcNotImplemented()); + } + + return ""; } diff --git a/source/base/qprojector.cc b/source/base/qprojector.cc index 6f96aed15c..1b0a60e397 100644 --- a/source/base/qprojector.cc +++ b/source/base/qprojector.cc @@ -1159,7 +1159,7 @@ Quadrature QProjector::project_to_child(const Quadrature &quadrature, const unsigned int child_no) { - return project_to_child(ReferenceCell::get_hypercube(dim), + return project_to_child(ReferenceCell::get_hypercube(), quadrature, child_no); } @@ -1172,7 +1172,7 @@ QProjector::project_to_child(const ReferenceCell::Type reference_cell_type, const Quadrature & quadrature, const unsigned int child_no) { - Assert(reference_cell_type == ReferenceCell::get_hypercube(dim), + Assert(reference_cell_type == ReferenceCell::get_hypercube(), ExcNotImplemented()); (void)reference_cell_type; @@ -1202,7 +1202,8 @@ template Quadrature QProjector::project_to_all_children(const Quadrature &quadrature) { - return project_to_all_children(ReferenceCell::get_hypercube(dim), quadrature); + return project_to_all_children(ReferenceCell::get_hypercube(), + quadrature); } @@ -1213,7 +1214,7 @@ QProjector::project_to_all_children( const ReferenceCell::Type reference_cell_type, const Quadrature & quadrature) { - Assert(reference_cell_type == ReferenceCell::get_hypercube(dim), + Assert(reference_cell_type == ReferenceCell::get_hypercube(), ExcNotImplemented()); (void)reference_cell_type; @@ -1245,7 +1246,10 @@ QProjector::project_to_line(const Quadrature<1> &quadrature, const Point & p1, const Point & p2) { - return project_to_line(ReferenceCell::get_hypercube(dim), quadrature, p1, p2); + return project_to_line(ReferenceCell::get_hypercube(), + quadrature, + p1, + p2); } @@ -1257,7 +1261,7 @@ QProjector::project_to_line(const ReferenceCell::Type reference_cell_type, const Point & p1, const Point & p2) { - Assert(reference_cell_type == ReferenceCell::get_hypercube(dim), + Assert(reference_cell_type == ReferenceCell::get_hypercube(), ExcNotImplemented()); (void)reference_cell_type; @@ -1286,7 +1290,7 @@ QProjector::DataSetDescriptor::face(const unsigned int face_no, const bool face_rotation, const unsigned int n_quadrature_points) { - return face(ReferenceCell::get_hypercube(dim), + return face(ReferenceCell::get_hypercube(), face_no, face_orientation, face_flip, @@ -1319,7 +1323,7 @@ QProjector::DataSetDescriptor::face( } } - Assert(reference_cell_type == ReferenceCell::get_hypercube(dim), + Assert(reference_cell_type == ReferenceCell::get_hypercube(), ExcNotImplemented()); Assert(face_no < GeometryInfo::faces_per_cell, ExcInternalError()); @@ -1438,7 +1442,7 @@ QProjector::DataSetDescriptor::face( } } - Assert(reference_cell_type == ReferenceCell::get_hypercube(dim), + Assert(reference_cell_type == ReferenceCell::get_hypercube(), ExcNotImplemented()); Assert(face_no < GeometryInfo::faces_per_cell, ExcInternalError()); @@ -1901,7 +1905,7 @@ Quadrature QProjector::project_to_face(const SubQuadrature &quadrature, const unsigned int face_no) { - return project_to_face(ReferenceCell::get_hypercube(dim), + return project_to_face(ReferenceCell::get_hypercube(), quadrature, face_no); } @@ -1914,7 +1918,7 @@ QProjector::project_to_face(const ReferenceCell::Type reference_cell_type, const SubQuadrature & quadrature, const unsigned int face_no) { - Assert(reference_cell_type == ReferenceCell::get_hypercube(dim), + Assert(reference_cell_type == ReferenceCell::get_hypercube(), ExcNotImplemented()); (void)reference_cell_type; @@ -1932,7 +1936,7 @@ QProjector::project_to_subface(const SubQuadrature & quadrature, const unsigned int subface_no, const RefinementCase &ref_case) { - return project_to_subface(ReferenceCell::get_hypercube(dim), + return project_to_subface(ReferenceCell::get_hypercube(), quadrature, face_no, subface_no, @@ -1950,7 +1954,7 @@ QProjector::project_to_subface( const unsigned int subface_no, const RefinementCase &ref_case) { - Assert(reference_cell_type == ReferenceCell::get_hypercube(dim), + Assert(reference_cell_type == ReferenceCell::get_hypercube(), ExcNotImplemented()); (void)reference_cell_type; diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index 56974a0d9b..b8c57c48bf 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -380,9 +380,8 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) const QGauss<1> reference_edge_quadrature(order + 1); const unsigned int n_edge_points = reference_edge_quadrature.size(); const Quadrature &edge_quadrature = - QProjector::project_to_all_faces(ReferenceCell::get_hypercube(dim - - 1), - reference_edge_quadrature); + QProjector::project_to_all_faces( + ReferenceCell::get_hypercube(), reference_edge_quadrature); if (order > 0) { @@ -415,7 +414,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) q_point] = edge_quadrature.point( QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(dim - 1), + ReferenceCell::get_hypercube(), line, true, false, @@ -516,7 +515,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order) q_point] = edge_quadrature.point( QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(dim - 1), + ReferenceCell::get_hypercube(), line, true, false, diff --git a/source/fe/fe_nothing.cc b/source/fe/fe_nothing.cc index 99b7e325be..70936e79ce 100644 --- a/source/fe/fe_nothing.cc +++ b/source/fe/fe_nothing.cc @@ -51,7 +51,7 @@ FE_Nothing::FE_Nothing(const ReferenceCell::Type &type, template FE_Nothing::FE_Nothing(const unsigned int n_components, const bool dominate) - : FE_Nothing(ReferenceCell::get_hypercube(dim), + : FE_Nothing(ReferenceCell::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_type() != ReferenceCell::get_hypercube(dim)) + if (this->reference_cell_type() != ReferenceCell::get_hypercube()) name_components.push_back(this->reference_cell_type().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 890ef9ed13..4b61a9fc0e 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(dim - 1), qline, 0, 0, p_line); + ReferenceCell::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(dim - 1), qline, 0, 1, p_line); + ReferenceCell::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(dim - 1), qline, 2, 0, p_line); + ReferenceCell::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(dim - 1), qline, 2, 1, p_line); + ReferenceCell::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(dim - 1), + ReferenceCell::get_hypercube(), qline, face, subface, diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index 745a44ebdb..70cfc44890 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -118,7 +118,7 @@ MappingCartesian::get_face_data( std::unique_ptr::InternalDataBase> data_ptr = std::make_unique( - QProjector::project_to_all_faces(ReferenceCell::get_hypercube(dim), + QProjector::project_to_all_faces(ReferenceCell::get_hypercube(), quadrature[0])); auto &data = dynamic_cast(*data_ptr); @@ -144,7 +144,7 @@ MappingCartesian::get_subface_data( { std::unique_ptr::InternalDataBase> data_ptr = std::make_unique(QProjector::project_to_all_subfaces( - ReferenceCell::get_hypercube(dim), quadrature)); + ReferenceCell::get_hypercube(), quadrature)); auto &data = dynamic_cast(*data_ptr); // verify that we have computed the transitive hull of the required @@ -227,7 +227,7 @@ MappingCartesian::maybe_update_face_quadrature_points( if (data.update_each & update_quadrature_points) { const auto offset = QProjector::DataSetDescriptor::face( - ReferenceCell::get_hypercube(dim), + ReferenceCell::get_hypercube(), face_no, cell->face_orientation(face_no), cell->face_flip(face_no), @@ -260,7 +260,7 @@ MappingCartesian::maybe_update_subface_quadrature_points( if (data.update_each & update_quadrature_points) { const auto offset = QProjector::DataSetDescriptor::subface( - ReferenceCell::get_hypercube(dim), + ReferenceCell::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 bb21ab4fa8..bf64cef305 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -625,7 +625,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(dim), + QProjector::project_to_all_faces(ReferenceCell::get_hypercube(), quadrature[0])); this->compute_face_data(update_flags, q, quadrature[0].size(), data); @@ -642,9 +642,8 @@ MappingFEField::get_subface_data( std::unique_ptr::InternalDataBase> data_ptr = 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(dim), - quadrature)); + const Quadrature q(QProjector::project_to_all_subfaces( + ReferenceCell::get_hypercube(), quadrature)); this->compute_face_data(update_flags, q, quadrature.size(), data); return data_ptr; @@ -1695,25 +1694,25 @@ MappingFEField::fill_fe_face_values( update_internal_dofs(cell, data); - internal::MappingFEFieldImplementation::do_fill_fe_face_values( - *this, - cell, - face_no, - numbers::invalid_unsigned_int, - QProjector::DataSetDescriptor::face(ReferenceCell::get_hypercube(dim), - face_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature[0].size()), - quadrature[0], - data, - euler_dof_handler->get_fe(), - fe_mask, - fe_to_real, - output_data); + internal::MappingFEFieldImplementation:: + do_fill_fe_face_values( + *this, + cell, + face_no, + numbers::invalid_unsigned_int, + QProjector::DataSetDescriptor::face( + ReferenceCell::get_hypercube(), + face_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature[0].size()), + quadrature[0], + data, + euler_dof_handler->get_fe(), + fe_mask, + fe_to_real, + output_data); } @@ -1736,28 +1735,27 @@ MappingFEField::fill_fe_subface_values( update_internal_dofs(cell, data); - internal::MappingFEFieldImplementation::do_fill_fe_face_values( - *this, - cell, - face_no, - numbers::invalid_unsigned_int, - QProjector::DataSetDescriptor::subface(ReferenceCell::get_hypercube( - dim), - face_no, - subface_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature.size(), - cell->subface_case(face_no)), - quadrature, - data, - euler_dof_handler->get_fe(), - fe_mask, - fe_to_real, - output_data); + internal::MappingFEFieldImplementation:: + do_fill_fe_face_values( + *this, + cell, + face_no, + numbers::invalid_unsigned_int, + QProjector::DataSetDescriptor::subface( + ReferenceCell::get_hypercube(), + face_no, + subface_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature.size(), + cell->subface_case(face_no)), + quadrature, + data, + euler_dof_handler->get_fe(), + fe_mask, + fe_to_real, + output_data); } diff --git a/source/fe/mapping_manifold.cc b/source/fe/mapping_manifold.cc index 95fe8a9419..bc67670abb 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(dim), quadrature[0]), + ReferenceCell::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(dim), quadrature), + ReferenceCell::get_hypercube(), quadrature), quadrature.size()); return data_ptr; @@ -1227,12 +1227,13 @@ MappingManifold::fill_fe_face_values( cell, face_no, numbers::invalid_unsigned_int, - QProjector::DataSetDescriptor::face(ReferenceCell::get_hypercube(dim), - face_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature[0].size()), + QProjector::DataSetDescriptor::face( + ReferenceCell::get_hypercube(), + face_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature[0].size()), quadrature[0], data, output_data); @@ -1261,15 +1262,15 @@ MappingManifold::fill_fe_subface_values( cell, face_no, subface_no, - QProjector::DataSetDescriptor::subface(ReferenceCell::get_hypercube( - dim), - face_no, - subface_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature.size(), - cell->subface_case(face_no)), + QProjector::DataSetDescriptor::subface( + ReferenceCell::get_hypercube(), + face_no, + subface_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature.size(), + cell->subface_case(face_no)), quadrature, data, output_data); diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index ee9ea85dc2..d52f46d86b 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -885,7 +885,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(dim), quadrature[0]), + ReferenceCell::get_hypercube(), quadrature[0]), quadrature[0].size()); return data_ptr; @@ -904,7 +904,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(dim), quadrature), + ReferenceCell::get_hypercube(), quadrature), quadrature.size()); return data_ptr; @@ -1169,12 +1169,13 @@ MappingQGeneric::fill_fe_face_values( cell, face_no, numbers::invalid_unsigned_int, - QProjector::DataSetDescriptor::face(ReferenceCell::get_hypercube(dim), - face_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature[0].size()), + QProjector::DataSetDescriptor::face( + ReferenceCell::get_hypercube(), + face_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature[0].size()), quadrature[0], data, output_data); @@ -1216,15 +1217,15 @@ MappingQGeneric::fill_fe_subface_values( cell, face_no, subface_no, - QProjector::DataSetDescriptor::subface(ReferenceCell::get_hypercube( - dim), - face_no, - subface_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature.size(), - cell->subface_case(face_no)), + QProjector::DataSetDescriptor::subface( + ReferenceCell::get_hypercube(), + face_no, + subface_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature.size(), + cell->subface_case(face_no)), quadrature, data, output_data); diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 4dba26b001..db3fe29da4 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -895,7 +895,7 @@ FlatManifold::normal_vector( const auto face_reference_cell_type = face->reference_cell_type(); - if (face_reference_cell_type == ReferenceCell::get_hypercube(facedim)) + if (face_reference_cell_type == ReferenceCell::get_hypercube()) { for (unsigned int i = 0; i < facedim; ++i) xi[i] = 1. / 2; diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 9e473a0592..e0c923af1f 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -50,7 +50,7 @@ namespace ReferenceCell { AssertDimension(dim, reference_cell.get_dimension()); - if (reference_cell == get_hypercube(dim)) + if (reference_cell == get_hypercube()) { GridGenerator::hyper_cube(tria, 0, 1); } @@ -123,7 +123,7 @@ namespace ReferenceCell { AssertDimension(dim, reference_cell.get_dimension()); - if (reference_cell == get_hypercube(dim)) + if (reference_cell == get_hypercube()) return std::make_unique>(degree); else if (reference_cell == Type::Tri || reference_cell == Type::Tet) return std::make_unique>( @@ -149,7 +149,7 @@ namespace ReferenceCell { AssertDimension(dim, reference_cell.get_dimension()); - if (reference_cell == get_hypercube(dim)) + if (reference_cell == get_hypercube()) { return StaticMappingQ1::mapping; } @@ -208,7 +208,7 @@ namespace ReferenceCell { AssertDimension(dim, reference_cell.get_dimension()); - if (reference_cell == get_hypercube(dim)) + if (reference_cell == get_hypercube()) return QGauss(n_points_1D); else if (reference_cell == Type::Tri || reference_cell == Type::Tet) return Simplex::QGauss(n_points_1D); @@ -235,7 +235,7 @@ namespace ReferenceCell return Quadrature(tria.get_vertices()); }; - if (reference_cell == get_hypercube(dim)) + if (reference_cell == get_hypercube()) { static Quadrature quadrature = create_quadrature(reference_cell); return quadrature; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index cf30f4e356..09bd146f76 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -13535,7 +13535,7 @@ Triangulation::all_reference_cell_types_are_hyper_cube() const { return (this->reference_cell_types.size() == 0) || (this->reference_cell_types.size() == 1 && - this->reference_cell_types[0] == ReferenceCell::get_hypercube(dim)); + this->reference_cell_types[0] == ReferenceCell::get_hypercube()); } diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index 09d532ae6f..c52eee597e 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_type() == ReferenceCell::get_hypercube(dim), + Assert(fe.reference_cell_type() == ReferenceCell::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_type() == ReferenceCell::get_hypercube(dim), + Assert(fe.reference_cell_type() == ReferenceCell::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 3b3dd505ed..6798abcb1f 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_type() != - ReferenceCell::get_hypercube(dim))) + ReferenceCell::get_hypercube())) { Assert(patch.space_dim == DoFHandlerType::space_dimension, ExcInternalError()); diff --git a/tests/simplex/cell_measure_01.cc b/tests/simplex/cell_measure_01.cc index 883087fd21..712ca481fe 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_cell_types.size(), 1); - if (reference_cell_types[0] == ReferenceCell::get_simplex(dim)) + if (reference_cell_types[0] == ReferenceCell::get_simplex()) mapping = std::make_shared>(Simplex::FE_P(1)); else if (reference_cell_types[0] == ReferenceCell::Type::Wedge) mapping = std::make_shared>(Simplex::FE_WedgeP(1)); -- 2.39.5