Reference documentation for deal.II version 9.4.1
\(\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\}}\)
Loading...
Searching...
No Matches
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
36
37
46template <typename VectorType>
48{
49public:
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
106template <typename VectorType>
108{
109public:
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
170template <typename VectorType>
172{
173public:
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
250template <typename VectorType>
252{
253public:
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 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:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
unsigned int level
Definition: grid_out.cc:4606