From: Daniel Arndt Date: Thu, 15 Aug 2024 04:00:29 +0000 (-0600) Subject: Fix compiling SolutionTransfer with complex values X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e18e73f2ce2b729c6fe416f5b83aadcccfa175fa;p=dealii.git Fix compiling SolutionTransfer with complex values --- diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 3f5e26856f..0cd0ded5d5 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -261,9 +261,11 @@ SolutionTransfer::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::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(valence[i]) == Number() ?