Commit f5d07c87 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Allow to pass a LinearSolverInterface to the ProblemStat

parent b90ba034
......@@ -72,17 +72,19 @@ namespace AMDiS
/// Dimension of the world
static constexpr int dow = Grid::dimensionworld;
private:
using value_type = typename Traits::CoefficientType;
using LinAlgTraits = typename Traits::LinAlgTraits;
using Mat = typename LinAlgTraits::template MatrixImpl<typename Traits::CoefficientType>;
using Vec = typename LinAlgTraits::template VectorImpl<typename Traits::CoefficientType>;
using Mat = typename LinAlgTraits::template MatrixImpl<value_type>;
using Vec = typename LinAlgTraits::template VectorImpl<value_type>;
using PartitionSet = typename LinAlgTraits::PartitionSet;
public:
using LinearSolverInterface = AMDiS::LinearSolverInterface<Mat,Vec,Vec>;
using LinearSolver = AMDiS::LinearSolver<Mat,Vec,Vec>;
using SystemMatrix = BiLinearForm<GlobalBasis, GlobalBasis, typename Traits::CoefficientType, LinAlgTraits>;
using SystemVector = LinearForm<GlobalBasis, typename Traits::CoefficientType, LinAlgTraits>;
using SolutionVector = DOFVector<GlobalBasis, typename Traits::CoefficientType, LinAlgTraits>;
using SystemMatrix = BiLinearForm<GlobalBasis, GlobalBasis, value_type, LinAlgTraits>;
using SystemVector = LinearForm<GlobalBasis, value_type, LinAlgTraits>;
using SolutionVector = DOFVector<GlobalBasis, value_type, LinAlgTraits>;
public:
/**
......@@ -376,8 +378,8 @@ namespace AMDiS
std::shared_ptr<GlobalBasis const> globalBasis() const { return globalBasis_; }
/// Return a reference to the linear solver, \ref linearSolver
std::shared_ptr<LinearSolver> solver() { return linearSolver_; }
std::shared_ptr<LinearSolver const> solver() const { return linearSolver_; }
std::shared_ptr<LinearSolverInterface> solver() { return linearSolver_; }
std::shared_ptr<LinearSolverInterface const> solver() const { return linearSolver_; }
/// Returns a reference to system-matrix, \ref systemMatrix_
std::shared_ptr<SystemMatrix> systemMatrix() { return systemMatrix_; }
......@@ -536,7 +538,7 @@ namespace AMDiS
// std::vector<Estimator*> estimator;
/// An object of the linearSolver Interface
std::shared_ptr<LinearSolver> linearSolver_;
std::shared_ptr<LinearSolverInterface> linearSolver_;
/// Matrix that is filled during assembling
std::shared_ptr<SystemMatrix> systemMatrix_;
......
......@@ -89,7 +89,7 @@ namespace AMDiS
initialized_ = false;
}
/// Implements \ref Dune::InverOperator::apply()
/// Implements \ref LinearSolverInterface::apply()
void apply(Vector& x, Vector const& b, Dune::InverseOperatorResult& stat) override
{
KSPSolve(ksp_, b.vector(), x.vector());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment