From 045d27edda4528634026086ad29b07f1ec956c5e Mon Sep 17 00:00:00 2001 From: hartmann Date: Tue, 17 Dec 2002 11:08:13 +0000 Subject: [PATCH] New reinit function. git-svn-id: https://svn.dealii.org/trunk@6838 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/multigrid/multigrid.h | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/deal.II/deal.II/include/multigrid/multigrid.h b/deal.II/deal.II/include/multigrid/multigrid.h index 9acfc3b422..a838431984 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.h +++ b/deal.II/deal.II/include/multigrid/multigrid.h @@ -59,7 +59,7 @@ * returning the solution to the system @p{Ax=b} on the coarsest level * in @p{x}. * - * @author Guido Kanschat, 1999, 2001, 2002 + * @author Guido Kanschat, 1999, 2001, 2002, Ralf Hartmann 2002 */ template class Multigrid : public Subscriptor @@ -99,7 +99,14 @@ class Multigrid : public Subscriptor const MGSmoother& post_smooth, const unsigned int minlevel = 0, const unsigned int maxlevel = 1000000); - + + + /** + * Reinit this class according to + * @p{minlevel} and @p{maxlevel}. + */ + void reinit (const unsigned int minlevel, + const unsigned int maxlevel); /** * Execute one step of the @@ -333,10 +340,22 @@ Multigrid::Multigrid (const MGDoFHandler& mg_dof_handler, post_smooth(&post_smooth), edge_down(0), edge_up(0) -{ -}; +{} +template +void +Multigrid::reinit(const unsigned int min_level, + const unsigned int max_level) +{ + minlevel=min_level; + maxlevel=max_level; + defect.resize(minlevel, maxlevel); + solution.resize(minlevel, maxlevel); + t.resize(minlevel, maxlevel); +} + + /* --------------------------- inline functions --------------------- */ -- 2.39.5