From: Daniel Arndt Date: Fri, 24 Jun 2022 17:46:24 +0000 (-0400) Subject: Remove DoFHandler's initialize and set_fe X-Git-Tag: v9.5.0-rc1~1160^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14047%2Fhead;p=dealii.git Remove DoFHandler's initialize and set_fe --- diff --git a/doc/news/changes/incompatibilities/20220624Arndt-2 b/doc/news/changes/incompatibilities/20220624Arndt-2 new file mode 100644 index 0000000000..0276fa2c2f --- /dev/null +++ b/doc/news/changes/incompatibilities/20220624Arndt-2 @@ -0,0 +1,4 @@ +Removed: The deprecated member functions DoFHandler::initialize() and +DoFHandler::set_fe() have been removed. +
+(Daniel Arndt, 2022/06/24) diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index f850febf21..87926405a4 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -573,63 +573,6 @@ public: DoFHandler & operator=(const DoFHandler &) = delete; - /** - * Assign a Triangulation and a FiniteElement to the DoFHandler and compute - * the distribution of degrees of freedom over the mesh. - * - * @deprecated Use reinit() and distribute_dofs() instead. - */ - DEAL_II_DEPRECATED - void - initialize(const Triangulation &tria, - const FiniteElement &fe); - - /** - * Same as above but taking an hp::FECollection object. - * - * @deprecated Use reinit() and distribute_dofs() instead. - */ - DEAL_II_DEPRECATED - void - initialize(const Triangulation & tria, - const hp::FECollection &fe); - - /** - * Assign a FiniteElement @p fe to this object. - * - * @note This function makes a copy of the finite element given as - * argument, and stores it as a member variable. Consequently, it is - * possible to write code such as - * @code - * dof_handler.set_fe(FE_Q(2)); - * @endcode - * You can then access the finite element later on by calling - * DoFHandler::get_fe(). However, it is often more convenient to - * keep a named finite element object as a member variable in your - * main class and refer to it directly whenever you need to access - * properties of the finite element (such as - * FiniteElementData::dofs_per_cell). This is what all tutorial programs do. - * - * @warning This function only sets a FiniteElement. Degrees of freedom have - * either not been distributed yet, or are distributed using a previously set - * element. In both cases, accessing degrees of freedom will lead to invalid - * results. To restore consistency, call distribute_dofs(). - * - * @deprecated Use distribute_dofs() instead. - */ - DEAL_II_DEPRECATED - void - set_fe(const FiniteElement &fe); - - /** - * Same as above but taking an hp::FECollection object. - * - * @deprecated Use distribute_dofs() instead. - */ - DEAL_II_DEPRECATED - void - set_fe(const hp::FECollection &fe); - /** * Go through the triangulation and set the active FE indices of all * active cells to the values given in @p active_fe_indices. diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 5726e3f1d1..6a3093f98c 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -1807,27 +1807,6 @@ DoFHandler::~DoFHandler() -template -void -DoFHandler::initialize(const Triangulation &tria, - const FiniteElement &fe) -{ - this->initialize(tria, hp::FECollection(fe)); -} - - - -template -void -DoFHandler::initialize(const Triangulation &tria, - const hp::FECollection &fe) -{ - this->reinit(tria); - this->distribute_dofs(fe); -} - - - template void DoFHandler::reinit(const Triangulation &tria) @@ -2189,81 +2168,6 @@ DoFHandler::memory_consumption() const -template -void -DoFHandler::set_fe(const FiniteElement &fe) -{ - this->set_fe(hp::FECollection(fe)); -} - - - -template -void -DoFHandler::set_fe(const hp::FECollection &ff) -{ - Assert( - this->tria != nullptr, - ExcMessage( - "You need to set the Triangulation in the DoFHandler using reinit() or " - "in the constructor before you can distribute DoFs.")); - Assert(this->tria->n_levels() > 0, - ExcMessage("The Triangulation you are using is empty!")); - Assert(ff.size() > 0, ExcMessage("The hp::FECollection given is empty!")); - - // don't create a new object if the one we have is already appropriate - if (this->fe_collection != ff) - { - this->fe_collection = hp::FECollection(ff); - - const bool contains_multiple_fes = (this->fe_collection.size() > 1); - - // disable hp-mode if only a single finite element has been registered - if (hp_capability_enabled && !contains_multiple_fes) - { - hp_capability_enabled = false; - - // unsubscribe connections to signals that are only relevant for - // hp-mode, since we only have a single element here - for (auto &connection : this->tria_listeners_for_transfer) - connection.disconnect(); - this->tria_listeners_for_transfer.clear(); - - // release active and future finite element tables - this->hp_cell_active_fe_indices.clear(); - this->hp_cell_active_fe_indices.shrink_to_fit(); - this->hp_cell_future_fe_indices.clear(); - this->hp_cell_future_fe_indices.shrink_to_fit(); - } - - // re-enabling hp-mode is not permitted since the active and future FE - // tables are no longer available - AssertThrow( - hp_capability_enabled || !contains_multiple_fes, - ExcMessage( - "You cannot re-enable hp-capabilities after you registered a single " - "finite element. Please create a new DoFHandler object instead.")); - } - - if (hp_capability_enabled) - { - // make sure every processor knows the active FE indices - // on both its own cells and all ghost cells - dealii::internal::hp::DoFHandlerImplementation::Implementation:: - communicate_active_fe_indices(*this); - - // make sure that the FE collection is large enough to - // cover all FE indices presently in use on the mesh - for (const auto &cell : this->active_cell_iterators()) - if (!cell->is_artificial()) - Assert(cell->active_fe_index() < this->fe_collection.size(), - ExcInvalidFEIndex(cell->active_fe_index(), - this->fe_collection.size())); - } -} - - - template void DoFHandler::distribute_dofs(