From: Wolfgang Bangerth Date: Thu, 2 Apr 1998 14:59:26 +0000 (+0000) Subject: Support for MultipleParameterLoop objects. X-Git-Tag: v8.0.0~23133 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ff5feb1b740e2fec0270ad53ce85483017091ba;p=dealii.git Support for MultipleParameterLoop objects. git-svn-id: https://svn.dealii.org/trunk@121 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/base.h b/deal.II/deal.II/include/numerics/base.h index b7e0fa16a7..7f0422227a 100644 --- a/deal.II/deal.II/include/numerics/base.h +++ b/deal.II/deal.II/include/numerics/base.h @@ -232,6 +232,18 @@ class ProblemBase { void set_tria_and_dof (Triangulation *tria, DoFHandler *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 diff --git a/deal.II/deal.II/source/numerics/base.cc b/deal.II/deal.II/source/numerics/base.cc index 0b0b0b631c..46ea191420 100644 --- a/deal.II/deal.II/source/numerics/base.cc +++ b/deal.II/deal.II/source/numerics/base.cc @@ -48,6 +48,19 @@ void ProblemBase::set_tria_and_dof (Triangulation *t, +template +void ProblemBase::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 ProblemBase::~ProblemBase () {};