Reference documentation for deal.II version Git ac854ef673 2021-03-06 10:09:45 +0100
\(\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 - 2018 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 
36 
37 
46 template <typename VectorType>
47 class MGMatrixBase : public Subscriptor
48 {
49 public:
50  /*
51  * Virtual destructor.
52  */
53  virtual ~MGMatrixBase() override = default;
54 
58  virtual void
59  vmult(const unsigned int level,
60  VectorType & dst,
61  const VectorType & src) const = 0;
62 
66  virtual void
67  vmult_add(const unsigned int level,
68  VectorType & dst,
69  const VectorType & src) const = 0;
70 
74  virtual void
75  Tvmult(const unsigned int level,
76  VectorType & dst,
77  const VectorType & src) const = 0;
78 
82  virtual void
83  Tvmult_add(const unsigned int level,
84  VectorType & dst,
85  const VectorType & src) const = 0;
86 
90  virtual unsigned int
91  get_minlevel() const = 0;
92 
96  virtual unsigned int
97  get_maxlevel() const = 0;
98 };
99 
100 
106 template <typename VectorType>
108 {
109 public:
113  virtual ~MGCoarseGridBase() override = default;
114 
118  virtual void
119  operator()(const unsigned int level,
120  VectorType & dst,
121  const VectorType & src) const = 0;
122 };
123 
124 
170 template <typename VectorType>
172 {
173 public:
177  virtual ~MGTransferBase() override = default;
178 
189  virtual void
190  prolongate(const unsigned int to_level,
191  VectorType & dst,
192  const VectorType & src) const = 0;
193 
204  virtual void
205  prolongate_and_add(const unsigned int to_level,
206  VectorType & dst,
207  const VectorType & src) const;
208 
223  virtual void
224  restrict_and_add(const unsigned int from_level,
225  VectorType & dst,
226  const VectorType & src) const = 0;
227 };
228 
229 
230 
250 template <typename VectorType>
252 {
253 public:
257  virtual ~MGSmootherBase() override = default;
258 
262  virtual void
263  clear() = 0;
264 
269  virtual void
270  smooth(const unsigned int level,
271  VectorType & u,
272  const VectorType & rhs) const = 0;
273 
292  virtual void
293  apply(const unsigned int level, VectorType &u, const VectorType &rhs) const;
294 };
295 
299 
300 #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
auto apply(F &&fn, Tuple &&t) -> decltype(apply_impl(std::forward< F >(fn), std::forward< Tuple >(t), std::make_index_sequence< std::tuple_size< typename std::remove_reference< Tuple >::type >::value >()))
Definition: tuple.h:36
virtual void vmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:394
unsigned int level
Definition: grid_out.cc:4578
virtual unsigned int get_maxlevel() const =0
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:393
virtual void Tvmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
virtual ~MGMatrixBase() override=default
virtual unsigned int get_minlevel() const =0