From: kanschat Date: Fri, 23 May 2008 19:35:19 +0000 (+0000) Subject: Improve computation of MemoryConsumption of MGTransferBlockBase and MGTransferCompone... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3113f551fc9753bd0a89a16b7a703702b55f5083;p=dealii-svn.git Improve computation of MemoryConsumption of MGTransferBlockBase and MGTransferComponentBase accurate computation requires memory_consumption(std::map<...>), which should be implemented for next version git-svn-id: https://svn.dealii.org/trunk@16193 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc b/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc index 556afba180..92966843a2 100644 --- a/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc +++ b/deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -225,15 +225,27 @@ void MGTransferBlock::restrict_and_add ( -//TODO:[GK] Add all those little vectors. unsigned int MGTransferComponentBase::memory_consumption () const { unsigned int result = sizeof(*this); - result += sizeof(unsigned int) * sizes.size(); - for (unsigned int i=0;imemory_consumption() - + prolongation_sparsities[i]->memory_consumption(); + result += MemoryConsumption::memory_consumption(selected) + - sizeof(selected); + result += MemoryConsumption::memory_consumption(target_component) + - sizeof(mg_target_component); + result += MemoryConsumption::memory_consumption(sizes) + - sizeof(sizes); + result += MemoryConsumption::memory_consumption(component_start) + - sizeof(component_start); + result += MemoryConsumption::memory_consumption(mg_component_start) + - sizeof(mg_component_start); + result += MemoryConsumption::memory_consumption(prolongation_sparsities) + - sizeof(prolongation_sparsities); + result += MemoryConsumption::memory_consumption(prolongation_matrices) + - sizeof(prolongation_matrices); +//TODO:[GK] Add this. +// result += MemoryConsumption::memory_consumption(copy_to_and_from_indices) +// - sizeof(copy_to_and_from_indices); return result; } @@ -244,9 +256,21 @@ MGTransferBlockBase::memory_consumption () const { unsigned int result = sizeof(*this); result += sizeof(unsigned int) * sizes.size(); - for (unsigned int i=0;imemory_consumption() - + prolongation_sparsities[i]->memory_consumption(); + result += MemoryConsumption::memory_consumption(selected) + - sizeof(selected); + result += MemoryConsumption::memory_consumption(mg_block) + - sizeof(mg_block); + result += MemoryConsumption::memory_consumption(block_start) + - sizeof(block_start); + result += MemoryConsumption::memory_consumption(mg_block_start) + - sizeof(mg_block_start); + result += MemoryConsumption::memory_consumption(prolongation_sparsities) + - sizeof(prolongation_sparsities); + result += MemoryConsumption::memory_consumption(prolongation_matrices) + - sizeof(prolongation_matrices); +//TODO:[GK] Add this. +// result += MemoryConsumption::memory_consumption(copy_indices) +// - sizeof(copy_indices); return result; }