22#ifndef OPM_FLEXIBLE_SOLVER_HEADER_INCLUDED
23#define OPM_FLEXIBLE_SOLVER_HEADER_INCLUDED
27#include <dune/istl/solver.hh>
28#include <dune/istl/paamg/pinfo.hh>
42template <
class Operator>
43class FlexibleSolver :
public Dune::InverseOperator<typename Operator::domain_type,
44 typename Operator::range_type>
55 const std::function<
VectorType()>& weightsCalculator,
56 std::size_t pressureIndex);
63 const std::function<
VectorType()>& weightsCalculator,
64 std::size_t pressureIndex);
73 virtual Dune::SolverCategory::Category
category()
const override;
76 using AbstractScalarProductType = Dune::ScalarProduct<VectorType>;
77 using AbstractSolverType = Dune::InverseOperator<VectorType, VectorType>;
82 const std::function<
VectorType()> weightsCalculator,
const Comm& comm,
83 std::size_t pressureIndex);
86 const std::function<
VectorType()> weightsCalculator,
const Dune::Amg::SequentialInformation&,
87 std::size_t pressureIndex);
92 void recreateDirectSolver();
97 void init(Operator& op,
100 const std::function<
VectorType()> weightsCalculator,
101 std::size_t pressureIndex);
103 Operator* linearoperator_for_solver_;
104 std::shared_ptr<AbstractPrecondType> preconditioner_;
105 std::shared_ptr<AbstractScalarProductType> scalarproduct_;
106 std::shared_ptr<AbstractSolverType> linsolver_;
107 bool direct_solver_ =
false;
Dune::OwnerOverlapCopyCommunication< int, int > Comm
Definition: FlexibleSolver_impl.hpp:285
Definition: FlexibleSolver.hpp:45
virtual Dune::SolverCategory::Category category() const override
Definition: FlexibleSolver_impl.hpp:109
virtual void apply(VectorType &x, VectorType &rhs, Dune::InverseOperatorResult &res) override
Definition: FlexibleSolver_impl.hpp:78
typename Operator::domain_type VectorType
Definition: FlexibleSolver.hpp:47
FlexibleSolver(Operator &op, const Opm::PropertyTree &prm, const std::function< VectorType()> &weightsCalculator, std::size_t pressureIndex)
Create a sequential solver.
Definition: FlexibleSolver_impl.hpp:53
AbstractPrecondType & preconditioner()
Access the contained preconditioner.
Definition: FlexibleSolver_impl.hpp:101
Definition: PropertyTree.hpp:37
Definition: fvbaseprimaryvariables.hh:141
Definition: blackoilboundaryratevector.hh:37
Dune::InverseOperatorResult InverseOperatorResult
Definition: BdaBridge.hpp:32