Reference documentation for deal.II version 9.1.0-pre
mg_base.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2017 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.md at
12 // the top level directory of deal.II.
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 
26 #include <deal.II/base/smartpointer.h>
27 #include <deal.II/base/subscriptor.h>
28 
29 #include <deal.II/lac/vector.h>
30 
31 
32 DEAL_II_NAMESPACE_OPEN
33 
36 
37 
48 template <typename VectorType>
49 class MGMatrixBase : public Subscriptor
50 {
51 public:
52  /*
53  * Virtual destructor.
54  */
55  virtual ~MGMatrixBase() override = default;
56 
60  virtual void
61  vmult(const unsigned int level,
62  VectorType & dst,
63  const VectorType & src) const = 0;
64 
68  virtual void
69  vmult_add(const unsigned int level,
70  VectorType & dst,
71  const VectorType & src) const = 0;
72 
76  virtual void
77  Tvmult(const unsigned int level,
78  VectorType & dst,
79  const VectorType & src) const = 0;
80 
84  virtual void
85  Tvmult_add(const unsigned int level,
86  VectorType & dst,
87  const VectorType & src) const = 0;
88 
92  virtual unsigned int
93  get_minlevel() const = 0;
94 
98  virtual unsigned int
99  get_maxlevel() const = 0;
100 };
101 
102 
110 template <typename VectorType>
112 {
113 public:
117  virtual ~MGCoarseGridBase() override = default;
118 
122  virtual void
123  operator()(const unsigned int level,
124  VectorType & dst,
125  const VectorType & src) const = 0;
126 };
127 
128 
176 template <typename VectorType>
178 {
179 public:
183  virtual ~MGTransferBase() override = default;
184 
195  virtual void
196  prolongate(const unsigned int to_level,
197  VectorType & dst,
198  const VectorType & src) const = 0;
199 
215  virtual void
216  restrict_and_add(const unsigned int from_level,
217  VectorType & dst,
218  const VectorType & src) const = 0;
219 };
220 
221 
222 
244 template <typename VectorType>
246 {
247 public:
251  virtual ~MGSmootherBase() override = default;
252 
256  virtual void
257  clear() = 0;
258 
263  virtual void
264  smooth(const unsigned int level,
265  VectorType & u,
266  const VectorType & rhs) const = 0;
267 
286  virtual void
287  apply(const unsigned int level, VectorType &u, const VectorType &rhs) const;
288 };
289 
292 DEAL_II_NAMESPACE_CLOSE
293 
294 #endif
virtual void Tvmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void vmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual void vmult_add(const unsigned int level, VectorType &dst, const VectorType &src) 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 unsigned int get_minlevel() const =0