]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add memory_consumption functions to all remaining classes in /numerics.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Nov 2000 09:14:48 +0000 (09:14 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Nov 2000 09:14:48 +0000 (09:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@3503 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/data_out.h
deal.II/deal.II/include/numerics/data_out_stack.h
deal.II/deal.II/include/numerics/histogram.h
deal.II/deal.II/include/numerics/solution_transfer.h
deal.II/deal.II/include/numerics/time_dependent.h
deal.II/deal.II/source/numerics/data_out.cc
deal.II/deal.II/source/numerics/data_out_stack.cc
deal.II/deal.II/source/numerics/histogram.cc
deal.II/deal.II/source/numerics/solution_transfer.cc
deal.II/deal.II/source/numerics/time_dependent.cc

index b067e5754a581bf43481d066553ed9d01a3f5d35..cbb9b6c36b83c1a51003a0ea87a480064dbe5b4e 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <base/data_out_base.h>
+#include <base/smartpointer.h>
 #include <base/multithread_info.h>
 
 
@@ -302,6 +303,13 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                      */
     virtual void clear ();
 
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     */
+    unsigned int memory_consumption () const;
+
                                     /**
                                      * Exception
                                      */
@@ -351,9 +359,20 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                          */
        DataEntry (const Vector<double> *data = 0,
                   const vector<string> &names = vector<string>());
+
+                                        /**
+                                         * Determine an estimate for the
+                                         * memory consumption (in bytes)
+                                         * of this object.
+                                         */
+       unsigned int memory_consumption () const;
        
                                         /**
-                                         * Pointer to the data vector.
+                                         * Pointer to the data
+                                         * vector. Note that
+                                         * ownership of the vector
+                                         * pointed to remains with
+                                         * the caller of this class.
                                          */
        const Vector<double> *data;
        
@@ -373,7 +392,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                     /**
                                      * Pointer to the dof handler object.
                                      */
-    const DoFHandler<dof_handler_dim> *dofs;
+    SmartPointer<const DoFHandler<dof_handler_dim> > dofs;
 
                                     /**
                                      * List of data elements with vectors of
index b76d66bd991b2e26d924e14f162dd41f823b9997..a8c5b879f578374f8fb7ec320f9aeabf1479cead 100644 (file)
@@ -271,7 +271,14 @@ class DataOutStack : public DataOutInterface<dim+1>
                                      * in this object.
                                      */
     void clear ();
-    
+
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     */
+    unsigned int memory_consumption () const;
+
                                     /**
                                      * Exception
                                      */
@@ -374,6 +381,13 @@ class DataOutStack : public DataOutInterface<dim+1>
                                          * within each such data set.
                                          */
        vector<string> names;
+
+                                        /**
+                                         * Determine an estimate for
+                                         * the memory consumption (in
+                                         * bytes) of this object.
+                                         */
+       unsigned int memory_consumption () const;
     };
 
                                     /**
index 093588ae79a97208671d06d30a3b0d4947218931..6fbbf38342f5173ed18f6ef2d1e4245b00683683 100644 (file)
@@ -149,6 +149,13 @@ class Histogram
                                      */
     static IntervalSpacing parse_interval_spacing (const string &name);
     
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     */
+    unsigned int memory_consumption () const;
+
                                     /**
                                      * Exception.
                                      */
@@ -191,6 +198,13 @@ class Histogram
        Interval (const double left_point,
                  const double right_point);
 
+                                        /**
+                                         * Determine an estimate for the
+                                         * memory consumption (in bytes)
+                                         * of this object.
+                                         */
+       unsigned int memory_consumption () const;
+
                                         /**
                                          * Left bound of the interval.
                                          */
index 4aa3240009b5c23cd039c447fe91237d0968d7cd..90657955f0ca84cda93bee80ca1d8925365d1dcc 100644 (file)
@@ -20,6 +20,7 @@
 #include <lac/forward_declarations.h>
 #include <grid/forward_declarations.h>
 
+#include <base/smartpointer.h>
 #include <base/exceptions.h>
 #include <vector>
 
@@ -281,6 +282,13 @@ class SolutionTransfer
     void interpolate (const Vector<number> &in,
                      Vector<number>       &out) const;
 
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     */
+    unsigned int memory_consumption () const;
+
                                     /**
                                      * Exception
                                      */
@@ -325,7 +333,7 @@ class SolutionTransfer
                                      * Pointer to the degree of freedom handler
                                      * to work with.
                                      */
-    const DoFHandler<dim> *dof_handler;
+    SmartPointer<const DoFHandler<dim> > dof_handler;
     
                                     /**
                                      * Stores the number of DoFs before the
@@ -383,6 +391,8 @@ class SolutionTransfer
                                      * 'multiplied' by this structure.
                                      */
     struct Pointerstruct {
+       unsigned int memory_consumption () const;
+       
        vector<unsigned int>    *indices_ptr;
        vector<Vector<number> > *dof_values_ptr;
     };
index 49d505469735fa1336b1d4b1793a7385d3130ab1..ca343f45251c7874909478863bd9602d004442c5 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
+#include <base/smartpointer.h>
 #include <grid/forward_declarations.h>
 #include <lac/forward_declarations.h>
 
@@ -671,6 +672,13 @@ class TimeDependent
                                      */
     virtual void end_sweep (const unsigned int n_threads = 1);
 
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     */
+    unsigned int memory_consumption () const;
+    
                                     /**
                                      * Exception.
                                      */
@@ -974,6 +982,21 @@ class TimeStepBase : public Subscriptor
                                      */
     double get_forward_timestep () const;
     
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     *
+                                     * You will want to overload
+                                     * this function in derived
+                                     * classes to compute the
+                                     * amount memory used by the
+                                     * derived class, and add the
+                                     * result of this function to
+                                     * your result.
+                                     */
+    virtual unsigned int memory_consumption () const;
+
                                     /**
                                      * Exception
                                      */
@@ -1308,6 +1331,21 @@ class TimeStepBase_Tria :  public TimeStepBase
                                      */
     void save_refine_flags ();
 
+                                    /**
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
+                                     *
+                                     * You will want to overload
+                                     * this function in derived
+                                     * classes to compute the
+                                     * amount memory used by the
+                                     * derived class, and add the
+                                     * result of this function to
+                                     * your result.
+                                     */
+    virtual unsigned int memory_consumption () const;
+
                                     /**
                                      * Exception
                                      */
@@ -1338,8 +1376,9 @@ class TimeStepBase_Tria :  public TimeStepBase
                                      * is set through the
                                      * constructor; ownership remains
                                      * with the owner of this
-                                     * management object.  */
-    const Triangulation<dim> &coarse_grid;
+                                     * management object.
+                                     */
+    SmartPointer<const Triangulation<dim> > coarse_grid;
     
                                     /**
                                      * Some flags about how this time level
index 6db618835d9a1ab2ff2f4a8a52d73acc883817eb..2efc6113487cd59eac80a38ba3059f5f7f3fa481 100644 (file)
@@ -13,6 +13,7 @@
 
 
 #include <base/quadrature_lib.h>
+#include <base/memory_consumption.h>
 #include <lac/vector.h>
 #include <numerics/data_out.h>
 #include <grid/tria.h>
@@ -28,6 +29,7 @@
 
 #include <strstream>
 
+
 template <int dof_handler_dim, int patch_dim, int patch_space_dim>
 DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::DataEntry::
 DataEntry (const Vector<double> *data,
@@ -38,6 +40,20 @@ DataEntry (const Vector<double> *data,
 
 
 
+template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+unsigned int
+DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
+DataEntry::memory_consumption () const
+{
+  return (sizeof (data) +
+         MemoryConsumption::memory_consumption (names) +
+         MemoryConsumption::memory_consumption (units));
+};
+
+
+
+
+
 template <int dof_handler_dim, int patch_dim, int patch_space_dim>
 DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::DataOut_DoFData () :
                dofs(0)
@@ -229,6 +245,19 @@ DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::get_patches () const
 
 
 
+template <int dof_handler_dim, int patch_dim, int patch_space_dim>
+unsigned int
+DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::memory_consumption () const
+{
+  return (DataOutInterface<patch_dim,patch_space_dim>::memory_consumption () +
+         MemoryConsumption::memory_consumption (dofs) +
+         MemoryConsumption::memory_consumption (dof_data) +
+         MemoryConsumption::memory_consumption (cell_data) +
+         MemoryConsumption::memory_consumption (patches));
+};
+
+
+
 /* ---------------------------------------------------------------------- */
 
 
index dd155aa13eed589c58c5b43277a2df7ba91349ba..f3b3cbc2a5fa1118108a5a82141840b87c897d94 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <numerics/data_out_stack.h>
 #include <base/quadrature_lib.h>
+#include <base/memory_consumption.h>
 #include <lac/vector.h>
 #include <dofs/dof_handler.h>
 #include <dofs/dof_accessor.h>
 #include <fe/fe_values.h>
 
 
+
+template <int dim>
+unsigned int
+DataOutStack<dim>::DataVector::memory_consumption () const
+{
+  return (MemoryConsumption::memory_consumption (data) +
+         MemoryConsumption::memory_consumption (names));
+};
+
+
+
 template <int dim>
 DataOutStack<dim>::~DataOutStack ()
 {};
@@ -306,6 +318,22 @@ void DataOutStack<dim>::finish_parameter_value ()
 };
 
 
+
+template <int dim>
+unsigned int
+DataOutStack<dim>::memory_consumption () const
+{
+  return (DataOutInterface<dim+1>::memory_consumption () +
+         MemoryConsumption::memory_consumption (parameter) +
+         MemoryConsumption::memory_consumption (parameter_step) +
+         MemoryConsumption::memory_consumption (dof_handler) +
+         MemoryConsumption::memory_consumption (patches) +
+         MemoryConsumption::memory_consumption (dof_data) +
+         MemoryConsumption::memory_consumption (cell_data));
+};
+
+
+
 template <int dim>
 const vector<DataOutBase::Patch<dim+1> > &
 DataOutStack<dim>::get_patches () const
@@ -314,6 +342,7 @@ DataOutStack<dim>::get_patches () const
 };
 
 
+
 template <int dim>
 vector<string> DataOutStack<dim>::get_dataset_names () const
 {
index eac882012daf4027c0a2291fc8fa547838dae680..23821c2f0f5649ccf3a70c2d7ddc6fb47db0c115 100644 (file)
@@ -12,6 +12,7 @@
 //----------------------------  histogram.cc  ---------------------------
 
 
+#include <base/memory_consumption.h>
 #include <lac/vector.h>
 #include <numerics/histogram.h>
 #include <algorithm>
@@ -29,6 +30,7 @@ bool Histogram::logarithmic_less (const number n1,
 };
 
 
+
 Histogram::Interval::Interval (const double left_point,
                               const double right_point) :
                left_point (left_point),
@@ -37,6 +39,15 @@ Histogram::Interval::Interval (const double left_point,
 {};
 
 
+
+unsigned int
+Histogram::Interval::memory_consumption () const
+{
+  return sizeof(*this);
+};
+
+
+
 template <typename number>
 void Histogram::evaluate (const vector<Vector<number> > &values,
                          const vector<double>          &_y_values,
@@ -212,6 +223,7 @@ void Histogram::evaluate (const vector<Vector<number> > &values,
 };
 
 
+
 template <typename number>
 void Histogram::evaluate (const Vector<number>    &values,
                          const unsigned int       n_intervals,
@@ -223,6 +235,7 @@ void Histogram::evaluate (const Vector<number>    &values,
 };
 
 
+
 void Histogram::write_gnuplot (ostream &out) const
 {
   AssertThrow (out, ExcIO());
@@ -294,12 +307,14 @@ void Histogram::write_gnuplot (ostream &out) const
 };
 
 
+
 string Histogram::get_interval_spacing_names () 
 {
   return "linear|logarithmic";
 };
 
 
+
 Histogram::IntervalSpacing
 Histogram::parse_interval_spacing (const string &name)
 {
@@ -317,6 +332,16 @@ Histogram::parse_interval_spacing (const string &name)
 };
 
 
+
+unsigned int
+Histogram::memory_consumption () const
+{
+  return (MemoryConsumption::memory_consumption (intervals) +
+         MemoryConsumption::memory_consumption (y_values));
+};
+
+
+
 // explicit instantiations for float
 template
 void Histogram::evaluate (const vector<Vector<float> >  &values,
index c06003518e9003df08d8f4b4b92ec5845a8f4162..0f8930ab09d6322aa693f9710692ab2a0ef039a1 100644 (file)
@@ -12,6 +12,7 @@
 //----------------------------  solution_transfer.cc  ---------------------------
 
 
+#include <base/memory_consumption.h>
 #include <grid/tria.h>
 #include <dofs/dof_handler.h>
 #include <grid/tria_accessor.h>
@@ -352,6 +353,7 @@ interpolate (const vector<Vector<number> > &all_in,
 }
 
 
+
 template<int dim, typename number>
 void SolutionTransfer<dim, number>::interpolate(const Vector<number> &in,
                                                Vector<number>       &out) const
@@ -366,6 +368,30 @@ void SolutionTransfer<dim, number>::interpolate(const Vector<number> &in,
 }
 
 
+
+template<int dim, typename number>
+unsigned int
+SolutionTransfer<dim, number>::memory_consumption () const
+{
+  return (MemoryConsumption::memory_consumption (dof_handler) +
+         MemoryConsumption::memory_consumption (n_dofs_old) +
+         sizeof (prepared_for) +
+         MemoryConsumption::memory_consumption (indices_on_cell) +
+         MemoryConsumption::memory_consumption (all_pointerstructs) +
+         MemoryConsumption::memory_consumption (dof_values_on_cell));
+};
+
+
+
+template<int dim, typename number>
+unsigned int
+SolutionTransfer<dim, number>::Pointerstruct::memory_consumption () const
+{
+  return sizeof(*this);
+};
+
+
+
 template class SolutionTransfer<deal_II_dimension, float>;
 template class SolutionTransfer<deal_II_dimension, double>;
 
index b05e6b3781a0d3094bc5dcf5490109b128a257a6..ab3275fc885c5ae973bb097b809a16832d6324f3 100644 (file)
@@ -13,6 +13,7 @@
 
 
 #include <numerics/time_dependent.h>
+#include <base/memory_consumption.h>
 #include <grid/tria.h>
 #include <grid/tria_accessor.h>
 #include <grid/tria_iterator.h>
@@ -226,6 +227,7 @@ void TimeDependent::end_sweep (const unsigned int n_threads)
 }
 
 
+
 void TimeDependent::end_sweep (const unsigned int begin,
                               const unsigned int end)
 {     
@@ -234,6 +236,22 @@ void TimeDependent::end_sweep (const unsigned int begin,
 };
 
 
+
+unsigned int TimeDependent::memory_consumption () const
+{
+  unsigned int mem = (MemoryConsumption::memory_consumption (timesteps) +
+                     MemoryConsumption::memory_consumption (sweep_no) +
+                     sizeof(timestepping_data_primal) +
+                     sizeof(timestepping_data_dual) +
+                     sizeof(timestepping_data_postprocess));
+  for (unsigned int i=0; i<timesteps.size(); ++i)
+    mem += MemoryConsumption::memory_consumption (*timesteps[i]);
+
+  return mem;
+};
+
+
+
 /* --------------------------------------------------------------------- */
 
 
@@ -246,30 +264,36 @@ TimeStepBase::TimeStepBase (const double time) :
 {};
 
 
+
 TimeStepBase::~TimeStepBase () 
 {};
 
 
+
 void
 TimeStepBase::wake_up (const unsigned )
 {};
 
 
+
 void
 TimeStepBase::sleep (const unsigned)
 {};
 
 
+
 void
 TimeStepBase::start_sweep () 
 {};
 
 
+
 void
 TimeStepBase::end_sweep () 
 {};
 
 
+
 void
 TimeStepBase::init_for_primal_problem () 
 {
@@ -277,6 +301,7 @@ TimeStepBase::init_for_primal_problem ()
 };
 
 
+
 void
 TimeStepBase::init_for_dual_problem () 
 {
@@ -284,6 +309,7 @@ TimeStepBase::init_for_dual_problem ()
 };
 
 
+
 void
 TimeStepBase::init_for_postprocessing () 
 {
@@ -291,6 +317,7 @@ TimeStepBase::init_for_postprocessing ()
 };
 
 
+
 void
 TimeStepBase::solve_dual_problem () 
 {
@@ -298,6 +325,7 @@ TimeStepBase::solve_dual_problem ()
 };
 
 
+
 void
 TimeStepBase::postprocess_timestep () 
 {
@@ -305,6 +333,7 @@ TimeStepBase::postprocess_timestep ()
 };
 
 
+
 double
 TimeStepBase::get_time () const 
 {
@@ -312,6 +341,7 @@ TimeStepBase::get_time () const
 };
 
 
+
 unsigned int
 TimeStepBase::get_timestep_no () const 
 {
@@ -319,6 +349,7 @@ TimeStepBase::get_timestep_no () const
 };
 
 
+
 double
 TimeStepBase::get_backward_timestep () const
 {
@@ -327,6 +358,7 @@ TimeStepBase::get_backward_timestep () const
 };
 
 
+
 double
 TimeStepBase::get_forward_timestep () const
 {
@@ -335,6 +367,7 @@ TimeStepBase::get_forward_timestep () const
 };
 
 
+
 void
 TimeStepBase::set_previous_timestep (const TimeStepBase *previous)
 {
@@ -342,6 +375,7 @@ TimeStepBase::set_previous_timestep (const TimeStepBase *previous)
 };
 
 
+
 void
 TimeStepBase::set_next_timestep (const TimeStepBase *next)
 {
@@ -349,6 +383,7 @@ TimeStepBase::set_next_timestep (const TimeStepBase *next)
 };
 
 
+
 void
 TimeStepBase::set_timestep_no (const unsigned int step_no)
 {
@@ -356,6 +391,7 @@ TimeStepBase::set_timestep_no (const unsigned int step_no)
 };
 
 
+
 void
 TimeStepBase::set_sweep_no (const unsigned int sweep)
 {
@@ -363,6 +399,15 @@ TimeStepBase::set_sweep_no (const unsigned int sweep)
 };
 
 
+
+unsigned int
+TimeStepBase::memory_consumption () const
+{
+                                  // only simple data types
+  return sizeof(*this);
+};
+
+
 /* ------------------------------------------------------------------------- */
 
 
@@ -370,12 +415,13 @@ template <int dim>
 TimeStepBase_Tria<dim>::TimeStepBase_Tria() :
                TimeStepBase (0),
                tria (0),
-               coarse_grid (*reinterpret_cast<Triangulation<dim>*>(0))
+               coarse_grid (0)
 {
   Assert (false, ExcPureVirtualFunctionCalled());
 };
 
 
+
 template <int dim>
 TimeStepBase_Tria<dim>::TimeStepBase_Tria (const double              time,
                                           const Triangulation<dim> &coarse_grid,
@@ -383,12 +429,11 @@ TimeStepBase_Tria<dim>::TimeStepBase_Tria (const double              time,
                                           const RefinementFlags    &refinement_flags) :
                TimeStepBase (time),
                tria(0),
-               coarse_grid (coarse_grid),
+               coarse_grid (&coarse_grid),
                flags (flags),
                refinement_flags (refinement_flags)
-{
-  coarse_grid.subscribe();
-};
+{};
+
 
 
 template <int dim>
@@ -401,14 +446,16 @@ TimeStepBase_Tria<dim>::~TimeStepBase_Tria ()
     }
   else
     Assert (tria==0, ExcInternalError());
-
-  coarse_grid.unsubscribe();
+  
+  coarse_grid = 0;
 };
 
 
+
 template <int dim>
 void
-TimeStepBase_Tria<dim>::wake_up (const unsigned wakeup_level) {
+TimeStepBase_Tria<dim>::wake_up (const unsigned wakeup_level)
+{
   TimeStepBase::wake_up (wakeup_level);
   
   if (wakeup_level == flags.wakeup_level_to_build_grid)
@@ -417,6 +464,7 @@ TimeStepBase_Tria<dim>::wake_up (const unsigned wakeup_level) {
 };
 
 
+
 template <int dim>
 void
 TimeStepBase_Tria<dim>::sleep (const unsigned sleep_level)
@@ -437,6 +485,7 @@ TimeStepBase_Tria<dim>::sleep (const unsigned sleep_level)
 };
 
 
+
 template <int dim>
 void TimeStepBase_Tria<dim>::save_refine_flags ()
 {
@@ -449,8 +498,10 @@ void TimeStepBase_Tria<dim>::save_refine_flags ()
 };
 
 
+
 template <int dim>
-void TimeStepBase_Tria<dim>::restore_grid () {
+void TimeStepBase_Tria<dim>::restore_grid ()
+{
   Assert (tria == 0, ExcGridNotDeleted());
   Assert (refine_flags.size() == coarsen_flags.size(),
          ExcInternalError());
@@ -459,7 +510,7 @@ void TimeStepBase_Tria<dim>::restore_grid () {
                                   // set it to a copy of the coarse grid
   tria = new Triangulation<dim> ();
   tria->subscribe();
-  tria->copy_triangulation (coarse_grid);
+  tria->copy_triangulation (*coarse_grid);
 
                                   // for each of the previous refinement
                                   // sweeps
@@ -488,10 +539,12 @@ void TimeStepBase_Tria<dim>::restore_grid () {
 };
 
 
+
 template <int dim>
 static void
 mirror_refinement_flags (const Triangulation<dim>::cell_iterator &new_cell,
-                        const Triangulation<dim>::cell_iterator &old_cell) {
+                        const Triangulation<dim>::cell_iterator &old_cell)
+{
                                   // mirror the refinement
                                   // flags from the present time level to
                                   // the previous if the dual problem was
@@ -533,10 +586,12 @@ mirror_refinement_flags (const Triangulation<dim>::cell_iterator &new_cell,
 };
 
 
+
 template <int dim>
 static bool
 adapt_grids (const Triangulation<dim>::cell_iterator &cell1,
-            const Triangulation<dim>::cell_iterator &cell2) {
+            const Triangulation<dim>::cell_iterator &cell2)
+{
 
   if (cell2->has_children() && cell1->has_children()) 
     {
@@ -635,10 +690,12 @@ adapt_grids (const Triangulation<dim>::cell_iterator &cell1,
 };    
 
 
+
 template <int dim>
 static bool
 adapt_grids (Triangulation<dim> &tria1,
-            Triangulation<dim> &tria2) {
+            Triangulation<dim> &tria2)
+{
   bool grids_changed = false;
   
   Triangulation<dim>::cell_iterator cell1 = tria1.begin(),
@@ -654,6 +711,7 @@ adapt_grids (Triangulation<dim> &tria1,
 };
 
 
+
 template <int dim>
 void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
 {
@@ -1050,6 +1108,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
 };
 
 
+
 template <int dim>
 void TimeStepBase_Tria<dim>::init_for_refinement () 
 {
@@ -1057,12 +1116,29 @@ void TimeStepBase_Tria<dim>::init_for_refinement ()
 };
 
 
+
 template <int dim>
-TimeStepBase_Tria<dim>::Flags::Flags () {
+unsigned int
+TimeStepBase_Tria<dim>::memory_consumption () const
+{
+  return (TimeStepBase::memory_consumption () +
+         sizeof(tria) +
+         MemoryConsumption::memory_consumption (coarse_grid) +
+         sizeof(flags) + sizeof(refinement_flags) +
+         MemoryConsumption::memory_consumption (refine_flags) +
+         MemoryConsumption::memory_consumption (coarsen_flags));
+};
+
+
+
+template <int dim>
+TimeStepBase_Tria<dim>::Flags::Flags ()
+{
   Assert (false, ExcInternalError());
 };
 
 
+
 template <int dim>
 TimeStepBase_Tria<dim>::Flags::Flags (const bool delete_and_rebuild_tria,
                                      const unsigned int wakeup_level_to_build_grid,

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.