From 95fbdfd251f30922bd0aeb0eed6abb301dde8ac7 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 6 Jun 2022 22:06:55 +0200 Subject: [PATCH] Try to fix valence --- source/distributed/solution_transfer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5