ExaDG
Loading...
Searching...
No Matches
inverse_mass_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_SOLVERS_AND_PRECONDITIONERS_INVERSEMASSMATRIXPRECONDITIONER_H_
23#define INCLUDE_SOLVERS_AND_PRECONDITIONERS_INVERSEMASSMATRIXPRECONDITIONER_H_
24
25#include <exadg/operators/inverse_mass_operator.h>
26#include <exadg/solvers_and_preconditioners/preconditioners/preconditioner_base.h>
27
28namespace ExaDG
29{
40template<int dim, int n_components, typename Number>
42{
43public:
44 typedef typename PreconditionerBase<Number>::VectorType VectorType;
45
46 InverseMassPreconditioner(dealii::MatrixFree<dim, Number> const & matrix_free,
47 InverseMassOperatorData const inverse_mass_operator_data)
48 {
49 inverse_mass_operator.initialize(matrix_free, inverse_mass_operator_data);
50
51 this->update_needed = false;
52 }
53
54 void
55 vmult(VectorType & dst, VectorType const & src) const final
56 {
57 inverse_mass_operator.apply(dst, src);
58 }
59
60 void
61 update() final
62 {
63 inverse_mass_operator.update();
64
65 this->update_needed = false;
66 }
67
68private:
70};
71} // namespace ExaDG
72
73
74#endif /* INCLUDE_SOLVERS_AND_PRECONDITIONERS_INVERSEMASSMATRIXPRECONDITIONER_H_ */
Definition inverse_mass_operator.h:53
Definition inverse_mass_preconditioner.h:42
Definition preconditioner_base.h:35
Definition driver.cpp:33
Definition inverse_mass_operator.h:39