From: David Wells Date: Tue, 16 Aug 2022 21:16:45 +0000 (-0400) Subject: Use ReferenceCell instead of StaticMappingQ1. X-Git-Tag: v9.5.0-rc1~1032^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f7234f0802bdf0b3a48ae615c89d6e7603da18b;p=dealii.git Use ReferenceCell instead of StaticMappingQ1. --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index de63f709d9..601c9c9bbe 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -2155,8 +2154,15 @@ namespace GridTools QGauss quadrature(4); + Assert(triangulation.all_reference_cells_are_hyper_cube(), + ExcNotImplemented()); + const auto reference_cell = ReferenceCells::get_hypercube(); MatrixCreator::create_laplace_matrix( - StaticMappingQ1::mapping, dof_handler, quadrature, S, coefficient); + reference_cell.template get_default_linear_mapping(), + dof_handler, + quadrature, + S, + coefficient); // set up the boundary values for the laplace problem std::array, dim> constraints; diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 83f0d9e8e4..845a6d489b 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -2157,9 +2157,10 @@ CellAccessor::point_inside_codim(const Point &p) const Assert(this->reference_cell().is_hyper_cube(), ExcNotImplemented()); const TriaRawIterator> cell_iterator(*this); - const Point p_unit = - StaticMappingQ1::mapping.transform_real_to_unit_cell( - cell_iterator, p); + + const Point p_unit = + this->reference_cell().template get_default_linear_mapping() + .transform_real_to_unit_cell(cell_iterator, p); return GeometryInfo::is_inside_unit_cell(p_unit); } diff --git a/source/numerics/data_out_rotation.cc b/source/numerics/data_out_rotation.cc index 16b34d3fc2..5577903b26 100644 --- a/source/numerics/data_out_rotation.cc +++ b/source/numerics/data_out_rotation.cc @@ -511,14 +511,18 @@ DataOutRotation::build_patches( else n_postprocessor_outputs[dataset] = 0; + Assert(!this->triangulation->is_mixed_mesh(), ExcNotImplemented()); + const auto reference_cell = + this->triangulation->get_reference_cells()[0]; internal::DataOutRotationImplementation::ParallelData - thread_data(n_datasets, - n_subdivisions, - n_patches_per_circle, - n_postprocessor_outputs, - StaticMappingQ1::mapping, - this->get_fes(), - update_flags); + thread_data( + n_datasets, + n_subdivisions, + n_patches_per_circle, + n_postprocessor_outputs, + reference_cell.template get_default_linear_mapping(), + this->get_fes(), + update_flags); std::vector> new_patches( n_patches_per_circle); for (unsigned int i = 0; i < new_patches.size(); ++i) diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index d7d01a75a9..30930b0313 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -1030,8 +1029,12 @@ namespace DerivativeApproximation Vector & derivative_norm, const unsigned int component) { + Assert(!dof_handler.get_triangulation().is_mixed_mesh(), + ExcNotImplemented()); + const auto reference_cell = + dof_handler.get_triangulation().get_reference_cells()[0]; internal::approximate_derivative, dim>( - StaticMappingQ1::mapping, + reference_cell.template get_default_linear_mapping(), dof_handler, solution, component, @@ -1059,8 +1062,12 @@ namespace DerivativeApproximation Vector & derivative_norm, const unsigned int component) { + Assert(!dof_handler.get_triangulation().is_mixed_mesh(), + ExcNotImplemented()); + const auto reference_cell = + dof_handler.get_triangulation().get_reference_cells()[0]; internal::approximate_derivative, dim>( - StaticMappingQ1::mapping, + reference_cell.template get_default_linear_mapping(), dof_handler, solution, component, diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index 413ce5d18b..0d085e152c 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -111,7 +111,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const types::material_id material_id, const Strategy strategy) { - estimate(StaticMappingQ1<1, spacedim>::mapping, + const auto reference_cell = ReferenceCells::Line; + estimate(reference_cell.template get_default_linear_mapping<1, spacedim>(), dof_handler, quadrature, neumann_bc, @@ -145,7 +146,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const types::material_id material_id, const Strategy strategy) { - estimate(StaticMappingQ1<1, spacedim>::mapping, + const auto reference_cell = ReferenceCells::Line; + estimate(reference_cell.template get_default_linear_mapping<1, spacedim>(), dof_handler, quadrature, neumann_bc, @@ -217,7 +219,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const types::material_id material_id, const Strategy strategy) { - estimate(StaticMappingQ1<1, spacedim>::mapping, + const auto reference_cell = ReferenceCells::Line; + estimate(reference_cell.template get_default_linear_mapping<1, spacedim>(), dof_handler, quadrature, neumann_bc, @@ -251,7 +254,8 @@ KellyErrorEstimator<1, spacedim>::estimate( const types::material_id material_id, const Strategy strategy) { - estimate(StaticMappingQ1<1, spacedim>::mapping, + const auto reference_cell = ReferenceCells::Line; + estimate(reference_cell.template get_default_linear_mapping<1, spacedim>(), dof_handler, quadrature, neumann_bc, diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index 98f175f8eb..fb95e22334 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -710,15 +710,19 @@ PointValueHistory::evaluate_field( typename std::vector< internal::PointValueHistoryImplementation::PointGeometryData>::iterator point = point_geometry_data.begin(); + Assert(!dof_handler->get_triangulation().is_mixed_mesh(), ExcNotImplemented()); + const auto reference_cell = + dof_handler->get_triangulation().get_reference_cells()[0]; for (unsigned int data_store_index = 0; point != point_geometry_data.end(); ++point, ++data_store_index) { // we now have a point to query, need to know what cell it is in const Point requested_location = point->requested_location; const typename DoFHandler::active_cell_iterator cell = - GridTools::find_active_cell_around_point(StaticMappingQ1::mapping, - *dof_handler, - requested_location) + GridTools::find_active_cell_around_point( + reference_cell.template get_default_linear_mapping(), + *dof_handler, + requested_location) .first; @@ -1271,6 +1275,9 @@ PointValueHistory::get_postprocessor_locations( typename std::vector< internal::PointValueHistoryImplementation::PointGeometryData>::iterator point = point_geometry_data.begin(); + Assert(!dof_handler->get_triangulation().is_mixed_mesh(), ExcNotImplemented()); + const auto reference_cell = + dof_handler->get_triangulation().get_reference_cells()[0]; for (unsigned int data_store_index = 0; point != point_geometry_data.end(); ++point, ++data_store_index) { @@ -1278,9 +1285,10 @@ PointValueHistory::get_postprocessor_locations( // need to know what cell it is in Point requested_location = point->requested_location; typename DoFHandler::active_cell_iterator cell = - GridTools::find_active_cell_around_point(StaticMappingQ1::mapping, - *dof_handler, - requested_location) + GridTools::find_active_cell_around_point( + reference_cell.template get_default_linear_mapping(), + *dof_handler, + requested_location) .first; fe_values.reinit(cell);