From: Peter Munch Date: Wed, 25 Mar 2020 20:47:31 +0000 (+0100) Subject: Remove hp::DoFHandler::get_fe() X-Git-Tag: v9.2.0-rc1~355^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9765fe6f38b8ed8476011fae19988e94e894a683;p=dealii.git Remove hp::DoFHandler::get_fe() --- diff --git a/doc/news/changes/incompatibilities/20200326PeterMunch b/doc/news/changes/incompatibilities/20200326PeterMunch new file mode 100644 index 0000000000..80a8834f9c --- /dev/null +++ b/doc/news/changes/incompatibilities/20200326PeterMunch @@ -0,0 +1,4 @@ +Removed: The deprecated method hp::DoFHandler::get_fe() has been removed. Please use +hp::DoFHandler::get_fe_collection() instead. +
+(Peter Munch, 2020/03/26) diff --git a/include/deal.II/hp/dof_handler.h b/include/deal.II/hp/dof_handler.h index badc4bdf1a..ce1e50f700 100644 --- a/include/deal.II/hp/dof_handler.h +++ b/include/deal.II/hp/dof_handler.h @@ -955,16 +955,6 @@ namespace hp DEAL_II_DEPRECATED const std::vector & locally_owned_mg_dofs_per_processor(const unsigned int level) const; - /** - * Return a constant reference to the set of finite element objects that - * are used by this @p DoFHandler. - * - * @deprecated Use get_fe_collection() instead. - */ - DEAL_II_DEPRECATED - const hp::FECollection & - get_fe() const; - /** * Return a constant reference to the indexth finite element object that is * used by this @p DoFHandler. @@ -1720,18 +1710,6 @@ namespace hp - template - inline const hp::FECollection & - DoFHandler::get_fe() const - { - Assert(fe_collection.size() > 0, - ExcMessage("No finite element collection is associated with " - "this DoFHandler")); - return fe_collection; - } - - - template inline const FiniteElement & DoFHandler::get_fe(const unsigned int number) const diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 0b88f7aff0..d305f62708 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -529,7 +529,7 @@ MatrixFree::internal_reinit( { unsigned int n_components = 0; for (unsigned int no = 0; no < dof_handler.size(); ++no) - n_components += dof_handler[no]->get_fe()[0].n_base_elements(); + n_components += dof_handler[no]->get_fe(0).n_base_elements(); const unsigned int n_quad = quad.size(); unsigned int n_fe_in_collection = 0; for (unsigned int i = 0; i < n_components; ++i) @@ -587,7 +587,7 @@ MatrixFree::internal_reinit( additional_data.store_plain_indices; dof_info[no].global_base_element_offset = no > 0 ? dof_info[no - 1].global_base_element_offset + - dof_handler[no - 1]->get_fe()[0].n_base_elements() : + dof_handler[no - 1]->get_fe(0).n_base_elements() : 0; } diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index af7fbe654f..d9d4a3071e 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -1253,7 +1253,7 @@ namespace internal const VectorType *vector = &((*vectors)[dof_cell->level()]); const unsigned int dofs_per_cell = - this->dof_handler->get_fe()[0].dofs_per_cell; + this->dof_handler->get_fe(0).dofs_per_cell; std::vector dof_indices(dofs_per_cell); dof_cell->get_mg_dof_indices(dof_indices); @@ -1292,7 +1292,7 @@ namespace internal const VectorType *vector = &((*vectors)[dof_cell->level()]); const unsigned int dofs_per_cell = - this->dof_handler->get_fe()[0].dofs_per_cell; + this->dof_handler->get_fe(0).dofs_per_cell; std::vector dof_indices(dofs_per_cell); dof_cell->get_mg_dof_indices(dof_indices); diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 229f111e82..fdc9909867 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -286,7 +286,7 @@ namespace VectorTools const ComponentMask & component_mask) { Assert(component_mask.represents_n_components( - dof_handler.get_fe().n_components()), + dof_handler.get_fe_collection().n_components()), ExcMessage( "The number of components in the mask has to be either " "zero or equal to the number of components in the finite " @@ -296,7 +296,7 @@ namespace VectorTools ExcDimensionMismatch(vec.size(), dof_handler.n_dofs())); Assert(component_mask.n_selected_components( - dof_handler.get_fe().n_components()) > 0, + dof_handler.get_fe_collection().n_components()) > 0, ComponentMask::ExcNoComponentSelected()); // @@ -427,9 +427,10 @@ namespace VectorTools dof_values.resize(n_dofs); // Get all function values: - Assert(n_components == function(cell)->n_components, - ExcDimensionMismatch(dof_handler.get_fe().n_components(), - function(cell)->n_components)); + Assert( + n_components == function(cell)->n_components, + ExcDimensionMismatch(dof_handler.get_fe_collection().n_components(), + function(cell)->n_components)); function(cell)->vector_value_list(generalized_support_points, function_values); @@ -553,8 +554,9 @@ namespace VectorTools VectorType & vec, const ComponentMask & component_mask) { - Assert(dof_handler.get_fe().n_components() == function.n_components, - ExcDimensionMismatch(dof_handler.get_fe().n_components(), + Assert(dof_handler.get_fe_collection().n_components() == + function.n_components, + ExcDimensionMismatch(dof_handler.get_fe_collection().n_components(), function.n_components)); // Create a small lambda capture wrapping function and call the diff --git a/tests/distributed_grids/hp_2d_dofhandler_01.cc b/tests/distributed_grids/hp_2d_dofhandler_01.cc index f12eb1ec32..60357fe911 100644 --- a/tests/distributed_grids/hp_2d_dofhandler_01.cc +++ b/tests/distributed_grids/hp_2d_dofhandler_01.cc @@ -63,7 +63,7 @@ test() typename hp::DoFHandler::active_cell_iterator cell = dofh.begin_active(); - const unsigned int dofs_per_cell = dofh.get_fe()[0].dofs_per_cell; + const unsigned int dofs_per_cell = dofh.get_fe(0).dofs_per_cell; std::vector local_dof_indices(dofs_per_cell); diff --git a/tests/dofs/dof_tools_12.cc b/tests/dofs/dof_tools_12.cc index 9a355ca4ee..acfea62115 100644 --- a/tests/dofs/dof_tools_12.cc +++ b/tests/dofs/dof_tools_12.cc @@ -28,7 +28,7 @@ template void check_this(const DoFHandlerType &dof_handler) { - std::vector mask(dof_handler.get_fe().n_components(), false); + std::vector mask(dof_handler.get_fe(0).n_components(), false); // only select first component mask[0] = true; diff --git a/tests/hp/dof_renumbering_04.cc b/tests/hp/dof_renumbering_04.cc index bf0ebc378c..160d899b2b 100644 --- a/tests/hp/dof_renumbering_04.cc +++ b/tests/hp/dof_renumbering_04.cc @@ -64,9 +64,9 @@ template void check_renumbering(hp::DoFHandler &dof) { - for (unsigned int i = 0; i < dof.get_fe().size(); ++i) + for (unsigned int i = 0; i < dof.get_fe_collection().size(); ++i) { - const FiniteElement &element = dof.get_fe()[i]; + const FiniteElement &element = dof.get_fe_collection()[i]; deallog << element.get_name() << std::endl; } diff --git a/tests/hp/dof_renumbering_05.cc b/tests/hp/dof_renumbering_05.cc index a47a8f7d82..cf0051b5c1 100644 --- a/tests/hp/dof_renumbering_05.cc +++ b/tests/hp/dof_renumbering_05.cc @@ -64,9 +64,9 @@ template void check_renumbering(hp::DoFHandler &dof) { - for (unsigned int i = 0; i < dof.get_fe().size(); ++i) + for (unsigned int i = 0; i < dof.get_fe_collection().size(); ++i) { - const FiniteElement &element = dof.get_fe()[i]; + const FiniteElement &element = dof.get_fe_collection()[i]; deallog << element.get_name() << std::endl; } diff --git a/tests/hp/dof_renumbering_06.cc b/tests/hp/dof_renumbering_06.cc index 2738b6c01b..7cb8734cd7 100644 --- a/tests/hp/dof_renumbering_06.cc +++ b/tests/hp/dof_renumbering_06.cc @@ -64,9 +64,9 @@ template void check_renumbering(hp::DoFHandler &dof) { - for (unsigned int i = 0; i < dof.get_fe().size(); ++i) + for (unsigned int i = 0; i < dof.get_fe_collection().size(); ++i) { - const FiniteElement &element = dof.get_fe()[i]; + const FiniteElement &element = dof.get_fe_collection()[i]; deallog << element.get_name() << std::endl; } diff --git a/tests/hp/n_active_fe_indices.cc b/tests/hp/n_active_fe_indices.cc index b8595d794f..c1d28fdc3a 100644 --- a/tests/hp/n_active_fe_indices.cc +++ b/tests/hp/n_active_fe_indices.cc @@ -47,7 +47,7 @@ check_cells(const hp::DoFHandler &dof_handler) deallog << "cell=" << cell << std::endl; deallog << "n=" << cell->n_active_fe_indices() << std::endl; deallog << "x="; - for (unsigned int i = 0; i < dof_handler.get_fe().size(); ++i) + for (unsigned int i = 0; i < dof_handler.get_fe_collection().size(); ++i) deallog << cell->fe_index_is_active(i); deallog << std::endl; @@ -74,7 +74,8 @@ check_faces(const hp::DoFHandler &dof_handler) deallog << "face=" << cell->face(f) << std::endl; deallog << "n=" << cell->face(f)->n_active_fe_indices() << std::endl; deallog << "x="; - for (unsigned int i = 0; i < dof_handler.get_fe().size(); ++i) + for (unsigned int i = 0; i < dof_handler.get_fe_collection().size(); + ++i) deallog << cell->face(f)->fe_index_is_active(i); deallog << std::endl; @@ -107,13 +108,14 @@ check_edges(const hp::DoFHandler &dof_handler) deallog << "edge=" << cell->line(e) << std::endl; deallog << "n=" << cell->line(e)->n_active_fe_indices() << std::endl; deallog << "x="; - for (unsigned int i = 0; i < dof_handler.get_fe().size(); ++i) + for (unsigned int i = 0; i < dof_handler.get_fe_collection().size(); + ++i) deallog << cell->line(e)->fe_index_is_active(i); deallog << std::endl; Assert(cell->line(e)->n_active_fe_indices() >= 1, ExcInternalError()); Assert(cell->line(e)->n_active_fe_indices() <= - dof_handler.get_fe().size(), + dof_handler.get_fe_collection().size(), ExcInternalError()); } } diff --git a/tests/hp/renumber_block_wise_02.cc b/tests/hp/renumber_block_wise_02.cc index a1757d7828..d2ccc874b4 100644 --- a/tests/hp/renumber_block_wise_02.cc +++ b/tests/hp/renumber_block_wise_02.cc @@ -75,7 +75,7 @@ check_renumbering(hp::DoFHandler &dof) // components so that each // component maps to its natural // block - std::vector order(dof.get_fe().n_components()); + std::vector order(dof.get_fe_collection().n_components()); order[0] = 0; order[1] = 1; order[2] = 1; diff --git a/tests/hp/renumber_component_wise.cc b/tests/hp/renumber_component_wise.cc index f7f7944746..c8b32ff2eb 100644 --- a/tests/hp/renumber_component_wise.cc +++ b/tests/hp/renumber_component_wise.cc @@ -69,7 +69,7 @@ check_renumbering(hp::DoFHandler &dof) { // Prepare a reordering of // components for later use - std::vector order(dof.get_fe().n_components()); + std::vector order(dof.get_fe_collection().n_components()); for (unsigned int i = 0; i < order.size(); ++i) order[i] = order.size() - i - 1; diff --git a/tests/hp/step-12.cc b/tests/hp/step-12.cc index 63ebe590ee..16621e26e9 100644 --- a/tests/hp/step-12.cc +++ b/tests/hp/step-12.cc @@ -484,7 +484,7 @@ template void DGMethod::assemble_system1() { - const unsigned int dofs_per_cell = dof_handler.get_fe()[0].dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_fe(0).dofs_per_cell; std::vector dofs(dofs_per_cell); std::vector dofs_neighbor(dofs_per_cell); @@ -663,7 +663,7 @@ template void DGMethod::assemble_system2() { - const unsigned int dofs_per_cell = dof_handler.get_fe()[0].dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_fe(0).dofs_per_cell; std::vector dofs(dofs_per_cell); std::vector dofs_neighbor(dofs_per_cell);