From 6d4e15acb35072eab75fcdd734d32a7c7636bdb1 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 24 May 2021 11:20:09 -0400 Subject: [PATCH] Remove deprecated DoFHandler::locally_owned_dofs_per_processor --- .../incompatibilities/20210524DanielArndt | 6 + include/deal.II/dofs/dof_handler.h | 112 ------------------ source/dofs/dof_handler_policy.cc | 7 +- 3 files changed, 11 insertions(+), 114 deletions(-) create mode 100644 doc/news/changes/incompatibilities/20210524DanielArndt diff --git a/doc/news/changes/incompatibilities/20210524DanielArndt b/doc/news/changes/incompatibilities/20210524DanielArndt new file mode 100644 index 0000000000..43aac784ca --- /dev/null +++ b/doc/news/changes/incompatibilities/20210524DanielArndt @@ -0,0 +1,6 @@ +Removed: The deprecated member functions +DoFHandler::locally_owned_dofs_per_processor(), +DoFHandler::n_locally_owned_dofs_per_processor(), and +DoFHandler::n_locally_owned_mg_dofs_per_processor() have been removed. +
+(Daniel Arndt, 2021/05/24) diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index 551f109fb9..44b5790bb4 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1192,58 +1192,6 @@ public: const IndexSet & locally_owned_mg_dofs(const unsigned int level) const; - /** - * Return a vector that stores the locally owned DoFs of each processor. - * - * @deprecated As of deal.II version 9.2, we do not populate a vector with - * the index sets of all processors by default any more due to a possibly - * large memory footprint on many processors. As a consequence, this - * function needs to call `Utilities::MPI::all_gather(comm, - * locally_owned_dofs())` upon the first invocation, including global - * communication. Use `Utilities::MPI::all_gather(comm, - * dof_handler.locally_owned_dofs())` instead if using up to a few thousands - * of MPI ranks or some variant involving local communication with more - * processors. - */ - DEAL_II_DEPRECATED const std::vector & - locally_owned_dofs_per_processor() const; - - /** - * Return a vector that stores the number of degrees of freedom each - * processor that participates in this triangulation owns locally. The sum - * of all these numbers equals the number of degrees of freedom that exist - * globally, i.e. what n_dofs() returns. - * - * @deprecated As of deal.II version 9.2, we do not populate a vector with - * the numbers of dofs of all processors by default any more due to a - * possibly large memory footprint on many processors. As a consequence, - * this function needs to call `Utilities::MPI::all_gather(comm, - * n_locally_owned_dofs()` upon the first invocation, including global - * communication. Use `Utilities::MPI::all_gather(comm, - * dof_handler.n_locally_owned_dofs()` instead if using up to a few thousands - * of MPI ranks or some variant involving local communication with more - * processors. - */ - DEAL_II_DEPRECATED const std::vector & - n_locally_owned_dofs_per_processor() const; - - /** - * Return a vector that stores the locally owned DoFs of each processor on - * the given level @p level. - * - * @deprecated As of deal.II version 9.2, we do not populate a vector with - * the index sets of all processors by default any more due to a possibly - * large memory footprint on many processors. As a consequence, this - * function needs to call `Utilities::MPI::all_gather(comm, - * locally_owned_dofs_mg())` upon the first invocation, including global - * communication. Use `Utilities::MPI::all_gather(comm, - * dof_handler.locally_owned_dofs_mg())` instead if using up to a few - * thousands of MPI ranks or some variant involving local communication with - * more processors. - */ - DEAL_II_DEPRECATED const std::vector & - locally_owned_mg_dofs_per_processor(const unsigned int level) const; - /** * Return a constant reference to the indexth finite element object that is * used by this object. @@ -1964,66 +1912,6 @@ DoFHandler::locally_owned_mg_dofs(const unsigned int level) const -template -const std::vector & -DoFHandler::n_locally_owned_dofs_per_processor() const -{ - if (number_cache.n_locally_owned_dofs_per_processor.empty() && - number_cache.n_global_dofs > 0) - { - const_cast( - number_cache) - .n_locally_owned_dofs_per_processor = - number_cache.get_n_locally_owned_dofs_per_processor(get_communicator()); - } - return number_cache.n_locally_owned_dofs_per_processor; -} - - - -template -const std::vector & -DoFHandler::locally_owned_dofs_per_processor() const -{ - if (number_cache.locally_owned_dofs_per_processor.empty() && - number_cache.n_global_dofs > 0) - { - const_cast( - number_cache) - .locally_owned_dofs_per_processor = - number_cache.get_locally_owned_dofs_per_processor(get_communicator()); - } - return number_cache.locally_owned_dofs_per_processor; -} - - - -template -const std::vector & -DoFHandler::locally_owned_mg_dofs_per_processor( - const unsigned int level) const -{ - Assert(level < this->get_triangulation().n_global_levels(), - ExcMessage("The given level index exceeds the number of levels " - "present in the triangulation")); - Assert( - mg_number_cache.size() == this->get_triangulation().n_global_levels(), - ExcMessage( - "The level dofs are not set up properly! Did you call distribute_mg_dofs()?")); - if (mg_number_cache[level].locally_owned_dofs_per_processor.empty() && - mg_number_cache[level].n_global_dofs > 0) - { - const_cast( - mg_number_cache[level]) - .locally_owned_dofs_per_processor = - mg_number_cache[level].get_locally_owned_dofs_per_processor( - get_communicator()); - } - return mg_number_cache[level].locally_owned_dofs_per_processor; -} - - - template inline const FiniteElement & DoFHandler::get_fe(const unsigned int number) const diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index a0ad1bd9b7..f4315a2477 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -3442,10 +3442,13 @@ namespace internal // one-to-one relation between old and new DoFs. std::vector flag_1(this->dof_handler->n_dofs(), 0); std::vector flag_2(this->dof_handler->n_dofs(), 0); + std::vector locally_owned_dofs_per_processor = + Utilities::MPI::all_gather( + tr->get_communicator(), + this->dof_handler->locally_owned_dofs()); for (unsigned int i = 0; i < n_cpu; i++) { - const IndexSet iset = - this->dof_handler->locally_owned_dofs_per_processor()[i]; + const IndexSet iset = locally_owned_dofs_per_processor[i]; for (types::global_dof_index ind = 0; ind < iset.n_elements(); ind++) { -- 2.39.5