]> https://gitweb.dealii.org/ - dealii.git/commitdiff
MGLevelGlobalTransfer: remove unused variables 15782/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 22 Jul 2023 21:54:21 +0000 (23:54 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 23 Jul 2023 06:29:16 +0000 (08:29 +0200)
include/deal.II/multigrid/mg_transfer.h
source/multigrid/mg_level_global_transfer.cc

index 5927dfb3716ba164731cc5a062b2bc4bb714d3f3..6f7c7e6071f43abea8e52eaa71e6ca6712a593c3 100644 (file)
@@ -536,11 +536,6 @@ protected:
    */
   std::vector<Table<2, unsigned int>> copy_indices_global_mine;
 
-  /**
-   * Same as above, but used to transfer solution vectors.
-   */
-  std::vector<Table<2, unsigned int>> solution_copy_indices_global_mine;
-
   /**
    * Additional degrees of freedom for the copy_from_mg() function. These are
    * the ones where the level degree of freedom is locally owned and the
@@ -605,12 +600,6 @@ protected:
   mutable MGLevelObject<LinearAlgebra::distributed::Vector<Number>>
     ghosted_level_vector;
 
-  /**
-   * Same as above but used when working with solution vectors.
-   */
-  mutable MGLevelObject<LinearAlgebra::distributed::Vector<Number>>
-    solution_ghosted_level_vector;
-
   /**
    * Function to initialize internal level vectors.
    */
index 332ea52d0fb89f9713cd75837784cf434c0425de..5abd0f0effc9f609c7710240319fd744e4a542d4 100644 (file)
@@ -312,22 +312,27 @@ MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::
           break;
         }
   if (Utilities::MPI::max(have_refinement_edge_dofs, mpi_communicator) == 1)
-    fill_internal(mg_dof,
-                  mg_constrained_dofs,
-                  mpi_communicator,
-                  true,
-                  this->solution_copy_indices,
-                  this->solution_copy_indices_global_mine,
-                  this->solution_copy_indices_level_mine,
-                  solution_ghosted_global_vector,
-                  solution_ghosted_level_vector);
+    {
+      // note: variables not needed
+      std::vector<Table<2, unsigned int>> solution_copy_indices_global_mine;
+      MGLevelObject<LinearAlgebra::distributed::Vector<Number>>
+        solution_ghosted_level_vector;
+
+      fill_internal(mg_dof,
+                    mg_constrained_dofs,
+                    mpi_communicator,
+                    true,
+                    this->solution_copy_indices,
+                    solution_copy_indices_global_mine,
+                    this->solution_copy_indices_level_mine,
+                    solution_ghosted_global_vector,
+                    solution_ghosted_level_vector);
+    }
   else
     {
-      this->solution_copy_indices             = this->copy_indices;
-      this->solution_copy_indices_global_mine = this->copy_indices_global_mine;
-      this->solution_copy_indices_level_mine  = this->copy_indices_level_mine;
-      solution_ghosted_global_vector          = ghosted_global_vector;
-      solution_ghosted_level_vector           = ghosted_level_vector;
+      this->solution_copy_indices            = this->copy_indices;
+      this->solution_copy_indices_level_mine = this->copy_indices_level_mine;
+      solution_ghosted_global_vector         = ghosted_global_vector;
     }
 
   // Check if we can perform a cheaper "plain copy" (with or without
@@ -375,7 +380,6 @@ MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::
       ghosted_global_vector.reinit(0);
       ghosted_level_vector.resize(0, 0);
       solution_ghosted_global_vector.reinit(0);
-      solution_ghosted_level_vector.resize(0, 0);
     }
 }
 
@@ -389,7 +393,6 @@ MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::clear()
   copy_indices.clear();
   solution_copy_indices.clear();
   copy_indices_global_mine.clear();
-  solution_copy_indices_global_mine.clear();
   copy_indices_level_mine.clear();
   solution_copy_indices_level_mine.clear();
   component_to_block_map.resize(0);
@@ -397,7 +400,6 @@ MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::clear()
   ghosted_global_vector.reinit(0);
   solution_ghosted_global_vector.reinit(0);
   ghosted_level_vector.resize(0, 0);
-  solution_ghosted_level_vector.resize(0, 0);
   perform_plain_copy            = false;
   perform_renumbered_plain_copy = false;
   initialize_dof_vector         = nullptr;

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.