ExaDG
Toggle main menu visibility
Loading...
Searching...
No Matches
include
exadg
poisson
preconditioners
multigrid_preconditioner.h
1
/* ______________________________________________________________________
2
*
3
* ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4
*
5
* Copyright (C) 2021 by the ExaDG authors
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19
* ______________________________________________________________________
20
*/
21
22
#ifndef EXADG_POISSON_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_H_
23
#define EXADG_POISSON_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_H_
24
25
// ExaDG
26
#include <exadg/operators/multigrid_operator.h>
27
#include <exadg/poisson/spatial_discretization/laplace_operator.h>
28
#include <exadg/solvers_and_preconditioners/multigrid/multigrid_preconditioner_base.h>
29
30
namespace
ExaDG
31
{
32
namespace
Poisson
33
{
34
/*
35
* Multigrid preconditioner for Laplace operator.
36
*/
37
template
<
int
dim,
typename
Number,
int
n_components>
38
class
MultigridPreconditioner :
public
MultigridPreconditionerBase<dim, Number>
39
{
40
private
:
41
typedef
MultigridPreconditionerBase<dim, Number> Base;
42
43
public
:
44
typedef
typename
Base::MultigridNumber MultigridNumber;
45
46
private
:
47
static
unsigned
int
const
rank =
48
(n_components == 1) ? 0 : ((n_components == dim) ? 1 : dealii::numbers::invalid_unsigned_int);
49
50
typedef
typename
Base::Map_DBC Map_DBC;
51
typedef
typename
Base::Map_DBC_ComponentMask Map_DBC_ComponentMask;
52
typedef
typename
Base::PeriodicFacePairs PeriodicFacePairs;
53
54
typedef
LaplaceOperator<dim, MultigridNumber, n_components>
Laplace;
55
56
typedef
MultigridOperatorBase<dim, MultigridNumber>
MGOperatorBase;
57
typedef
MultigridOperator<dim, MultigridNumber, Laplace>
MGOperator;
58
59
public
:
60
MultigridPreconditioner(MPI_Comm
const
& mpi_comm);
61
62
void
63
initialize(
MultigridData
const
& mg_data,
64
std::shared_ptr<
Grid<dim>
const
> grid,
65
std::shared_ptr<
MultigridMappings<dim, Number>
>
const
multigrid_mappings,
66
dealii::FiniteElement<dim>
const
& fe,
67
LaplaceOperatorData<rank, dim>
const
& data,
68
bool
const
mesh_is_moving,
69
Map_DBC
const
& dirichlet_bc,
70
Map_DBC_ComponentMask
const
& dirichlet_bc_component_mask);
71
72
void
73
update()
final
;
74
75
private
:
76
void
77
fill_matrix_free_data(
MatrixFreeData<dim, MultigridNumber>
& matrix_free_data,
78
unsigned
int
const
level,
79
unsigned
int
const
dealii_triangulation_level)
final
;
80
81
std::shared_ptr<MGOperatorBase>
82
initialize_operator(
unsigned
int
const
level,
83
bool
const
use_matrix_based_operator_level,
84
bool
const
assemble_matrix)
final
;
85
86
std::shared_ptr<Laplace>
87
get_operator(
unsigned
int
level);
88
89
LaplaceOperatorData<rank, dim>
data;
90
91
bool
is_dg;
92
93
bool
mesh_is_moving;
94
};
95
96
}
// namespace Poisson
97
}
// namespace ExaDG
98
99
#endif
/* EXADG_POISSON_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_H_ */
ExaDG::Grid
Definition
grid.h:40
ExaDG::MultigridMappings
Definition
grid.h:84
ExaDG::MultigridOperatorBase
Definition
multigrid_operator_base.h:36
ExaDG::MultigridOperator
Definition
multigrid_operator.h:32
ExaDG::Poisson::LaplaceOperator
Definition
laplace_operator.h:230
ExaDG
Definition
driver.cpp:33
ExaDG::MatrixFreeData
Definition
matrix_free_data.h:40
ExaDG::MultigridData
Definition
multigrid_parameters.h:259
ExaDG::Poisson::LaplaceOperatorData
Definition
laplace_operator.h:213
Generated by
1.17.0