Reference documentation for deal.II version 9.2.0
\(\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 
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 
293 
294 #endif
MGTransferBase
Definition: mg_base.h:177
MGMatrixBase
Definition: mg_base.h:49
VectorType
MGCoarseGridBase
Definition: mg_base.h:111
MGMatrixBase::get_maxlevel
virtual unsigned int get_maxlevel() const =0
MGMatrixBase::Tvmult_add
virtual void Tvmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
Subscriptor
Definition: subscriptor.h:62
MGMatrixBase::Tvmult
virtual void Tvmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
level
unsigned int level
Definition: grid_out.cc:4355
MGMatrixBase::vmult_add
virtual void vmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const =0
MGCoarseGridBase::operator()
virtual void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const =0
subscriptor.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
MGTransferBase::prolongate
virtual void prolongate(const unsigned int to_level, VectorType &dst, const VectorType &src) const =0
MGMatrixBase::vmult
virtual void vmult(const unsigned int level, VectorType &dst, const VectorType &src) const =0
MGSmootherBase
Definition: mg_base.h:245
smartpointer.h
MGSmootherBase::~MGSmootherBase
virtual ~MGSmootherBase() override=default
MGSmootherBase::apply
virtual void apply(const unsigned int level, VectorType &u, const VectorType &rhs) const
Definition: mg_base.cc:35
MGCoarseGridBase::~MGCoarseGridBase
virtual ~MGCoarseGridBase() override=default
MGMatrixBase::get_minlevel
virtual unsigned int get_minlevel() const =0
vector.h
MGTransferBase::~MGTransferBase
virtual ~MGTransferBase() override=default
MGTransferBase::restrict_and_add
virtual void restrict_and_add(const unsigned int from_level, VectorType &dst, const VectorType &src) const =0
MGMatrixBase::~MGMatrixBase
virtual ~MGMatrixBase() override=default
config.h
MGSmootherBase::smooth
virtual void smooth(const unsigned int level, VectorType &u, const VectorType &rhs) const =0
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
MGSmootherBase::clear
virtual void clear()=0