]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove deprecated DoFHandler::locally_owned_dofs_per_processor 12295/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 24 May 2021 15:20:09 +0000 (11:20 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 24 May 2021 15:26:08 +0000 (11:26 -0400)
doc/news/changes/incompatibilities/20210524DanielArndt [new file with mode: 0644]
include/deal.II/dofs/dof_handler.h
source/dofs/dof_handler_policy.cc

diff --git a/doc/news/changes/incompatibilities/20210524DanielArndt b/doc/news/changes/incompatibilities/20210524DanielArndt
new file mode 100644 (file)
index 0000000..43aac78
--- /dev/null
@@ -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.
+<br>
+(Daniel Arndt, 2021/05/24)
index 551f109fb9140f8817bae5fcdd3933f183bad65b..44b5790bb48b3a90b0095a3ad519eb7bed9c5520 100644 (file)
@@ -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<IndexSet> &
-                           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<types::global_dof_index> &
-                           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<IndexSet> &
-                           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<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
 
 
 
-template <int dim, int spacedim>
-const std::vector<types::global_dof_index> &
-DoFHandler<dim, spacedim>::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<dealii::internal::DoFHandlerImplementation::NumberCache &>(
-        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 <int dim, int spacedim>
-const std::vector<IndexSet> &
-DoFHandler<dim, spacedim>::locally_owned_dofs_per_processor() const
-{
-  if (number_cache.locally_owned_dofs_per_processor.empty() &&
-      number_cache.n_global_dofs > 0)
-    {
-      const_cast<dealii::internal::DoFHandlerImplementation::NumberCache &>(
-        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 <int dim, int spacedim>
-const std::vector<IndexSet> &
-DoFHandler<dim, spacedim>::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<dealii::internal::DoFHandlerImplementation::NumberCache &>(
-        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 <int dim, int spacedim>
 inline const FiniteElement<dim, spacedim> &
 DoFHandler<dim, spacedim>::get_fe(const unsigned int number) const
index a0ad1bd9b741db675e700e98c7a33503b35143e5..f4315a247791247f657c95927f30499395a3756f 100644 (file)
@@ -3442,10 +3442,13 @@ namespace internal
             // one-to-one relation between old and new DoFs.
             std::vector<unsigned int> flag_1(this->dof_handler->n_dofs(), 0);
             std::vector<unsigned int> flag_2(this->dof_handler->n_dofs(), 0);
+            std::vector<IndexSet>     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++)
                   {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.