deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+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: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 1999 - 2025 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_mg_base_h
14#define dealii_mg_base_h
15
16/*
17 * This file contains some abstract base classes
18 * used by Multigrid.
19 */
20
21#include <deal.II/base/config.h>
22
25
26#include <deal.II/lac/vector.h>
27
28
30
44template <typename VectorType>
46{
47public:
48 /*
49 * Virtual destructor.
50 */
51 virtual ~MGMatrixBase() override = default;
52
56 virtual void
57 vmult(const unsigned int level,
58 VectorType &dst,
59 const VectorType &src) const = 0;
60
64 virtual void
65 vmult_add(const unsigned int level,
66 VectorType &dst,
67 const VectorType &src) const = 0;
68
72 virtual void
73 Tvmult(const unsigned int level,
74 VectorType &dst,
75 const VectorType &src) const = 0;
76
80 virtual void
81 Tvmult_add(const unsigned int level,
82 VectorType &dst,
83 const VectorType &src) const = 0;
84
88 virtual unsigned int
89 get_minlevel() const = 0;
90
94 virtual unsigned int
95 get_maxlevel() const = 0;
96};
97
98
104template <typename VectorType>
106{
107public:
111 virtual ~MGCoarseGridBase() override = default;
112
116 virtual void
117 operator()(const unsigned int level,
118 VectorType &dst,
119 const VectorType &src) const = 0;
120};
121
122
168template <typename VectorType>
170{
171public:
175 virtual ~MGTransferBase() override = default;
176
187 virtual void
188 prolongate(const unsigned int to_level,
189 VectorType &dst,
190 const VectorType &src) const = 0;
191
202 virtual void
203 prolongate_and_add(const unsigned int to_level,
204 VectorType &dst,
205 const VectorType &src) const;
206
221 virtual void
222 restrict_and_add(const unsigned int from_level,
223 VectorType &dst,
224 const VectorType &src) const = 0;
225};
226
227
228
248template <typename VectorType>
250{
251public:
255 virtual ~MGSmootherBase() override = default;
256
260 virtual void
261 clear() = 0;
262
267 virtual void
268 smooth(const unsigned int level,
269 VectorType &u,
270 const VectorType &rhs) const = 0;
271
290 virtual void
291 apply(const unsigned int level, VectorType &u, const VectorType &rhs) const;
292};
293
297
298#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
virtual void clear()=0
virtual void prolongate_and_add(const unsigned int to_level, VectorType &dst, const VectorType &src) const
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:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
unsigned int level
Definition grid_out.cc:4642