ExaDG
Loading...
Searching...
No Matches
multigrid_operator_base.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 OPERATOR_PRECONDITIONABLE_H
23#define OPERATOR_PRECONDITIONABLE_H
24
25#include <deal.II/lac/affine_constraints.h>
26#include <deal.II/lac/la_parallel_vector.h>
27#include <deal.II/lac/petsc_sparse_matrix.h>
28#include <deal.II/lac/trilinos_sparse_matrix.h>
29#include <deal.II/matrix_free/matrix_free.h>
30
31namespace ExaDG
32{
33template<int dim, typename Number>
34class MultigridOperatorBase : public dealii::Subscriptor
35{
36public:
37 typedef Number value_type;
38 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
39
40 MultigridOperatorBase() : dealii::Subscriptor()
41 {
42 }
43
45 {
46 }
47
48 virtual dealii::AffineConstraints<Number> const &
49 get_affine_constraints() const = 0;
50
51 virtual dealii::MatrixFree<dim, Number> const &
52 get_matrix_free() const = 0;
53
54 virtual unsigned int
55 get_dof_index() const = 0;
56
57 virtual dealii::types::global_dof_index
58 m() const = 0;
59
60 virtual dealii::types::global_dof_index
61 n() const = 0;
62
63 virtual Number
64 el(unsigned int const, unsigned int const) const = 0;
65
66 virtual void
67 initialize_dof_vector(VectorType & vector) const = 0;
68
69 virtual void
70 vmult(VectorType & dst, VectorType const & src) const = 0;
71
72 virtual void
73 vmult_add(VectorType & dst, VectorType const & src) const = 0;
74
75 virtual void
76 vmult_interface_down(VectorType & dst, VectorType const & src) const = 0;
77
78 virtual void
79 vmult_add_interface_up(VectorType & dst, VectorType const & src) const = 0;
80
81 virtual void
82 calculate_inverse_diagonal(VectorType & inverse_diagonal_entries) const = 0;
83
84 virtual void
85 initialize_block_diagonal_preconditioner(bool const initialize) const = 0;
86
87 virtual void
88 update_block_diagonal_preconditioner() const = 0;
89
90 virtual void
91 apply_inverse_block_diagonal(VectorType & dst, VectorType const & src) const = 0;
92
93 virtual void
94 apply_inverse_additive_schwarz_matrices(VectorType & dst, VectorType const & src) const = 0;
95
96 virtual void
97 compute_factorized_additive_schwarz_matrices() const = 0;
98
99#ifdef DEAL_II_WITH_TRILINOS
100 virtual void
101 init_system_matrix(dealii::TrilinosWrappers::SparseMatrix & system_matrix,
102 MPI_Comm const & mpi_comm) const = 0;
103
104 virtual void
105 calculate_system_matrix(dealii::TrilinosWrappers::SparseMatrix & system_matrix) const = 0;
106#endif
107
108#ifdef DEAL_II_WITH_PETSC
109 virtual void
110 init_system_matrix(dealii::PETScWrappers::MPI::SparseMatrix & system_matrix,
111 MPI_Comm const & mpi_comm) const = 0;
112
113 virtual void
114 calculate_system_matrix(dealii::PETScWrappers::MPI::SparseMatrix & system_matrix) const = 0;
115#endif
116};
117
118} // namespace ExaDG
119
120#endif
Definition multigrid_operator_base.h:35
Definition driver.cpp:33