Reference documentation for deal.II version GIT a189bc2bdf 2022-12-07 02:45:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
mg_base.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2021 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 
28 
29 #include <deal.II/lac/vector.h>
30 
31 
33 
47 template <typename VectorType>
48 class MGMatrixBase : public Subscriptor
49 {
50 public:
51  /*
52  * Virtual destructor.
53  */
54  virtual ~MGMatrixBase() override = default;
55 
59  virtual void
60  vmult(const unsigned int level,
61  VectorType & dst,
62  const VectorType & src) const = 0;
63 
67  virtual void
68  vmult_add(const unsigned int level,
69  VectorType & dst,
70  const VectorType & src) const = 0;
71 
75  virtual void
76  Tvmult(const unsigned int level,
77  VectorType & dst,
78  const VectorType & src) const = 0;
79 
83  virtual void
84  Tvmult_add(const unsigned int level,
85  VectorType & dst,
86  const VectorType & src) const = 0;
87 
91  virtual unsigned int
92  get_minlevel() const = 0;
93 
97  virtual unsigned int
98  get_maxlevel() const = 0;
99 };
100 
101 
107 template <typename VectorType>
109 {
110 public:
114  virtual ~MGCoarseGridBase() override = default;
115 
119  virtual void
120  operator()(const unsigned int level,
121  VectorType & dst,
122  const VectorType & src) const = 0;
123 };
124 
125 
171 template <typename VectorType>
173 {
174 public:
178  virtual ~MGTransferBase() override = default;
179 
190  virtual void
191  prolongate(const unsigned int to_level,
192  VectorType & dst,
193  const VectorType & src) const = 0;
194 
205  virtual void
206  prolongate_and_add(const unsigned int to_level,
207  VectorType & dst,
208  const VectorType & src) const;
209 
224  virtual void
225  restrict_and_add(const unsigned int from_level,
226  VectorType & dst,
227  const VectorType & src) const = 0;
228 };
229 
230 
231 
251 template <typename VectorType>
253 {
254 public:
258  virtual ~MGSmootherBase() override = default;
259 
263  virtual void
264  clear() = 0;
265 
270  virtual void
271  smooth(const unsigned int level,
272  VectorType & u,
273  const VectorType & rhs) const = 0;
274 
293  virtual void
294  apply(const unsigned int level, VectorType &u, const VectorType &rhs) const;
295 };
296 
300 
301 #endif
virtual void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual ~MGCoarseGridBase() override=default
virtual void vmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual unsigned int get_maxlevel() const =0
virtual void vmult(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 unsigned int get_minlevel() const =0
virtual void Tvmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual ~MGMatrixBase() override=default
virtual void smooth(const unsigned int level, VectorType &u, const VectorType &rhs) const =0
virtual ~MGSmootherBase() override=default
virtual void apply(const unsigned int level, VectorType &u, const VectorType &rhs) const
Definition: mg_base.cc:35
virtual void clear()=0
virtual void prolongate_and_add(const unsigned int to_level, VectorType &dst, const VectorType &src) const
Definition: mg_base.cc:47
virtual ~MGTransferBase() override=default
virtual void restrict_and_add(const unsigned int from_level, VectorType &dst, const VectorType &src) const =0
virtual void prolongate(const unsigned int to_level, VectorType &dst, const VectorType &src) const =0
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:458
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:459
unsigned int level
Definition: grid_out.cc:4608