]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Support for MultipleParameterLoop objects.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 2 Apr 1998 14:59:26 +0000 (14:59 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 2 Apr 1998 14:59:26 +0000 (14:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@121 0785d39b-7218-0410-832d-ea1e28bc413d

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

index b7e0fa16a7842760c8bd8650a3431673c4986bd9..7f0422227a09c74816cda292650b1e4d965eecbd 100644 (file)
@@ -232,6 +232,18 @@ class ProblemBase {
     void set_tria_and_dof (Triangulation<dim> *tria,
                           DoFHandler<dim>    *dof_handler);
 
+                                    /**
+                                     * Reset all fields to a state as if we
+                                     * were right after calling the
+                                     * constructor. This is useful if you
+                                     * want to use an object derived from
+                                     * this base class for multiple
+                                     * successive calculations. In special,
+                                     * all aquired memory should be freed
+                                     * until it is needed again.
+                                     */
+    void clear ();
+    
                                     /**
                                      * Destructor. Declare this only to have
                                      * a virtual destructor, which is safer
index 0b0b0b631c83212d638f06471f5cc98df7e66f06..46ea191420145e2d378f0994c4244610d7d90d45 100644 (file)
@@ -48,6 +48,19 @@ void ProblemBase<dim>::set_tria_and_dof (Triangulation<dim> *t,
 
 
 
+template <int dim>
+void ProblemBase<dim>::clear () {
+  tria        = 0;
+  dof_handler = 0;
+  system_sparsity.reinit (1,1,1);
+  system_matrix.reinit (system_sparsity);
+  right_hand_side.reinit (1);
+  solution.reinit (1);
+  constraints.clear ();
+};
+
+
+
 template <int dim>
 ProblemBase<dim>::~ProblemBase () {};
 

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.