From: hartmann Date: Tue, 11 Feb 2003 14:58:22 +0000 (+0000) Subject: Move the MGLevelObject class from mg_base.h to separate mg_level_object.h file. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cf99615c67f9e4846681f961a2dbddbcef9ea97;p=dealii-svn.git Move the MGLevelObject class from mg_base.h to separate mg_level_object.h file. git-svn-id: https://svn.dealii.org/trunk@7078 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/multigrid/mg_base.h b/deal.II/deal.II/include/multigrid/mg_base.h index 9322e39d45..d536b4d30b 100644 --- a/deal.II/deal.II/include/multigrid/mg_base.h +++ b/deal.II/deal.II/include/multigrid/mg_base.h @@ -25,85 +25,6 @@ #include -/** - * An array with an object for each level. The purpose of this class - * is mostly to allow access by level number, even if the lower levels - * are not used and therefore have no object at all; this is done by - * simply shifting the given index by the minimum level we have - * stored. - * - * In most cases, the objects which are stored on each levels, are - * either matrices or vectors. - * - * @author Wolfgang Bangerth, Guido Kanschat, 1999 - */ -template -class MGLevelObject : public Subscriptor -{ - public: - /** - * Constructor allowing to - * initialize the number of - * levels. By default, the object - * is created empty. - */ - MGLevelObject (const unsigned int minlevel = 0, - const unsigned int maxlevel = 0); - - /** - * Access object on level @p{level}. - */ - Object & operator[] (const unsigned int level); - - /** - * Access object on level - * @p{level}. Constant version. - */ - const Object & operator[] (const unsigned int level) const; - - /** - * Delete all previous contents - * of this object and reset its - * size according to the values - * of @p{new_minlevel} and - * @p{new_maxlevel}. - */ - void resize (const unsigned int new_minlevel, - const unsigned int new_maxlevel); - - /** - * Call @p{clear} on all objects - * stored by this object. This - * function is only implemented - * for some @p{Object} classes, - * most notably for vectors and - * matrices. Note that if - * @p{Object==Vector}, @p{clear} - * will set all entries to zero, - * while if - * @p{Object==vector}, - * @p{clear} deletes the elements - * of the vectors. This class - * might therefore not be useful - * for STL vectors. - */ - void clear(); - - ////// - unsigned int get_minlevel () const; - unsigned int get_maxlevel () const; - - private: - /** - * Level of first component. - */ - unsigned int minlevel; - - /** - * Array of the objects to be held. - */ - std::vector objects; -}; /** @@ -276,76 +197,6 @@ class MGSmootherBase : public Subscriptor }; -/* ------------------------------------------------------------------- */ - - -template -MGLevelObject::MGLevelObject(const unsigned int min, - const unsigned int max) - : - minlevel(0) -{ - resize (min, max); -} - - -template -Object & -MGLevelObject::operator[] (const unsigned int i) -{ - Assert((i>=minlevel) && (i -const Object & -MGLevelObject::operator[] (const unsigned int i) const -{ - Assert((i>=minlevel) && (i -void -MGLevelObject::resize (const unsigned int new_minlevel, - const unsigned int new_maxlevel) -{ - Assert (new_minlevel <= new_maxlevel, ExcInternalError()); - objects.clear (); - - minlevel = new_minlevel; - objects.resize (new_maxlevel - new_minlevel + 1); -} - - -template -void -MGLevelObject::clear () -{ - typename std::vector::iterator v; - for (v = objects.begin(); v != objects.end(); ++v) - v->clear(); -} - - -template -unsigned int -MGLevelObject::get_minlevel () const -{ - return minlevel; -} - - -template -unsigned int -MGLevelObject::get_maxlevel () const -{ - return minlevel + objects.size() - 1; -} /*---------------------------- mgbase.h ---------------------------*/ diff --git a/deal.II/deal.II/include/multigrid/mg_smoother.h b/deal.II/deal.II/include/multigrid/mg_smoother.h index 813dcdb565..0f890c6821 100644 --- a/deal.II/deal.II/include/multigrid/mg_smoother.h +++ b/deal.II/deal.II/include/multigrid/mg_smoother.h @@ -18,6 +18,7 @@ #include #include #include +#include #include template class MGDoFHandler; diff --git a/deal.II/deal.II/include/multigrid/mg_transfer.h b/deal.II/deal.II/include/multigrid/mg_transfer.h index a7cd15ca81..1b234e5906 100644 --- a/deal.II/deal.II/include/multigrid/mg_transfer.h +++ b/deal.II/deal.II/include/multigrid/mg_transfer.h @@ -18,6 +18,7 @@ #include #include #include +#include template class MGDoFHandler; diff --git a/deal.II/deal.II/include/multigrid/multigrid.h b/deal.II/deal.II/include/multigrid/multigrid.h index 4b2e4ee699..d9127dceeb 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.h +++ b/deal.II/deal.II/include/multigrid/multigrid.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc index 8d3e0105bf..28bf830e96 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_tools.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_tools.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -356,7 +357,7 @@ MGTools::count_dofs_per_component (const MGDoFHandler& dof_handler, template void MGTools::reinit_vector (const MGDoFHandler& mg_dof, - MGLevelObject >& v) + MGLevelObject >& v) { for (unsigned int level=v.get_minlevel(); level<=v.get_maxlevel();++level)