]> https://gitweb.dealii.org/ - dealii.git/commitdiff
access functions for levels
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 11 Mar 2005 00:46:47 +0000 (00:46 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 11 Mar 2005 00:46:47 +0000 (00:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@10091 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/multigrid.h
deal.II/deal.II/include/multigrid/multigrid.templates.h

index 0c439e753bebefddec7947a374d652ab66bb6700..64498b443f136f709bb7bdc386ba1128a23160e2 100644 (file)
@@ -163,6 +163,18 @@ class Multigrid : public Subscriptor
     void set_edge_matrices (const MGMatrixBase<VECTOR>& edge_down,
                            const MGMatrixBase<VECTOR>& 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 <tt>relative</tt> ist
+                                     * <tt>true</tt>, then this
+                                     * function determins the number
+                                     * of levels used, that is, it
+                                     * sets #minlevel to
+                                     * #maxlevel-<tt>level</tt>.
                                      */
-    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<VECTOR>::Multigrid (const MGDoFHandler<dim>& mg_dof_handler,
 {}
 
 
+
+template <class VECTOR>
+inline
+unsigned int
+Multigrid<VECTOR>::get_maxlevel () const
+{
+  return maxlevel;
+}
+
+
+
+template <class VECTOR>
+inline
+unsigned int
+Multigrid<VECTOR>::get_minlevel () const
+{
+  return minlevel;
+}
+
+
 /* --------------------------- inline functions --------------------- */
 
 
index 297c114a009c5f0bdd3c4251ca4b41cd40cae9f7..164e9001169e791e975ea04b3950caa830ae0ff7 100644 (file)
@@ -77,10 +77,13 @@ Multigrid<VECTOR>::set_maxlevel(unsigned int l)
 
 template <class VECTOR>
 void
-Multigrid<VECTOR>::set_minlevel(unsigned int l)
+Multigrid<VECTOR>::set_minlevel(unsigned int l,
+                               bool relative)
 {
   Assert (l <= maxlevel, ExcIndexRange(l,minlevel,maxlevel+1));
-  minlevel = l;
+  minlevel = (relative)
+            ? (maxlevel-l)
+            : l;
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.