]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move a zero_out_ghost_values 12722/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 28 Aug 2021 19:39:34 +0000 (21:39 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 28 Aug 2021 19:39:34 +0000 (21:39 +0200)
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h

index 9c20a074e745bfcbe438e0cc934afb3d3f932f8d..87231c766e7207db3141c12bbc87a356954e0a5e 100644 (file)
@@ -2608,9 +2608,6 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
         }
     }
 
-  this->vec_coarse.zero_out_ghost_values(); // clear ghost values; else compress
-                                            // in do_restrict_add does not work
-
   if (fine_element_is_continuous || use_dst_inplace == false)
     vec_fine_ptr->compress(VectorOperation::add);
 
@@ -2640,6 +2637,8 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
     vec_fine_ptr->update_ghost_values();
 
   this->vec_coarse.copy_locally_owned_data_from(dst);
+  this->vec_coarse.zero_out_ghost_values(); // since we might add into the
+                                            // ghost values and call compress
 
   AlignedVector<VectorizedArrayType> evaluation_data_fine;
   AlignedVector<VectorizedArrayType> evaluation_data_coarse;

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.