From 20f4c52bb1506f900e41ed6744ca9f1d147c3b7d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 27 Oct 2017 15:51:34 -0600 Subject: [PATCH] Use appropriate data types. --- include/deal.II/lac/block_vector_base.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 02a967252d..c2e0c59da7 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -18,6 +18,7 @@ #include +#include #include #include #include @@ -1693,9 +1694,9 @@ BlockVectorBase::mean_value () const value_type sum = 0.; // need to do static_cast as otherwise it won't work with value_type=complex for (size_type i=0; i(components[i].size()); + sum += components[i].mean_value() * (typename numbers::NumberTraits::real_type(components[i].size())); - return sum/static_cast(size()); + return sum/(typename numbers::NumberTraits::real_type(size())); } -- 2.39.5