From: Peter Munch Date: Mon, 6 Jun 2022 20:06:55 +0000 (+0200) Subject: Try to fix valence X-Git-Tag: v9.4.0-rc1~55^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95fbdfd251f30922bd0aeb0eed6abb301dde8ac7;p=dealii.git Try to fix valence --- diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index eeb35c3954..1307bc5117 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -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(valence[i]) == Number() ? + Number() : + (Number(1.0) / static_cast(valence[i]))); valence.compress(::dealii::VectorOperation::insert); for (const auto vec : all_out)