]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compiling SolutionTransfer with complex values 17538/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 15 Aug 2024 04:00:29 +0000 (22:00 -0600)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 15 Aug 2024 04:00:29 +0000 (22:00 -0600)
source/numerics/solution_transfer.cc

index 3f5e26856fe64936133d8fd839a96436bf1610a2..0cd0ded5d50a8f77328b6503019993727cf2e3e8 100644 (file)
@@ -261,9 +261,11 @@ SolutionTransfer<dim, VectorType, spacedim>::interpolate(
     ExcMessage(
       "You can only call interpolate() once per SolutionTransfer object."));
 
+  using Number = typename VectorType::value_type;
+
   if (average_values)
     for (auto *const vec : all_out)
-      *vec = 0.0;
+      *vec = Number();
 
   VectorType valence;
 
@@ -284,7 +286,6 @@ SolutionTransfer<dim, VectorType, spacedim>::interpolate(
   if (average_values)
     {
       // finalize valence: compress and invert
-      using Number = typename VectorType::value_type;
       valence.compress(VectorOperation::add);
       for (const auto i : valence.locally_owned_elements())
         valence[i] = (static_cast<Number>(valence[i]) == Number() ?

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.