]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix DofHandler::memory_consumption().
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 21 Jun 2010 20:37:20 +0000 (20:37 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 21 Jun 2010 20:37:20 +0000 (20:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@21261 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/block_info.h
deal.II/deal.II/source/dofs/block_info.cc
deal.II/deal.II/source/dofs/dof_handler.cc

index 9b2f3cbb60360974bbcc5a242d57d5f6d357da91..b9054d4dd0f69f5bd9c4548bad16de5933e00e44 100644 (file)
@@ -171,6 +171,13 @@ class BlockInfo : public Subscriptor
                                      */
     unsigned int base_element(unsigned int i) const;
     
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     */
+    unsigned int memory_consumption () const;
+
   private:
                                     /**
                                      * @brief The block structure
index e3b2991c6f9ac52fe225c51a4f8e030946c1a418..2c176773742339e3019162d5768d2f80cf34455d 100644 (file)
@@ -12,6 +12,7 @@
 //---------------------------------------------------------------------------
 
 
+#include <base/memory_consumption.h>
 #include <dofs/block_info.h>
 #include <dofs/dof_handler.h>
 #include <dofs/dof_tools.h>
@@ -72,6 +73,20 @@ BlockInfo::initialize(const MGDoFHandler<dim, spacedim>& dof, bool levels_only)
 }
 
 
+unsigned int
+BlockInfo::memory_consumption () const
+{
+  unsigned int mem = (MemoryConsumption::memory_consumption (bi_global) +
+                     MemoryConsumption::memory_consumption (levels) +
+                     MemoryConsumption::memory_consumption (bi_local) +
+                     MemoryConsumption::memory_consumption (base_elements)
+  );
+
+  return mem;
+}
+
+
+
 template void BlockInfo::initialize(const DoFHandler<deal_II_dimension,deal_II_dimension>&);
 template void BlockInfo::initialize(const MGDoFHandler<deal_II_dimension,deal_II_dimension>&, bool);
 template void BlockInfo::initialize_local(const DoFHandler<deal_II_dimension,deal_II_dimension>&);
index e776316bbda0f7fa0ad00c6dcd61dc91f4793211..9c2758fd9b07fa289411ab43c318c0013895a1c3 100644 (file)
@@ -1935,14 +1935,14 @@ DoFHandler<dim,spacedim>::memory_consumption () const
 {
   unsigned int mem = (MemoryConsumption::memory_consumption (tria) +
                      MemoryConsumption::memory_consumption (selected_fe) +
-                     MemoryConsumption::memory_consumption (tria) +
+                     MemoryConsumption::memory_consumption (block_info_object) +
                      MemoryConsumption::memory_consumption (levels) +
                      MemoryConsumption::memory_consumption (*faces) +
+                     MemoryConsumption::memory_consumption (faces) +
                      MemoryConsumption::memory_consumption (used_dofs) +
                      MemoryConsumption::memory_consumption (vertex_dofs));
   for (unsigned int i=0; i<levels.size(); ++i)
     mem += MemoryConsumption::memory_consumption (*levels[i]);
-  mem += MemoryConsumption::memory_consumption (*faces);
 
   return mem;
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.