]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve VectorDataExchange::Full::reset_ghost_values 11156/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 10 Nov 2020 11:54:45 +0000 (12:54 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 10 Nov 2020 17:01:25 +0000 (18:01 +0100)
source/matrix_free/vector_data_exchange.cc

index 17939f8416fb27b4fc0c73a45f69160f92823889..e127111cd6db793fa83e06141c9bd7a5065570e4 100644 (file)
@@ -1344,10 +1344,18 @@ namespace internal
       void
       Full::reset_ghost_values_impl(const ArrayView<Number> &ghost_array) const
       {
-        // TODO
-        std::memset(ghost_array.data(),
-                    0.0,
-                    ghost_array.size() * sizeof(Number));
+        // reset ghost values coming from shared-memory neighbors
+        // TODO: only needed if values are buffered
+        for (const auto &i : sm_export_data_this.second)
+          std::memset(ghost_array.data() + (i.first - n_local_elements),
+                      0,
+                      sizeof(Number) * i.second);
+
+        // reset ghost values coming from remote neighbors
+        for (const auto &i : ghost_indices_subset_data.second)
+          std::memset(ghost_array.data() + i.first,
+                      0,
+                      sizeof(Number) * i.second);
       }
 
 

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.