From 394112700a0cd853017efa571f2c0feb311f947f Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 14 May 2022 14:10:10 +0200 Subject: [PATCH] Minor changes --- doc/news/changes/minor/20220514Munch | 5 +++++ source/distributed/solution_transfer.cc | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 doc/news/changes/minor/20220514Munch 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); } -- 2.39.5