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_EXADG_STRUCTURE_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_H_
23#define INCLUDE_EXADG_STRUCTURE_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_H_
24
25#include <exadg/operators/multigrid_operator.h>
26#include <exadg/solvers_and_preconditioners/multigrid/multigrid_preconditioner_base.h>
27#include <exadg/structure/spatial_discretization/operators/elasticity_operator_base.h>
28#include <exadg/structure/spatial_discretization/operators/linear_operator.h>
29#include <exadg/structure/spatial_discretization/operators/nonlinear_operator.h>
30
31namespace ExaDG
32{
33namespace Structure
34{
35template<int dim, typename Number>
37{
38private:
40
41public:
42 typedef typename Base::MultigridNumber MultigridNumber;
43
44public:
47
50
54
55 typedef typename Base::Map_DBC Map_DBC;
56 typedef typename Base::Map_DBC_ComponentMask Map_DBC_ComponentMask;
57 typedef typename Base::PeriodicFacePairs PeriodicFacePairs;
58 typedef typename Base::VectorType VectorType;
59 typedef typename Base::VectorTypeMG VectorTypeMG;
60
61 MultigridPreconditioner(MPI_Comm const & mpi_comm);
62
63 void
64 initialize(MultigridData const & mg_data,
65 std::shared_ptr<Grid<dim> const> grid,
66 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
67 dealii::FiniteElement<dim> const & fe,
68 ElasticityOperatorBase<dim, Number> const & pde_operator,
69 bool const nonlinear_operator,
70 Map_DBC const & dirichlet_bc,
71 Map_DBC_ComponentMask const & dirichlet_bc_component_mask);
72
73 /*
74 * This function updates the multigrid preconditioner.
75 */
76 void
77 update() final;
78
79private:
80 void
81 initialize_dof_handler_and_constraints(
82 bool const operator_is_singular,
83 unsigned int const n_components,
84 Map_DBC const & dirichlet_bc,
85 Map_DBC_ComponentMask const & dirichlet_bc_component_mask) final;
86
87 void
88 fill_matrix_free_data(MatrixFreeData<dim, MultigridNumber> & matrix_free_data,
89 unsigned int const level,
90 unsigned int const dealii_tria_level) final;
91
92 std::shared_ptr<MGOperatorBase>
93 initialize_operator(unsigned int const level) final;
94
95 /*
96 * This function updates the multigrid operators for all levels
97 */
98 void
99 update_operators();
100
101 std::shared_ptr<PDEOperatorNonlinearMG>
102 get_operator_nonlinear(unsigned int level);
103
104 std::shared_ptr<PDEOperatorLinearMG>
105 get_operator_linear(unsigned int level);
106
107private:
109
110 ElasticityOperatorBase<dim, Number> const * pde_operator;
111
112 // additional constraints without Dirichlet degrees of freedom
113 dealii::MGLevelObject<std::shared_ptr<dealii::DoFHandler<dim> const>> dof_handlers_inhomogeneous;
114 dealii::MGLevelObject<std::shared_ptr<dealii::AffineConstraints<MultigridNumber>>>
115 constraints_inhomogeneous;
116
117 bool nonlinear;
118};
119
120} // namespace Structure
121} // namespace ExaDG
122
123#endif
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 elasticity_operator_base.h:71
Definition linear_operator.h:33
Definition multigrid_preconditioner.h:37
Definition nonlinear_operator.h:33
Definition driver.cpp:33
Definition matrix_free_data.h:40
Definition multigrid_parameters.h:259
Definition elasticity_operator_base.h:36