From: kanschat Date: Wed, 28 Sep 2011 05:10:06 +0000 (+0000) Subject: allow flexible levels X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68f8e4e6c4f4e859cb44368e120a9e73aa4855e0;p=dealii-svn.git allow flexible levels git-svn-id: https://svn.dealii.org/trunk@24455 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/multigrid/mg_smoother.h b/deal.II/include/deal.II/multigrid/mg_smoother.h index a01ae3d75f..6bec9ed8f0 100644 --- a/deal.II/include/deal.II/multigrid/mg_smoother.h +++ b/deal.II/include/deal.II/multigrid/mg_smoother.h @@ -257,7 +257,20 @@ class SmootherRelaxation : public MGLevelObject, public MGSmoother void initialize (const MGLevelObject& matrices, const typename RELAX::AdditionalData & additional_data = typename RELAX::AdditionalData()); - + + /** + * Initialize matrices and + * additional data for each + * level. + * + * If minimal or maximal level of + * the two objects differ, the + * greatest common range is + * utilized. This way, smoothing + * can be restricted to certain + * levels even if the matrix was + * generated for all levels. + */ template void initialize (const MGLevelObject& matrices, const MGLevelObject& additional_data); @@ -785,13 +798,8 @@ namespace mg const MGLevelObject& m, const MGLevelObject& data) { - const unsigned int min = m.get_minlevel(); - const unsigned int max = m.get_maxlevel(); - - Assert (data.get_minlevel() == min, - ExcDimensionMismatch(data.get_minlevel(), min)); - Assert (data.get_maxlevel() == max, - ExcDimensionMismatch(data.get_maxlevel(), max)); + const unsigned int min = std::max(m.get_minlevel(), data.get_minlevel()); + const unsigned int max = std::min(m.get_maxlevel(), data.get_maxlevel()); this->resize(min, max);