Reference documentation for deal.II version 8.5.1
mg_base.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__mg_base_h
17 #define dealii__mg_base_h
18 
19 /*
20  * This file contains some abstract base classes
21  * used by Multigrid.
22  */
23 
24 #include <deal.II/base/config.h>
25 #include <deal.II/base/subscriptor.h>
26 #include <deal.II/base/smartpointer.h>
27 #include <deal.II/lac/vector.h>
28 
29 
30 DEAL_II_NAMESPACE_OPEN
31 
34 
35 
46 template <typename VectorType>
47 class MGMatrixBase : public Subscriptor
48 {
49 public:
50  /*
51  * Virtual destructor.
52  */
53  virtual ~MGMatrixBase();
54 
58  virtual void vmult (const unsigned int level,
59  VectorType &dst,
60  const VectorType &src) const = 0;
61 
65  virtual void vmult_add (const unsigned int level,
66  VectorType &dst,
67  const VectorType &src) const = 0;
68 
72  virtual void Tvmult (const unsigned int level,
73  VectorType &dst,
74  const VectorType &src) const = 0;
75 
79  virtual void Tvmult_add (const unsigned int level,
80  VectorType &dst,
81  const VectorType &src) const = 0;
82 
86  virtual unsigned int get_minlevel() const = 0;
87 
91  virtual unsigned int get_maxlevel() const = 0;
92 };
93 
94 
102 template <typename VectorType>
104 {
105 public:
109  virtual ~MGCoarseGridBase ();
110 
114  virtual void operator() (const unsigned int level,
115  VectorType &dst,
116  const VectorType &src) const = 0;
117 };
118 
119 
167 template <typename VectorType>
169 {
170 public:
174  virtual ~MGTransferBase();
175 
186  virtual void prolongate (const unsigned int to_level,
187  VectorType &dst,
188  const VectorType &src) const = 0;
189 
205  virtual void restrict_and_add (const unsigned int from_level,
206  VectorType &dst,
207  const VectorType &src) const = 0;
208 };
209 
210 
211 
218 template <typename VectorType>
220 {
221 public:
225  virtual ~MGSmootherBase();
229  virtual void clear() = 0;
230 
234  virtual void smooth (const unsigned int level,
235  VectorType &u,
236  const VectorType &rhs) const = 0;
237 };
238 
241 DEAL_II_NAMESPACE_CLOSE
242 
243 #endif
virtual ~MGTransferBase()
Definition: mg_base.cc:32
virtual void prolongate(const unsigned int to_level, VectorType &dst, const VectorType &src) const =0
virtual void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void Tvmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void clear()=0
virtual void vmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual ~MGSmootherBase()
Definition: mg_base.cc:42
virtual void vmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void smooth(const unsigned int level, VectorType &u, const VectorType &rhs) const =0
virtual unsigned int get_maxlevel() const =0
virtual void Tvmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void restrict_and_add(const unsigned int from_level, VectorType &dst, const VectorType &src) const =0
virtual ~MGCoarseGridBase()
Definition: mg_base.cc:47
virtual unsigned int get_minlevel() const =0