From 18085efb29115f019324a3fb18b17533916b84af Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 9 Apr 1999 14:37:49 +0000 Subject: [PATCH] Initial check-in with the framework of multigrid smoothers only. git-svn-id: https://svn.dealii.org/trunk@1112 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/multigrid/mg_smoother.h | 83 +++++++++++++++++++ .../deal.II/include/numerics/mg_smoother.h | 83 +++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 deal.II/deal.II/include/multigrid/mg_smoother.h create mode 100644 deal.II/deal.II/include/numerics/mg_smoother.h diff --git a/deal.II/deal.II/include/multigrid/mg_smoother.h b/deal.II/deal.II/include/multigrid/mg_smoother.h new file mode 100644 index 0000000000..1fc78c266f --- /dev/null +++ b/deal.II/deal.II/include/multigrid/mg_smoother.h @@ -0,0 +1,83 @@ +/*---------------------------- mg_smoother.h ---------------------------*/ +/* $Id$ */ +#ifndef __mg_smoother_H +#define __mg_smoother_H +/*---------------------------- mg_smoother.h ---------------------------*/ + + +/** + * Abstract base class for multigrid smoothers. It declares the interface + * to smoothers and implements some functionality for setting the values + * of vectors at interior boundaries (i.e. boundaries between differing + * levels of the triangulation) to zero, by building a list of these degrees + * of freedom's indices at construction time. + * + * @author Wolfgang Bangerth, Guido Kanschat, 1999 + */ +class MGSmoother : public Subcriptor +{ + private: + /** + * Default constructor. Made private + * to prevent it being called, which + * is necessary since this could + * circumpass the set-up of the list + * if interior boundary dofs. + */ + MGSmoother (); + + public: + + /** + * Constructor. This one sets clobbers + * the indices of the degrees of freedom + * on the interior boundaries between + * the different levels, which are + * needed by the function + * #set_zero_interior_boundaries#. + */ + template + MGSmoother (const MGDoFHandler &mg_dof); + + /** + * Smooth the vector #u# on the given + * level. This function should set the + * interior boundary values of u to zero + * at the end of its work, so you may want + * to call #set_zero_interior_boundary# + * at the end of your derived function, + * or another function doing similar + * things. + */ + virtual void smooth (const unsigned int level, + vector &u) const = 0; + + /** + * Reset the values of the degrees of + * freedom on interior boundaries between + * different levels to zero in the given + * data vector #u#. + */ + void set_zero_interior_boundary (const unsigned int level, + vector &u) const; + + private: + /** + * For each level, we store a list of + * degree of freedom indices which are + * located on interior boundaries between + * differing levels of the triangulation. + * + * These arrays are set by the constructor. + */ + vector > interior_boundary_dofs; +}; + + + + +/*---------------------------- mg_smoother.h ---------------------------*/ +/* end of #ifndef __mg_smoother_H */ +#endif +/*---------------------------- mg_smoother.h ---------------------------*/ + diff --git a/deal.II/deal.II/include/numerics/mg_smoother.h b/deal.II/deal.II/include/numerics/mg_smoother.h new file mode 100644 index 0000000000..1fc78c266f --- /dev/null +++ b/deal.II/deal.II/include/numerics/mg_smoother.h @@ -0,0 +1,83 @@ +/*---------------------------- mg_smoother.h ---------------------------*/ +/* $Id$ */ +#ifndef __mg_smoother_H +#define __mg_smoother_H +/*---------------------------- mg_smoother.h ---------------------------*/ + + +/** + * Abstract base class for multigrid smoothers. It declares the interface + * to smoothers and implements some functionality for setting the values + * of vectors at interior boundaries (i.e. boundaries between differing + * levels of the triangulation) to zero, by building a list of these degrees + * of freedom's indices at construction time. + * + * @author Wolfgang Bangerth, Guido Kanschat, 1999 + */ +class MGSmoother : public Subcriptor +{ + private: + /** + * Default constructor. Made private + * to prevent it being called, which + * is necessary since this could + * circumpass the set-up of the list + * if interior boundary dofs. + */ + MGSmoother (); + + public: + + /** + * Constructor. This one sets clobbers + * the indices of the degrees of freedom + * on the interior boundaries between + * the different levels, which are + * needed by the function + * #set_zero_interior_boundaries#. + */ + template + MGSmoother (const MGDoFHandler &mg_dof); + + /** + * Smooth the vector #u# on the given + * level. This function should set the + * interior boundary values of u to zero + * at the end of its work, so you may want + * to call #set_zero_interior_boundary# + * at the end of your derived function, + * or another function doing similar + * things. + */ + virtual void smooth (const unsigned int level, + vector &u) const = 0; + + /** + * Reset the values of the degrees of + * freedom on interior boundaries between + * different levels to zero in the given + * data vector #u#. + */ + void set_zero_interior_boundary (const unsigned int level, + vector &u) const; + + private: + /** + * For each level, we store a list of + * degree of freedom indices which are + * located on interior boundaries between + * differing levels of the triangulation. + * + * These arrays are set by the constructor. + */ + vector > interior_boundary_dofs; +}; + + + + +/*---------------------------- mg_smoother.h ---------------------------*/ +/* end of #ifndef __mg_smoother_H */ +#endif +/*---------------------------- mg_smoother.h ---------------------------*/ + -- 2.39.5