From: Wolfgang Bangerth Date: Wed, 13 Jan 2021 23:38:54 +0000 (-0700) Subject: Use ReferenceCell::get_default_linear_mapping() in the .cc files. X-Git-Tag: v9.3.0-rc1~637^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3865f655005398c9895487da8005a15f23a7d69;p=dealii.git Use ReferenceCell::get_default_linear_mapping() in the .cc files. --- diff --git a/source/fe/fe_q_bubbles.cc b/source/fe/fe_q_bubbles.cc index 3f2f9ab232..8625b8e0ad 100644 --- a/source/fe/fe_q_bubbles.cc +++ b/source/fe/fe_q_bubbles.cc @@ -122,7 +122,7 @@ namespace internal dh.distribute_dofs(fe); dealii::FEValues fine( - StaticMappingQ1::mapping, + ReferenceCell::get_default_linear_mapping(tr), fe, *q_fine, update_quadrature_points | update_JxW_values | update_values); diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 95b6521ff4..234dc9f9e6 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -4384,11 +4384,15 @@ template FEValues::FEValues(const FiniteElement &fe, const Quadrature & q, const UpdateFlags update_flags) - : FEValuesBase(q.size(), - fe.n_dofs_per_cell(), - update_default, - StaticMappingQ1::mapping, - fe) + : FEValuesBase( + q.size(), + fe.n_dofs_per_cell(), + update_default, + // TODO: We should query the default mapping for the kind of cell + // represented by 'fe' and 'q': + ReferenceCell::get_default_linear_mapping( + ReferenceCell::get_hypercube(dim)), + fe) , quadrature(q) { initialize(update_flags); @@ -4709,11 +4713,15 @@ FEFaceValues::FEFaceValues( const FiniteElement &fe, const hp::QCollection & quadrature, const UpdateFlags update_flags) - : FEFaceValuesBase(fe.n_dofs_per_cell(), - update_flags, - StaticMappingQ1::mapping, - fe, - quadrature) + : FEFaceValuesBase( + fe.n_dofs_per_cell(), + update_flags, + // TODO: We should query the default mapping for the kind of cell + // represented by 'fe' and 'q': + ReferenceCell::get_default_linear_mapping( + ReferenceCell::get_hypercube(dim)), + fe, + quadrature) { initialize(update_flags); } @@ -4939,11 +4947,15 @@ FESubfaceValues::FESubfaceValues( const FiniteElement &fe, const Quadrature & quadrature, const UpdateFlags update_flags) - : FEFaceValuesBase(fe.n_dofs_per_cell(), - update_flags, - StaticMappingQ1::mapping, - fe, - quadrature) + : FEFaceValuesBase( + fe.n_dofs_per_cell(), + update_flags, + // TODO: We should query the default mapping for the kind of cell + // represented by 'fe' and 'q': + ReferenceCell::get_default_linear_mapping( + ReferenceCell::get_hypercube(dim)), + fe, + quadrature) { initialize(update_flags); } diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index 31470830ed..61da31d444 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -2084,8 +2084,8 @@ MappingFEField::transform_real_to_unit_cell( try { initial_p_unit = - StaticMappingQ1::mapping.transform_real_to_unit_cell( - cell, p); + ReferenceCell::get_default_linear_mapping(cell->get_triangulation()) + .transform_real_to_unit_cell(cell, p); } catch (const typename Mapping::ExcTransformationFailed &) { diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index a4d99be7b8..339d64e1f0 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -419,7 +419,8 @@ namespace GridTools const double tolerance) { return find_active_cell_around_point( - StaticMappingQ1::mapping, + ReferenceCell::get_default_linear_mapping( + mesh.get_triangulation()), mesh, p, marked_vertices, @@ -2379,6 +2380,7 @@ namespace GridTools { using MATCH_T = std::array::vertices_per_face>; + static inline std::bitset<3> lookup(const MATCH_T &matching) { diff --git a/source/grid/tria.cc b/source/grid/tria.cc index dc48caea96..5eadb32ab4 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -9607,9 +9607,11 @@ namespace internal // one. const Point new_bound = face->center(true); // to check it, transform to the unit cell - // with Q1Mapping + // with a linear mapping const Point new_unit = - StaticMappingQ1::mapping + ReferenceCell::get_default_linear_mapping( + cell->reference_cell_type()) .transform_real_to_unit_cell(cell, new_bound); // Now, we have to calculate the distance from diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 6c9aceaaac..0260bf31b7 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -1859,8 +1859,9 @@ CellAccessor<3>::point_inside(const Point<3> &p) const { const TriaRawIterator> cell_iterator(*this); return (GeometryInfo::is_inside_unit_cell( - StaticMappingQ1::mapping.transform_real_to_unit_cell( - cell_iterator, p))); + ReferenceCell::get_default_linear_mapping( + reference_cell_type()) + .transform_real_to_unit_cell(cell_iterator, p))); } catch (const Mapping::ExcTransformationFailed &) { diff --git a/source/meshworker/scratch_data.cc b/source/meshworker/scratch_data.cc index 4edb59a4e3..17772fee13 100644 --- a/source/meshworker/scratch_data.cc +++ b/source/meshworker/scratch_data.cc @@ -74,12 +74,16 @@ namespace MeshWorker const UpdateFlags & update_flags, const Quadrature & face_quadrature, const UpdateFlags & face_update_flags) - : ScratchData(StaticMappingQ1::mapping, - fe, - quadrature, - update_flags, - face_quadrature, - face_update_flags) + : ScratchData( + // TODO: We should query the default mapping for the kind of cell + // represented by 'fe' and 'q': + ReferenceCell::get_default_linear_mapping( + ReferenceCell::get_hypercube(dim)), + fe, + quadrature, + update_flags, + face_quadrature, + face_update_flags) {} @@ -93,14 +97,18 @@ namespace MeshWorker const Quadrature & face_quadrature, const UpdateFlags & face_update_flags, const UpdateFlags & neighbor_face_update_flags) - : ScratchData(StaticMappingQ1::mapping, - fe, - quadrature, - update_flags, - neighbor_update_flags, - face_quadrature, - face_update_flags, - neighbor_face_update_flags) + : ScratchData( + // TODO: We should query the default mapping for the kind of cell + // represented by 'fe' and 'q': + ReferenceCell::get_default_linear_mapping( + ReferenceCell::get_hypercube(dim)), + fe, + quadrature, + update_flags, + neighbor_update_flags, + face_quadrature, + face_update_flags, + neighbor_face_update_flags) {} diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index f8b75fb40e..0af8face47 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -1099,12 +1100,14 @@ namespace DerivativeApproximation const unsigned int component) { // just call the respective function with Q1 mapping - approximate_derivative_tensor(StaticMappingQ1::mapping, - dof, - solution, - cell, - derivative, - component); + approximate_derivative_tensor( + ReferenceCell::get_default_linear_mapping( + cell->reference_cell_type()), + dof, + solution, + cell, + derivative, + component); }