From: Peter Munch Date: Sat, 14 May 2022 12:10:10 +0000 (+0200) Subject: Minor changes X-Git-Tag: v9.4.0-rc1~84^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13457%2Fhead;p=dealii.git Minor changes --- diff --git a/doc/news/changes/minor/20220514Munch b/doc/news/changes/minor/20220514Munch new file mode 100644 index 0000000000..514f5d7615 --- /dev/null +++ b/doc/news/changes/minor/20220514Munch @@ -0,0 +1,5 @@ +New: We added the possibility to average the contributions to a DoF from +different cells in parallel::distributed::SolutionTransfer. For this purpose, +set the corresponding flag in the constructor. +
+(Peter Munch, Magdalena Schreter, 2022/05/14) diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index f9c476c530..87684223da 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -244,8 +244,9 @@ namespace parallel &dof_handler->get_triangulation()))); Assert(tria != nullptr, ExcInternalError()); - for (const auto vec : all_out) - *vec = 0.0; + if (average_values) + for (const auto vec : all_out) + *vec = 0.0; VectorType valence; @@ -268,12 +269,12 @@ namespace parallel // finalize valence: compress and invert valence.compress(::dealii::VectorOperation::add); for (const auto i : valence.locally_owned_elements()) - valence[i] = valence[i] == 0.0 ? 0.0 : (1.0 / valence[i]); + valence[i] = (valence[i] == 0.0 ? 0.0 : (1.0 / valence[i])); valence.compress(::dealii::VectorOperation::insert); for (const auto vec : all_out) { - // comress and weight with valence + // compress and weight with valence vec->compress(::dealii::VectorOperation::add); vec->scale(valence); }