ExaDG
Loading...
Searching...
No Matches
multigrid_preconditioner_momentum.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_INCOMPRESSIBLE_NAVIER_STOKES_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_MOMENTUM_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_MOMENTUM_H_
24
25#include <exadg/incompressible_navier_stokes/spatial_discretization/operators/momentum_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 IncNS
32{
33/*
34 * Multigrid preconditioner for momentum operator of the incompressible Navier-Stokes equations.
35 */
36template<int dim, typename Number>
38{
39private:
41
42public:
43 typedef typename Base::MultigridNumber MultigridNumber;
44
45private:
50
51 typedef typename Base::Map_DBC Map_DBC;
52 typedef typename Base::Map_DBC_ComponentMask Map_DBC_ComponentMask;
53 typedef typename Base::PeriodicFacePairs PeriodicFacePairs;
54 typedef typename Base::VectorType VectorType;
55 typedef typename Base::VectorTypeMG VectorTypeMG;
56
57public:
58 MultigridPreconditioner(MPI_Comm const & comm);
59
60 void
61 initialize(MultigridData const & mg_data,
62 std::shared_ptr<Grid<dim> const> grid,
63 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
64 dealii::FiniteElement<dim> const & fe,
65 PDEOperator const & pde_operator,
66 MultigridOperatorType const & mg_operator_type,
67 bool const mesh_is_moving,
68 Map_DBC const & dirichlet_bc,
69 Map_DBC_ComponentMask const & dirichlet_bc_component_mask);
70
71 /*
72 * This function updates the multigrid preconditioner.
73 */
74 void
75 update() final;
76
77private:
78 void
79 fill_matrix_free_data(MatrixFreeData<dim, MultigridNumber> & matrix_free_data,
80 unsigned int const level,
81 unsigned int const dealii_tria_level) final;
82
83 std::shared_ptr<MGOperatorBase>
84 initialize_operator(unsigned int const level) final;
85
86 std::shared_ptr<PDEOperatorMG>
87 get_operator(unsigned int level);
88
90
91 PDEOperator const * pde_operator;
92
93 MultigridOperatorType mg_operator_type;
94
95 bool mesh_is_moving;
96};
97
98} // namespace IncNS
99} // namespace ExaDG
100
101#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_PRECONDITIONERS_MULTIGRID_PRECONDITIONER_MOMENTUM_H_ \
102 */
Definition grid.h:40
Definition momentum_operator.h:40
Definition multigrid_preconditioner_momentum.h:38
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 momentum_operator.h:22
Definition matrix_free_data.h:40
Definition multigrid_parameters.h:259