]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Try to fix valence 13920/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 6 Jun 2022 20:06:55 +0000 (22:06 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 7 Jun 2022 10:40:02 +0000 (12:40 +0200)
source/distributed/solution_transfer.cc

index eeb35c3954b463475f893b910805b869f3787a6c..1307bc5117f71b837787efab5dda148d6d4072e9 100644 (file)
@@ -267,9 +267,12 @@ namespace parallel
       if (average_values)
         {
           // finalize valence: compress and invert
+          using Number = typename VectorType::value_type;
           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] = (static_cast<Number>(valence[i]) == Number() ?
+                            Number() :
+                            (Number(1.0) / static_cast<Number>(valence[i])));
           valence.compress(::dealii::VectorOperation::insert);
 
           for (const auto vec : all_out)

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.