]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some deprecations 14541/head
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 7 Dec 2022 15:57:44 +0000 (15:57 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 7 Dec 2022 20:19:52 +0000 (15:19 -0500)
12 files changed:
include/deal.II/lac/affine_constraints.templates.h
include/deal.II/lac/la_vector.templates.h
include/deal.II/lac/read_write_vector.h
include/deal.II/lac/read_write_vector.templates.h
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h
source/base/mpi.cc
source/base/mpi_noncontiguous_partitioner.cc
source/base/partitioner.cc
source/distributed/repartitioning_policy_tools.cc
source/grid/tria_description.cc
source/matrix_free/dof_info.cc
source/matrix_free/vector_data_exchange.cc

index 2d560d124b34891f18dc186b24faa906983527bb..044e35ade92ba0ede0de335f5e196a95ffbf0be2 100644 (file)
@@ -262,8 +262,9 @@ namespace internal
 
     Utilities::MPI::ConsensusAlgorithms::Selector<
       std::vector<std::pair<types::global_dof_index, types::global_dof_index>>,
-      std::vector<unsigned int>>(constrained_indices_process, mpi_communicator)
-      .run();
+      std::vector<unsigned int>>
+      consensus_algorithm;
+    consensus_algorithm.run(constrained_indices_process, mpi_communicator);
 
     // step 2: collect all locally owned constraints
     const auto constrained_indices_by_ranks =
@@ -390,9 +391,9 @@ namespace internal
       Utilities::MPI::ConsensusAlgorithms::Selector<
         std::vector<
           std::pair<types::global_dof_index, types::global_dof_index>>,
-        std::vector<unsigned int>>(locally_relevant_dofs_process,
-                                   mpi_communicator)
-        .run();
+        std::vector<unsigned int>>
+        consensus_algorithm;
+      consensus_algorithm.run(locally_relevant_dofs_process, mpi_communicator);
 
       const auto locally_relevant_dofs_by_ranks =
         locally_relevant_dofs_process.get_requesters();
index d257624eca14dac34c9c449a57be8d2f6b88581f..1d56f6462f92a32555210ec315861b5d7eef66c7 100644 (file)
@@ -557,7 +557,7 @@ namespace LinearAlgebra
 
     out.precision(precision);
 
-    const unsigned int n_elements = this->n_elements();
+    const unsigned int n_elements = this->locally_owned_size();
     for (unsigned int i = 0; i < n_elements; ++i)
       out << this->values[i] << ' ';
     out << '\n' << std::flush;
index d3ec6df7725856515a123de2c25bbfdf4619d42c..14b6f445ab70e642af975606e2915e81b8d57f1b 100644 (file)
@@ -900,7 +900,7 @@ namespace LinearAlgebra
   inline typename ReadWriteVector<Number>::iterator
   ReadWriteVector<Number>::end()
   {
-    return values.get() + this->n_elements();
+    return values.get() + this->locally_owned_size();
   }
 
 
@@ -909,7 +909,7 @@ namespace LinearAlgebra
   inline typename ReadWriteVector<Number>::const_iterator
   ReadWriteVector<Number>::end() const
   {
-    return values.get() + this->n_elements();
+    return values.get() + this->locally_owned_size();
   }
 
 
@@ -985,7 +985,7 @@ namespace LinearAlgebra
   inline Number
   ReadWriteVector<Number>::local_element(const size_type local_index) const
   {
-    AssertIndexRange(local_index, this->n_elements());
+    AssertIndexRange(local_index, this->locally_owned_size());
 
     return values[local_index];
   }
@@ -996,7 +996,7 @@ namespace LinearAlgebra
   inline Number &
   ReadWriteVector<Number>::local_element(const size_type local_index)
   {
-    AssertIndexRange(local_index, this->n_elements());
+    AssertIndexRange(local_index, this->locally_owned_size());
 
     return values[local_index];
   }
index 6972b59584d8de0f408dd536ec7e0da36c220499..d1b9d6c070666daf6b5d31af1fe114ee7b066489 100644 (file)
@@ -265,7 +265,7 @@ namespace LinearAlgebra
   ReadWriteVector<Number>::reinit(const ReadWriteVector<Number2> &v,
                                   const bool omit_zeroing_entries)
   {
-    resize_val(v.n_elements());
+    resize_val(v.locally_owned_size());
 
     stored_elements = v.get_stored_elements();
 
@@ -339,7 +339,7 @@ namespace LinearAlgebra
     FunctorTemplate<Functor> functor(*this, func);
     dealii::internal::VectorOperations::parallel_for(functor,
                                                      0,
-                                                     n_elements(),
+                                                     locally_owned_size(),
                                                      thread_loop_partitioner);
   }
 
@@ -353,15 +353,15 @@ namespace LinearAlgebra
       return *this;
 
     thread_loop_partitioner = in_vector.thread_loop_partitioner;
-    if (n_elements() != in_vector.n_elements())
+    if (locally_owned_size() != in_vector.locally_owned_size())
       reinit(in_vector, true);
 
-    if (n_elements() > 0)
+    if (locally_owned_size() > 0)
       {
         dealii::internal::VectorOperations::Vector_copy<Number, Number> copier(
           in_vector.values.get(), values.get());
         dealii::internal::VectorOperations::parallel_for(
-          copier, 0, n_elements(), thread_loop_partitioner);
+          copier, 0, locally_owned_size(), thread_loop_partitioner);
       }
 
     return *this;
@@ -375,15 +375,15 @@ namespace LinearAlgebra
   ReadWriteVector<Number>::operator=(const ReadWriteVector<Number2> &in_vector)
   {
     thread_loop_partitioner = in_vector.thread_loop_partitioner;
-    if (n_elements() != in_vector.n_elements())
+    if (locally_owned_size() != in_vector.locally_owned_size())
       reinit(in_vector, true);
 
-    if (n_elements() > 0)
+    if (locally_owned_size() > 0)
       {
         dealii::internal::VectorOperations::Vector_copy<Number, Number2> copier(
           in_vector.values.get(), values.get());
         dealii::internal::VectorOperations::parallel_for(
-          copier, 0, n_elements(), thread_loop_partitioner);
+          copier, 0, locally_owned_size(), thread_loop_partitioner);
       }
 
     return *this;
@@ -399,7 +399,7 @@ namespace LinearAlgebra
            ExcMessage("Only 0 can be assigned to a vector."));
     (void)s;
 
-    const size_type this_size = n_elements();
+    const size_type this_size = locally_owned_size();
     if (this_size > 0)
       {
         dealii::internal::VectorOperations::Vector_set<Number> setter(
@@ -999,7 +999,8 @@ namespace LinearAlgebra
   ReadWriteVector<Number>::memory_consumption() const
   {
     std::size_t memory = sizeof(*this);
-    memory += sizeof(Number) * static_cast<std::size_t>(this->n_elements());
+    memory +=
+      sizeof(Number) * static_cast<std::size_t>(this->locally_owned_size());
 
     memory += stored_elements.memory_consumption();
 
index 664fba2f8a5f1c0da455b0e3e10ecbfe8ee7fe4d..1dd8eb62e2644d16665d2e2c7e5354ed51bcf057 100644 (file)
@@ -570,8 +570,8 @@ namespace internal
               std::vector<
                 std::pair<types::global_cell_index, types::global_cell_index>>,
               std::vector<unsigned int>>
-              consensus_algorithm(process, communicator);
-            consensus_algorithm.run();
+              consensus_algorithm;
+            consensus_algorithm.run(process, communicator);
           }
 
           for (unsigned i = 0;
@@ -597,8 +597,8 @@ namespace internal
         std::vector<
           std::pair<types::global_cell_index, types::global_cell_index>>,
         std::vector<unsigned int>>
-        consensus_algorithm(process, communicator);
-      consensus_algorithm.run();
+        consensus_algorithm;
+      consensus_algorithm.run(process, communicator);
 
       this->is_dst_locally_owned = is_dst_locally_owned;
       this->is_dst_remote        = is_dst_remote;
@@ -1134,7 +1134,7 @@ namespace internal
 
       touch_count_.copy_locally_owned_data_from(touch_count);
 
-      for (unsigned int i = 0; i < touch_count_.local_size(); ++i)
+      for (unsigned int i = 0; i < touch_count_.locally_owned_size(); ++i)
         touch_count_.local_element(i) =
           constraints_fine.is_constrained(
             touch_count_.get_partitioner()->local_to_global(i)) ?
@@ -3224,8 +3224,8 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::reinit(
         std::vector<
           std::pair<types::global_cell_index, types::global_cell_index>>,
         std::vector<unsigned int>>
-        consensus_algorithm(process, communicator);
-      consensus_algorithm.run();
+        consensus_algorithm;
+      consensus_algorithm.run(process, communicator);
 
       bool all_cells_found = true;
 
index cb58254d592e1fbc28dd40714e3b3e6c316a7a8e..121353f857f72caa460411cb3ab2ea39edcb7f30 100644 (file)
@@ -1070,8 +1070,8 @@ namespace Utilities
         std::vector<
           std::pair<types::global_dof_index, types::global_dof_index>>,
         std::vector<unsigned int>>
-        consensus_algorithm(process, comm);
-      consensus_algorithm.run();
+        consensus_algorithm;
+      consensus_algorithm.run(process, comm);
 
       return owning_ranks;
     }
index 3ae4c9c51f3e4a484413a733978b0ae528ae7f29..ac842e2ff110ca9553df60997eedb1e0fa6778f8 100644 (file)
@@ -121,8 +121,8 @@ namespace Utilities
         std::vector<
           std::pair<types::global_dof_index, types::global_dof_index>>,
         std::vector<unsigned int>>
-        consensus_algorithm(process, communicator);
-      consensus_algorithm.run();
+        consensus_algorithm;
+      consensus_algorithm.run(process, communicator);
 
       // setup map of processes from where this rank will receive values
       {
index c8689d9606f782441f7252f95078cdd784a79e65..89ef30f6e5f437ce6fe5b18ed485d535ae684268 100644 (file)
@@ -288,8 +288,8 @@ namespace Utilities
         std::vector<
           std::pair<types::global_dof_index, types::global_dof_index>>,
         std::vector<unsigned int>>
-        consensus_algorithm(process, communicator);
-      consensus_algorithm.run();
+        consensus_algorithm;
+      consensus_algorithm.run(process, communicator);
 
       {
         ghost_targets_data = {};
index d7b25c6590e84e348a26d37170db5d0921b2547b..e1deb26c1bbb6f60a0d6fcca8d723bcc6f20512a 100644 (file)
@@ -159,8 +159,8 @@ namespace RepartitioningPolicyTools
         std::vector<
           std::pair<types::global_cell_index, types::global_cell_index>>,
         std::vector<unsigned int>>
-        consensus_algorithm(process, communicator);
-      consensus_algorithm.run();
+        consensus_algorithm;
+      consensus_algorithm.run(process, communicator);
     }
 
     const auto tria =
@@ -288,7 +288,7 @@ namespace RepartitioningPolicyTools
     const auto partitioner =
       tria->global_active_cell_index_partitioner().lock();
 
-    std::vector<unsigned int> weights(partitioner->local_size());
+    std::vector<unsigned int> weights(partitioner->locally_owned_size());
 
     const auto mpi_communicator = tria_in.get_communicator();
     const auto n_subdomains = Utilities::MPI::n_mpi_processes(mpi_communicator);
index ed35ad410d905219680115645361e5c55f6ebce1..1484356c5fed9331e2bd60bb90d06a38db0db195 100644 (file)
@@ -993,7 +993,7 @@ namespace TriangulationDescription
     {
 #ifdef DEAL_II_WITH_MPI
       if (tria.get_communicator() == MPI_COMM_NULL)
-        AssertDimension(partition.local_size(), 0);
+        AssertDimension(partition.locally_owned_size(), 0);
 #endif
 
       if (partition.size() == 0)
@@ -1013,12 +1013,12 @@ namespace TriangulationDescription
       const std::vector<unsigned int> relevant_processes = [&]() {
         std::set<unsigned int> relevant_processes;
 
-        for (unsigned int i = 0; i < partition.local_size(); ++i)
+        for (unsigned int i = 0; i < partition.locally_owned_size(); ++i)
           relevant_processes.insert(
             static_cast<unsigned int>(partition.local_element(i)));
 
         for (const auto &partition : partitions_mg)
-          for (unsigned int i = 0; i < partition.local_size(); ++i)
+          for (unsigned int i = 0; i < partition.locally_owned_size(); ++i)
             relevant_processes.insert(
               static_cast<unsigned int>(partition.local_element(i)));
 
index eb3e1edaeb4d603e4a584e02fc3068580c740847..b51828f6af421a2818da3365add6220d583e9c76 100644 (file)
@@ -908,7 +908,7 @@ namespace internal
             for (unsigned int i = row_starts[cell * n_components].first;
                  i < row_starts[(cell + 1) * n_components].first;
                  ++i)
-              if (dof_indices[i] >= part.local_size())
+              if (dof_indices[i] >= part.locally_owned_size())
                 ghost_indices.push_back(part.local_to_global(dof_indices[i]));
 
             const unsigned int fe_index =
@@ -919,7 +919,7 @@ namespace internal
             for (unsigned int i = row_starts_plain_indices[cell];
                  i < row_starts_plain_indices[cell] + dofs_this_cell;
                  ++i)
-              if (plain_dof_indices[i] >= part.local_size())
+              if (plain_dof_indices[i] >= part.locally_owned_size())
                 ghost_indices.push_back(
                   part.local_to_global(plain_dof_indices[i]));
           }
@@ -1048,7 +1048,7 @@ namespace internal
                 const unsigned int index =
                   dof_indices_contiguous[dof_access_cell][cell_no];
                 if (flag || (index != numbers::invalid_unsigned_int &&
-                             index >= part.local_size()))
+                             index >= part.locally_owned_size()))
                   {
                     const unsigned int stride =
                       dof_indices_interleave_strides[dof_access_cell][cell_no];
@@ -1132,7 +1132,7 @@ namespace internal
                 const unsigned int index =
                   dof_indices_contiguous[dof_access_cell][cell_no];
                 if (flag || (index != numbers::invalid_unsigned_int &&
-                             index >= part.local_size()))
+                             index >= part.locally_owned_size()))
                   {
                     const unsigned int stride =
                       dof_indices_interleave_strides[dof_access_cell][cell_no];
index 12f6661f34b24f68891eea1d872a150b8221f823..c3600fbe3a3fb4e2176ba66f702988c65f705d79 100644 (file)
@@ -443,8 +443,8 @@ namespace internal
           std::vector<
             std::pair<types::global_dof_index, types::global_dof_index>>,
           std::vector<unsigned int>>
-          consensus_algorithm(process, comm);
-        consensus_algorithm.run();
+          consensus_algorithm;
+        consensus_algorithm.run(process, comm);
 
         // decompress ghost_indices_within_larger_ghost_set for simpler
         // data access during setup

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.