]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Minor changes 13457/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 14 May 2022 12:10:10 +0000 (14:10 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 14 May 2022 12:10:10 +0000 (14:10 +0200)
doc/news/changes/minor/20220514Munch [new file with mode: 0644]
source/distributed/solution_transfer.cc

diff --git a/doc/news/changes/minor/20220514Munch b/doc/news/changes/minor/20220514Munch
new file mode 100644 (file)
index 0000000..514f5d7
--- /dev/null
@@ -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. 
+<br>
+(Peter Munch, Magdalena Schreter, 2022/05/14)
index f9c476c53060cd017534457630292246b461c67b..87684223dafe5120af0fd38b6d4ed81ce75636da 100644 (file)
@@ -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);
             }

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.