ExaDG
Loading...
Searching...
No Matches
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
30namespace ExaDG
31{
32namespace Poisson
33{
34/*
35 * Multigrid preconditioner for Laplace operator.
36 */
37template<int dim, typename Number, int n_components>
38class MultigridPreconditioner : public MultigridPreconditionerBase<dim, Number>
39{
40private:
41 typedef MultigridPreconditionerBase<dim, Number> Base;
42
43public:
44 typedef typename Base::MultigridNumber MultigridNumber;
45
46private:
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
55
58
59public:
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,
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
75private:
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) final;
83
84 std::shared_ptr<Laplace>
85 get_operator(unsigned int level);
86
88
89 bool is_dg;
90
91 bool mesh_is_moving;
92};
93
94} // namespace Poisson
95} // namespace ExaDG
96
97#endif /* EXADG_POISSON_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_H_ */
Definition grid.h:40
Definition grid.h:84
Definition multigrid_operator_base.h:36
Definition multigrid_operator.h:32
Definition laplace_operator.h:230
Definition driver.cpp:33
Definition matrix_free_data.h:40
Definition multigrid_parameters.h:259
Definition laplace_operator.h:213