From: Peter Munch Date: Tue, 10 Nov 2020 11:54:45 +0000 (+0100) Subject: Improve VectorDataExchange::Full::reset_ghost_values X-Git-Tag: v9.3.0-rc1~919^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=195a468777ae0b922023dac8d20f9fe2c1dd83fa;p=dealii.git Improve VectorDataExchange::Full::reset_ghost_values --- diff --git a/source/matrix_free/vector_data_exchange.cc b/source/matrix_free/vector_data_exchange.cc index 17939f8416..e127111cd6 100644 --- a/source/matrix_free/vector_data_exchange.cc +++ b/source/matrix_free/vector_data_exchange.cc @@ -1344,10 +1344,18 @@ namespace internal void Full::reset_ghost_values_impl(const ArrayView &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); }