From: Wolfgang Bangerth Date: Thu, 3 Nov 2016 16:57:28 +0000 (-0500) Subject: Fix BlockVectorBase::memory_consumption. X-Git-Tag: v8.5.0-rc1~490^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81efe5167f329a5ea6f5a43cfdf736db9a93c9c3;p=dealii.git Fix BlockVectorBase::memory_consumption. The existing implementation forgot to add the memory required for the std::vector of blocks, it only added the memory required for the blocks themselves. It turns out that fixing this also allows to simplify the code significantly. --- diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 0bc19dd96a..7ebd90efbe 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -2049,11 +2049,9 @@ template std::size_t BlockVectorBase::memory_consumption () const { - std::size_t mem = MemoryConsumption::memory_consumption (this->block_indices); - for (size_type i=0; icomponents.size(); ++i) - mem += MemoryConsumption::memory_consumption (this->components[i]); - - return mem; + return (MemoryConsumption::memory_consumption (this->block_indices) + + + MemoryConsumption::memory_consumption (this->components)); }