]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
memory_consumption() for IndexSet.
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Jun 2010 08:09:20 +0000 (08:09 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Jun 2010 08:09:20 +0000 (08:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@21263 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/index_set.h
deal.II/base/source/index_set.cc

index 19311fefb19d5657497215361ddfcfbe7a70a16a..c427183c3799dbb167ed42dd60188a40a3fe6d11 100644 (file)
@@ -312,6 +312,14 @@ class IndexSet
                                  const bool      overlapping  = false) const;
 #endif
 
+    
+                                    /**
+                                      * Determine an estimate for the memory
+                                      * consumption (in bytes) of this
+                                      * object.
+                                     */
+    unsigned int memory_consumption () const;
+
   private:
                                     /**
                                      * A type that denotes the half
@@ -362,6 +370,12 @@ class IndexSet
                    ||
                    (range_1.begin == range_2.begin));
          }
+
+       unsigned int memory_consumption () const
+         {
+           return sizeof(Range);
+         }
+       
     };
 
                                     /**
index 174c9ff59106fe629446a41c88470a2373412729..0c3d652822cf3e75b938ece8284a761bcebe38f7 100644 (file)
@@ -12,6 +12,7 @@
 //---------------------------------------------------------------------------
 
 
+#include <base/memory_consumption.h>
 #include <base/index_set.h>
 #include <list>
 
@@ -338,4 +339,15 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator,
 
 #endif
 
+
+unsigned int
+IndexSet::memory_consumption () const
+{
+  return MemoryConsumption::memory_consumption (ranges) +
+    MemoryConsumption::memory_consumption (is_compressed) +
+    MemoryConsumption::memory_consumption (index_space_size);
+}
+
+
+
 DEAL_II_NAMESPACE_CLOSE

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.