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 INCLUDE_POISSON_MULTIGRID_PRECONDITIONER_H_
23#define INCLUDE_POISSON_MULTIGRID_PRECONDITIONER_H_
24
25#include <exadg/operators/multigrid_operator.h>
26#include <exadg/poisson/spatial_discretization/laplace_operator.h>
27#include <exadg/solvers_and_preconditioners/multigrid/multigrid_preconditioner_base.h>
28
29namespace ExaDG
30{
31namespace Poisson
32{
33/*
34 * Multigrid preconditioner for Laplace operator.
35 */
36template<int dim, typename Number, int n_components>
38{
39private:
41
42public:
43 typedef typename Base::MultigridNumber MultigridNumber;
44
45private:
46 static unsigned int const rank =
47 (n_components == 1) ? 0 : ((n_components == dim) ? 1 : dealii::numbers::invalid_unsigned_int);
48
49 typedef typename Base::Map_DBC Map_DBC;
50 typedef typename Base::Map_DBC_ComponentMask Map_DBC_ComponentMask;
51 typedef typename Base::PeriodicFacePairs PeriodicFacePairs;
52
54
57
58public:
59 MultigridPreconditioner(MPI_Comm const & mpi_comm);
60
61 void
62 initialize(MultigridData const & mg_data,
63 std::shared_ptr<Grid<dim> const> grid,
64 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
65 dealii::FiniteElement<dim> const & fe,
67 bool const mesh_is_moving,
68 Map_DBC const & dirichlet_bc,
69 Map_DBC_ComponentMask const & dirichlet_bc_component_mask);
70
71 void
72 update() final;
73
74private:
75 void
76 fill_matrix_free_data(MatrixFreeData<dim, MultigridNumber> & matrix_free_data,
77 unsigned int const level,
78 unsigned int const dealii_triangulation_level) final;
79
80 std::shared_ptr<MGOperatorBase>
81 initialize_operator(unsigned int const level) final;
82
83 std::shared_ptr<Laplace>
84 get_operator(unsigned int level);
85
87
88 bool is_dg;
89
90 bool mesh_is_moving;
91};
92
93} // namespace Poisson
94} // namespace ExaDG
95
96#endif /* INCLUDE_POISSON_MULTIGRID_PRECONDITIONER_H_ */
Definition grid.h:40
Definition grid.h:84
Definition multigrid_operator_base.h:35
Definition multigrid_operator.h:31
Definition multigrid_preconditioner_base.h:62
Definition laplace_operator.h:229
Definition multigrid_preconditioner.h:38
Definition driver.cpp:33
Definition matrix_free_data.h:40
Definition multigrid_parameters.h:259
Definition laplace_operator.h:212