Dune::Copasi
Loading...
Searching...
No Matches
dense_inverse.hh
Go to the documentation of this file.
1#ifndef DUNE_COPASI_SOLVER_ISTL_DENSE_INVERSE_HH
2#define DUNE_COPASI_SOLVER_ISTL_DENSE_INVERSE_HH
3
4#include <dune/istl/solver.hh>
5
6namespace Dune::Copasi::ISTL {
7
8template<class Inverse, class X, class Y>
9struct DenseInverse final : public InverseOperator<X, Y>
10{
11
13 : _inverse{ std::move(inverse) }
14 {
15 }
16
17 void apply(X& x, Y& b, InverseOperatorResult& res) override
18 {
19 _inverse.mv(b,x);
20 res.iterations = 1;
21 res.converged = 1;
22 }
23
24 void apply(X& x, Y& b, [[maybe_unused]] double reduction, InverseOperatorResult& res) override
25 {
26 this->apply(x, b, res);
27 }
28
29 SolverCategory::Category category() const override
30 {
31 return SolverCategory::Category::sequential;
32 }
33
35};
36
37} // namespace Dune::Copasi::ISTL
38
39#endif // DUNE_COPASI_SOLVER_ISTL_DENSE_INVERSE_HH
Definition block_jacobi.hh:14
constexpr bool is_bitflags_v
Alias for Bitflag indicator.
Definition bit_flags.hh:24
Definition dense_inverse.hh:10
void apply(X &x, Y &b, double reduction, InverseOperatorResult &res) override
Definition dense_inverse.hh:24
SolverCategory::Category category() const override
Definition dense_inverse.hh:29
DenseInverse(Inverse &&inverse)
Definition dense_inverse.hh:12
Inverse _inverse
Definition dense_inverse.hh:34
void apply(X &x, Y &b, InverseOperatorResult &res) override
Definition dense_inverse.hh:17