From: Guido Kanschat Date: Fri, 11 Mar 2005 00:46:47 +0000 (+0000) Subject: access functions for levels X-Git-Tag: v8.0.0~14442 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dcc54693a1001978dcd55f09fbf69016a0f653c;p=dealii.git access functions for levels git-svn-id: https://svn.dealii.org/trunk@10091 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/multigrid/multigrid.h b/deal.II/deal.II/include/multigrid/multigrid.h index 0c439e753b..64498b443f 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.h +++ b/deal.II/deal.II/include/multigrid/multigrid.h @@ -163,6 +163,18 @@ class Multigrid : public Subscriptor void set_edge_matrices (const MGMatrixBase& edge_down, const MGMatrixBase& edge_up); + /** + * Return the finest level for + * multigrid. + */ + unsigned int get_maxlevel() const; + + /** + * Return the coarsest level for + * multigrid. + */ + unsigned int get_minlevel() const; + /** * Set the highest level for * which the multilevel method is @@ -182,10 +194,18 @@ class Multigrid : public Subscriptor * the multilevel method is * performed. By default, this is * zero. Accepted are - * non-negative values smaller + * non-negative values not larger than * than the current #maxlevel. + * + * If relative ist + * true, then this + * function determins the number + * of levels used, that is, it + * sets #minlevel to + * #maxlevel-level. */ - void set_minlevel(unsigned int); + void set_minlevel(unsigned int level, + bool relative = false); /** * Chance #cycle_type used in cycle(). @@ -442,6 +462,26 @@ Multigrid::Multigrid (const MGDoFHandler& mg_dof_handler, {} + +template +inline +unsigned int +Multigrid::get_maxlevel () const +{ + return maxlevel; +} + + + +template +inline +unsigned int +Multigrid::get_minlevel () const +{ + return minlevel; +} + + /* --------------------------- inline functions --------------------- */ diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index 297c114a00..164e900116 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -77,10 +77,13 @@ Multigrid::set_maxlevel(unsigned int l) template void -Multigrid::set_minlevel(unsigned int l) +Multigrid::set_minlevel(unsigned int l, + bool relative) { Assert (l <= maxlevel, ExcIndexRange(l,minlevel,maxlevel+1)); - minlevel = l; + minlevel = (relative) + ? (maxlevel-l) + : l; }