Reference documentation for deal.II version GIT relicensing-136-gb80d0be4af 2024-03-18 08:20: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\}}\)
Loading...
Searching...
No Matches
mg_base.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 1999 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_mg_base_h
16#define dealii_mg_base_h
17
18/*
19 * This file contains some abstract base classes
20 * used by Multigrid.
21 */
22
23#include <deal.II/base/config.h>
24
27
28#include <deal.II/lac/vector.h>
29
30
32
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:33
virtual void clear()=0
virtual void prolongate_and_add(const unsigned int to_level, VectorType &dst, const VectorType &src) const
Definition mg_base.cc:45
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:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
unsigned int level
Definition grid_out.cc:4616