]> https://gitweb.dealii.org/ - dealii.git/commitdiff
actually fix the problem 12634/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 20 Aug 2021 21:19:08 +0000 (17:19 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sat, 21 Aug 2021 17:08:43 +0000 (13:08 -0400)
source/multigrid/mg_level_global_transfer.cc
tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output

index 2e45f359fafdb06d2637cc339004cc0fd9789189..f0c18c13579e127cbf3e972dc2d55244f401b250 100644 (file)
@@ -330,16 +330,22 @@ MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<Number>>::
       solution_ghosted_level_vector           = ghosted_level_vector;
     }
 
-  bool my_perform_renumbered_plain_copy =
+  // Check if we can perform a cheaper "plain copy" (with or without
+  // renumbering) instead of having to translate individual entries
+  // using copy_indices*. This only works if a) we don't have to send
+  // or receive any DoFs and we have all locally owned DoFs in our
+  // copy_indices (so no adaptive refinement) and b) all processors
+  // agree on the choice (see below).
+  const bool my_perform_renumbered_plain_copy =
     (this->copy_indices.back().n_cols() ==
-     mg_dof.locally_owned_dofs().n_elements());
+     mg_dof.locally_owned_dofs().n_elements()) &&
+    (this->copy_indices_global_mine.back().n_rows() == 0) &&
+    (this->copy_indices_level_mine.back().n_rows() == 0);
+
   bool my_perform_plain_copy = false;
   if (my_perform_renumbered_plain_copy)
     {
       my_perform_plain_copy = true;
-      AssertDimension(this->copy_indices_global_mine.back().n_rows(), 0);
-      AssertDimension(this->copy_indices_level_mine.back().n_rows(), 0);
-
       // check whether there is a renumbering of degrees of freedom on
       // either the finest level or the global dofs, which means that we
       // cannot apply a plain copy
index ee2f46465a69e607154f1e9f64a844c71f72ee68..cde307a16cfa83690a642fe526af383cd57aca0e 100644 (file)
@@ -1,19 +1,11 @@
 
-DEAL::n_dofs = 50
-DEAL::OK
-DEAL::n_dofs = 18
-DEAL::OK
-DEAL::n_dofs = 8
-DEAL::OK
-DEAL::n_dofs = 8
-DEAL::OK
-DEAL::
-DEAL::n_dofs = 375
-DEAL::OK
-DEAL::n_dofs = 81
-DEAL::OK
-DEAL::n_dofs = 24
-DEAL::OK
-DEAL::n_dofs = 24
-DEAL::OK
-DEAL::
+DEAL:0::n_dofs = 9
+DEAL:0::OK
+DEAL:0::n_dofs = 84
+DEAL:0::OK
+
+DEAL:1::n_dofs = 9
+DEAL:1::OK
+DEAL:1::n_dofs = 84
+DEAL:1::OK
+

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.