43class FlexibleSolver :
public Dune::InverseOperator<typename Operator::domain_type,
44 typename Operator::range_type>
47 using VectorType =
typename Operator::domain_type;
55 const std::function<VectorType()>& weightsCalculator,
56 std::size_t pressureIndex);
63 const std::function<VectorType()>& weightsCalculator,
64 std::size_t pressureIndex);
66 virtual void apply(VectorType& x, VectorType& rhs, Dune::InverseOperatorResult& res)
override;
68 virtual void apply(VectorType& x, VectorType& rhs,
double reduction, Dune::InverseOperatorResult& res)
override;
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;