]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid the use of deprecated functions.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 8 Sep 2023 11:30:20 +0000 (05:30 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 8 Sep 2023 12:46:41 +0000 (06:46 -0600)
include/deal.II/distributed/solution_transfer.h
include/deal.II/fe/fe_tools_extrapolate.templates.h
include/deal.II/fe/fe_tools_interpolate.templates.h
include/deal.II/numerics/solution_transfer.h
source/dofs/dof_renumbering.cc
source/dofs/dof_tools_constraints.cc
source/fe/mapping_q_cache.cc
source/multigrid/mg_transfer_prebuilt.cc
source/numerics/data_out_resample.cc

index db5ee4dfed6b4fa1045540a17be014f28347684d..015ec0faa0130f8187f8e80f4209bd82f880a686 100644 (file)
@@ -89,10 +89,9 @@ namespace parallel
      * process):
      * @code
      * // Create initial indexsets pertaining to the grid before refinement
-     * IndexSet locally_owned_dofs, locally_relevant_dofs;
-     * locally_owned_dofs = dof_handler.locally_owned_dofs();
-     * DoFTools::extract_locally_relevant_dofs(dof_handler,
-     *                                         locally_relevant_dofs);
+     * const IndexSet locally_owned_dofs    = dof_handler.locally_owned_dofs();
+     * const IndexSet locally_relevant_dofs =
+     * DoFTools::extract_locally_relevant_dofs(dof_handler);
      *
      * // The solution vector only knows about locally owned DoFs
      * TrilinosWrappers::MPI::Vector solution;
index 761f7de48bec5425115d6dfa06de2b9e39e286dd..7461abedaf486d96111bb5110dec193ac372ee84 100644 (file)
@@ -1586,8 +1586,8 @@ namespace FETools
           &dh.get_triangulation());
       Assert(parallel_tria != nullptr, ExcNotImplemented());
       const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
-      IndexSet        locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+      const IndexSet  locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dh);
       vector.reinit(locally_owned_dofs,
                     locally_relevant_dofs,
                     parallel_tria->get_communicator());
@@ -1606,8 +1606,8 @@ namespace FETools
           &dh.get_triangulation());
       Assert(parallel_tria != nullptr, ExcNotImplemented());
       const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
-      IndexSet        locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+      const IndexSet  locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dh);
       vector.reinit(locally_owned_dofs,
                     locally_relevant_dofs,
                     parallel_tria->get_communicator());
@@ -1625,8 +1625,8 @@ namespace FETools
           &dh.get_triangulation());
       Assert(parallel_tria != nullptr, ExcNotImplemented());
       const IndexSet &locally_owned_dofs = dh.locally_owned_dofs();
-      IndexSet        locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_dofs(dh, locally_relevant_dofs);
+      const IndexSet  locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dh);
       vector.reinit(locally_owned_dofs,
                     locally_relevant_dofs,
                     parallel_tria->get_communicator());
index cf1350a8cc9575be6d6144c6359bd0b71b39cefe..bea408341d888c6d5fb1ee17065a86dc9f3c6739 100644 (file)
@@ -382,8 +382,8 @@ namespace FETools
       // vector u2 with based on the sets of locally owned and relevant
       // dofs of dof2
       const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
-      IndexSet        dof2_locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+      const IndexSet  dof2_locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dof2);
 
       PETScWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs,
                                         u1.get_mpi_communicator());
@@ -431,8 +431,8 @@ namespace FETools
       // vector u2 with based on the sets of locally owned and relevant
       // dofs of dof2
       const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
-      IndexSet        dof2_locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+      const IndexSet  dof2_locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dof2);
 
       TrilinosWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs,
                                            u1.get_mpi_communicator());
@@ -462,8 +462,8 @@ namespace FETools
         return;
       const MPI_Comm  mpi_communicator = u1.block(0).get_mpi_communicator();
       const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
-      IndexSet        dof2_locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+      const IndexSet  dof2_locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dof2);
 
       TrilinosWrappers::MPI::Vector u2_out(dof2_locally_owned_dofs,
                                            mpi_communicator);
@@ -524,8 +524,8 @@ namespace FETools
       LinearAlgebra::distributed::Vector<Number>       &u1_interpolated)
     {
       const IndexSet &dof2_locally_owned_dofs = dof2.locally_owned_dofs();
-      IndexSet        dof2_locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_dofs(dof2, dof2_locally_relevant_dofs);
+      const IndexSet  dof2_locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dof2);
 
       LinearAlgebra::distributed::Vector<Number> u2(dof2_locally_owned_dofs,
                                                     dof2_locally_relevant_dofs,
index ff35c6d7507ed2cdcdfd96066d58c74cc210c609..3e6043b3c5a4c37b6b803400625859c3a0b05dd1 100644 (file)
@@ -129,9 +129,9 @@ DEAL_II_NAMESPACE_OPEN
  * required for the interpolation process):
  * @code
  * // Create initial indexsets pertaining to the grid before refinement
- * IndexSet locally_owned_dofs, locally_relevant_dofs;
- * locally_owned_dofs = dof_handler.locally_owned_dofs();
- * DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+ * const IndexSet locally_owned_dofs    = dof_handler.locally_owned_dofs();
+ * const IndexSet locally_relevant_dofs =
+ * DoFTools::extract_locally_relevant_dofs(dof_handler);
  *
  * // The solution vector only knows about locally owned DoFs
  * TrilinosWrappers::MPI::Vector solution;
index 6ddf1a96d00bdacf315077ae4480df9822debd7f..d23430577473be3f98097b9477f38a6916f4c573 100644 (file)
@@ -415,17 +415,16 @@ namespace DoFRenumbering
     const IndexSet &locally_owned_dofs = [&]() -> const IndexSet & {
       if (reorder_level_dofs == false)
         {
-          DoFTools::extract_locally_relevant_dofs(dof_handler,
-                                                  locally_relevant_dofs);
+          locally_relevant_dofs =
+            DoFTools::extract_locally_relevant_dofs(dof_handler);
           return dof_handler.locally_owned_dofs();
         }
       else
         {
           Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
                  ExcDoFHandlerNotInitialized());
-          DoFTools::extract_locally_relevant_level_dofs(dof_handler,
-                                                        level,
-                                                        locally_relevant_dofs);
+          locally_relevant_dofs =
+            DoFTools::extract_locally_relevant_level_dofs(dof_handler, level);
           return dof_handler.locally_owned_mg_dofs(level);
         }
     }();
@@ -476,14 +475,13 @@ namespace DoFRenumbering
         IndexSet locally_active_dofs;
         if (reorder_level_dofs == false)
           {
-            DoFTools::extract_locally_active_dofs(dof_handler,
-                                                  locally_active_dofs);
+            locally_active_dofs =
+              DoFTools::extract_locally_active_dofs(dof_handler);
           }
         else
           {
-            DoFTools::extract_locally_active_level_dofs(dof_handler,
-                                                        locally_active_dofs,
-                                                        level);
+            locally_active_dofs =
+              DoFTools::extract_locally_active_level_dofs(dof_handler, level);
           }
 
         bool needs_locally_active = false;
index c0d8d3bb6e25f7e53d760e6fe1b8bbd7e396b942..db9f5458dc1d7f84dec0a145ffcfc94f05e0f356 100644 (file)
@@ -2894,10 +2894,9 @@ namespace DoFTools
               }
 
 
-            IndexSet locally_relevant_dofs;
-            DoFTools::extract_locally_relevant_dofs(
-              coarse_to_fine_grid_map.get_destination_grid(),
-              locally_relevant_dofs);
+            const IndexSet locally_relevant_dofs =
+              DoFTools::extract_locally_relevant_dofs(
+                coarse_to_fine_grid_map.get_destination_grid());
 
             copy_data.global_parameter_representation[i].reinit(
               coarse_to_fine_grid_map.get_destination_grid()
index 813f4a7c4fa80bb680710dbd23ef90752adf40cb..abeb8758d6dfde2e08d0d7cf31f9a2639232d93c 100644 (file)
@@ -311,9 +311,9 @@ MappingQCache<dim, spacedim>::initialize(
   // Step 1: copy global vector so that the ghost values are such that the
   // cache can be set up for all ghost cells
   LinearAlgebra::distributed::Vector<typename VectorType::value_type>
-           vector_ghosted;
-  IndexSet locally_relevant_dofs;
-  DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+                 vector_ghosted;
+  const IndexSet locally_relevant_dofs =
+    DoFTools::extract_locally_relevant_dofs(dof_handler);
   vector_ghosted.reinit(dof_handler.locally_owned_dofs(),
                         locally_relevant_dofs,
                         dof_handler.get_communicator());
@@ -515,10 +515,8 @@ MappingQCache<dim, spacedim>::initialize(
 
   for (unsigned int l = vectors.min_level(); l <= vectors.max_level(); ++l)
     {
-      IndexSet locally_relevant_dofs;
-      DoFTools::extract_locally_relevant_level_dofs(dof_handler,
-                                                    l,
-                                                    locally_relevant_dofs);
+      const IndexSet locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_level_dofs(dof_handler, l);
       vectors_ghosted[l].reinit(dof_handler.locally_owned_mg_dofs(l),
                                 locally_relevant_dofs,
                                 dof_handler.get_communicator());
index 9a157191357b5f49a72b2a9d6c99e1b29d9a449d..408f298d5f1204e5d9fa134fa2273f1f016356cb 100644 (file)
@@ -211,10 +211,8 @@ MGTransferPrebuilt<VectorType>::build(
       //
       // increment dofs_per_cell since a useless diagonal element will be
       // stored
-      IndexSet level_p1_relevant_dofs;
-      DoFTools::extract_locally_relevant_level_dofs(dof_handler,
-                                                    level + 1,
-                                                    level_p1_relevant_dofs);
+      const IndexSet level_p1_relevant_dofs =
+        DoFTools::extract_locally_relevant_level_dofs(dof_handler, level + 1);
       DynamicSparsityPattern dsp(this->sizes[level + 1],
                                  this->sizes[level],
                                  level_p1_relevant_dofs);
index 22d9ce4f329465ac00a3a225cb4ecaea190ab5fd..df7f7abf8e9a69792355eb7446f29159b65870c1 100644 (file)
@@ -64,8 +64,8 @@ DataOutResample<dim, patch_dim, spacedim>::update_mapping(
 
   std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
 
-  IndexSet active_dofs;
-  DoFTools::extract_locally_active_dofs(patch_dof_handler, active_dofs);
+  const IndexSet active_dofs =
+    DoFTools::extract_locally_active_dofs(patch_dof_handler);
   partitioner = std::make_shared<Utilities::MPI::Partitioner>(
     patch_dof_handler.locally_owned_dofs(), active_dofs, MPI_COMM_WORLD);
 

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.