Reference documentation for deal.II version Git 040c6ad7d4 2020-09-26 18:01:03 +0200
\(\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 
208  virtual void
209  restrict_and_add(const unsigned int from_level,
210  VectorType & dst,
211  const VectorType & src) const = 0;
212 };
213 
214 
215 
235 template <typename VectorType>
237 {
238 public:
242  virtual ~MGSmootherBase() override = default;
243 
247  virtual void
248  clear() = 0;
249 
254  virtual void
255  smooth(const unsigned int level,
256  VectorType & u,
257  const VectorType & rhs) const = 0;
258 
277  virtual void
278  apply(const unsigned int level, VectorType &u, const VectorType &rhs) const;
279 };
280 
284 
285 #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:363
unsigned int level
Definition: grid_out.cc:4338
virtual unsigned int get_maxlevel() const =0
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362
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