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