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_CONVECTION_DIFFUSION_MULTIGRID_PRECONDITIONER_H_
23#define INCLUDE_CONVECTION_DIFFUSION_MULTIGRID_PRECONDITIONER_H_
24
25#include <exadg/convection_diffusion/spatial_discretization/operators/combined_operator.h>
26#include <exadg/operators/multigrid_operator.h>
27#include <exadg/solvers_and_preconditioners/multigrid/multigrid_preconditioner_base.h>
28
29namespace ExaDG
30{
31namespace ConvDiff
32{
33/*
34 * Multigrid preconditioner for scalar convection-diffusion equation.
35 */
36template<int dim, typename Number>
38{
39private:
41
42public:
43 typedef typename Base::MultigridNumber MultigridNumber;
44
45private:
48
51
52 typedef typename Base::Map_DBC Map_DBC;
53 typedef typename Base::Map_DBC_ComponentMask Map_DBC_ComponentMask;
54 typedef typename Base::PeriodicFacePairs PeriodicFacePairs;
55 typedef typename Base::VectorType VectorType;
56 typedef typename Base::VectorTypeMG VectorTypeMG;
57
58public:
59 MultigridPreconditioner(MPI_Comm const & mpi_comm);
60
61 virtual ~MultigridPreconditioner(){};
62
66 void
67 initialize(MultigridData const & mg_data,
68 std::shared_ptr<Grid<dim> const> grid,
69 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
70 dealii::FiniteElement<dim> const & fe,
71 PDEOperator const & pde_operator,
72 MultigridOperatorType const & mg_operator_type,
73 bool const mesh_is_moving,
74 Map_DBC const & dirichlet_bc,
75 Map_DBC_ComponentMask const & dirichlet_bc_component_mask);
76
80 void
81 update() final;
82
83private:
84 void
85 fill_matrix_free_data(MatrixFreeData<dim, MultigridNumber> & matrix_free_data,
86 unsigned int const level,
87 unsigned int const dealii_tria_level) final;
88
89 std::shared_ptr<MGOperatorBase>
90 initialize_operator(unsigned int const level) final;
91
92 void
93 initialize_dof_handler_and_constraints(
94 bool const operator_is_singular,
95 unsigned int const n_components,
96 Map_DBC const & dirichlet_bc,
97 Map_DBC_ComponentMask const & dirichlet_bc_component_mask) final;
98
99 void
100 initialize_transfer_operators() final;
101
102 std::shared_ptr<PDEOperatorMG>
103 get_operator(unsigned int level) const;
104
105 std::shared_ptr<MultigridTransfer<dim, MultigridNumber, VectorTypeMG>> transfers_velocity;
106
107 unsigned int degree_velocity;
108
109 dealii::MGLevelObject<std::shared_ptr<dealii::DoFHandler<dim> const>> dof_handlers_velocity;
110 dealii::MGLevelObject<std::shared_ptr<dealii::AffineConstraints<MultigridNumber>>>
111 constraints_velocity;
112
114
115 PDEOperator const * pde_operator;
116
117 MultigridOperatorType mg_operator_type;
118
119 bool mesh_is_moving;
120};
121
122} // namespace ConvDiff
123} // namespace ExaDG
124
125#endif /* INCLUDE_CONVECTION_DIFFUSION_MULTIGRID_PRECONDITIONER_H_ */
Definition combined_operator.h:56
Definition multigrid_preconditioner.h:38
void initialize(MultigridData const &mg_data, std::shared_ptr< Grid< dim > const > grid, std::shared_ptr< MultigridMappings< dim, Number > > const multigrid_mappings, dealii::FiniteElement< dim > const &fe, PDEOperator const &pde_operator, MultigridOperatorType const &mg_operator_type, bool const mesh_is_moving, Map_DBC const &dirichlet_bc, Map_DBC_ComponentMask const &dirichlet_bc_component_mask)
Definition multigrid_preconditioner.cpp:48
void update() final
Definition multigrid_preconditioner.cpp:110
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 driver.cpp:33
Definition combined_operator.h:35
Definition matrix_free_data.h:40
Definition multigrid_parameters.h:259