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

remove comm from solver

parent 752f128d
...@@ -23,7 +23,7 @@ add_subdirectory("src") ...@@ -23,7 +23,7 @@ add_subdirectory("src")
add_subdirectory("test") add_subdirectory("test")
target_link_libraries(amdis fmt) target_link_libraries(amdis fmt)
target_compile_options(amdis PUBLIC "-Wfatal-errors" "-Wall" "-Wpedantic") target_compile_options(amdis PUBLIC "-Wall" "-Wpedantic")
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF) option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
if (ENABLE_ALL_WARNINGS) if (ENABLE_ALL_WARNINGS)
......
...@@ -12,6 +12,7 @@ struct NavierStokesBasis ...@@ -12,6 +12,7 @@ struct NavierStokesBasis
using Grid = Dune::YaspGrid<GRIDDIM>; using Grid = Dune::YaspGrid<GRIDDIM>;
using GlobalBasis = typename TaylorHoodBasis<Grid>::GlobalBasis; using GlobalBasis = typename TaylorHoodBasis<Grid>::GlobalBasis;
using CoefficientType = double; using CoefficientType = double;
using LinAlgTraits = BackendTraits<GlobalBasis>;
}; };
int main(int argc, char** argv) int main(int argc, char** argv)
......
...@@ -21,7 +21,7 @@ namespace AMDiS ...@@ -21,7 +21,7 @@ namespace AMDiS
* \tparam CB Basis of matrix columns * \tparam CB Basis of matrix columns
* \tparam T Coefficient type to store in the matrix * \tparam T Coefficient type to store in the matrix
**/ **/
template <class RB, class CB, class T = double, class Traits = BackendTraits<RB,T>> template <class RB, class CB, class T = double, class Traits = BackendTraits<RB>>
class BiLinearForm class BiLinearForm
: public MatrixFacade<T, Traits::template MatrixImpl> : public MatrixFacade<T, Traits::template MatrixImpl>
, private ObserverSequence<event::adapt,2> , private ObserverSequence<event::adapt,2>
...@@ -39,7 +39,7 @@ namespace AMDiS ...@@ -39,7 +39,7 @@ namespace AMDiS
using ColLocalView = typename ColBasis::LocalView; using ColLocalView = typename ColBasis::LocalView;
/// The type of the elements of the DOFVector /// The type of the elements of the DOFVector
using CoefficientType = typename Traits::CoefficientType; using CoefficientType = T;
/// The type of the matrix filled on an element with local contributions /// The type of the matrix filled on an element with local contributions
using ElementMatrix = FlatMatrix<CoefficientType>; using ElementMatrix = FlatMatrix<CoefficientType>;
......
...@@ -35,7 +35,7 @@ namespace AMDiS ...@@ -35,7 +35,7 @@ namespace AMDiS
* \tparam T Type of the coefficients * \tparam T Type of the coefficients
* \tparam TraitsType Collection of parameter for the linear-algebra backend * \tparam TraitsType Collection of parameter for the linear-algebra backend
**/ **/
template <class GB, class T = double, class TraitsType = BackendTraits<GB,T>> template <class GB, class T = double, class TraitsType = BackendTraits<GB>>
class DOFVector class DOFVector
: public VectorFacade<T, TraitsType::template VectorImpl> : public VectorFacade<T, TraitsType::template VectorImpl>
, private Observer<event::preAdapt> , private Observer<event::preAdapt>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#else // ISTL #else // ISTL
#include <amdis/linearalgebra/istl/Constraints.hpp> #include <amdis/linearalgebra/istl/Constraints.hpp>
#include <amdis/linearalgebra/istl/ISTLRunner.hpp> #include <amdis/linearalgebra/istl/ISTLSolver.hpp>
#include <amdis/linearalgebra/istl/PreconCreator.hpp> #include <amdis/linearalgebra/istl/PreconCreator.hpp>
#include <amdis/linearalgebra/istl/SolverCreator.hpp> #include <amdis/linearalgebra/istl/SolverCreator.hpp>
#include <amdis/linearalgebra/istl/Traits.hpp> #include <amdis/linearalgebra/istl/Traits.hpp>
......
...@@ -19,7 +19,7 @@ namespace AMDiS ...@@ -19,7 +19,7 @@ namespace AMDiS
* \tparam T Coefficient type to store in the vector * \tparam T Coefficient type to store in the vector
* \tparam Traits Collection of parameter for the linear-algebra backend * \tparam Traits Collection of parameter for the linear-algebra backend
**/ **/
template <class GB, class T = double, class Traits = BackendTraits<GB,T>> template <class GB, class T = double, class Traits = BackendTraits<GB>>
class LinearForm class LinearForm
: public VectorFacade<T, Traits::template VectorImpl> : public VectorFacade<T, Traits::template VectorImpl>
{ {
...@@ -32,7 +32,7 @@ namespace AMDiS ...@@ -32,7 +32,7 @@ namespace AMDiS
using LocalView = typename GlobalBasis::LocalView; using LocalView = typename GlobalBasis::LocalView;
/// The type of the elements of the DOFVector /// The type of the elements of the DOFVector
using CoefficientType = typename Traits::CoefficientType; using CoefficientType = T;
/// The type of the vector filled on an element with local contributions /// The type of the vector filled on an element with local contributions
using ElementVector = FlatVector<CoefficientType>; using ElementVector = FlatVector<CoefficientType>;
......
...@@ -25,7 +25,7 @@ namespace AMDiS ...@@ -25,7 +25,7 @@ namespace AMDiS
using Self = ProblemInstat; using Self = ProblemInstat;
using ProblemType = ProblemStat<Traits>; using ProblemType = ProblemStat<Traits>;
using CoefficientVector = typename ProblemType::CoefficientVector; using SolutionVector = typename ProblemType::SolutionVector;
public: public:
/// Constructs a ProblemInstat with prob as its stationary problem, stored as reference. /// Constructs a ProblemInstat with prob as its stationary problem, stored as reference.
...@@ -54,7 +54,7 @@ namespace AMDiS ...@@ -54,7 +54,7 @@ namespace AMDiS
ProblemType const& problemStat() const { return *problemStat_; } ProblemType const& problemStat() const { return *problemStat_; }
/// Returns const-ref of \ref oldSolution. /// Returns const-ref of \ref oldSolution.
std::shared_ptr<CoefficientVector const> oldSolutionVector() const std::shared_ptr<SolutionVector const> oldSolutionVector() const
{ {
test_exit_dbg(bool(oldSolution_), test_exit_dbg(bool(oldSolution_),
"OldSolution need to be created. Call initialize with INIT_UH_OLD."); "OldSolution need to be created. Call initialize with INIT_UH_OLD.");
...@@ -82,7 +82,7 @@ namespace AMDiS ...@@ -82,7 +82,7 @@ namespace AMDiS
ProblemType* problemStat_; ProblemType* problemStat_;
/// Solution of the last timestep. /// Solution of the last timestep.
std::shared_ptr<CoefficientVector> oldSolution_; std::shared_ptr<SolutionVector> oldSolution_;
}; };
......
...@@ -43,7 +43,7 @@ void ProblemInstat<Traits>::createUhOld() ...@@ -43,7 +43,7 @@ void ProblemInstat<Traits>::createUhOld()
if (oldSolution_) if (oldSolution_)
warning("oldSolution already created\n"); warning("oldSolution already created\n");
else // create oldSolution else // create oldSolution
oldSolution_.reset(new CoefficientVector(*problemStat_->solutionVector())); oldSolution_.reset(new SolutionVector(*problemStat_->solutionVector()));
} }
......
...@@ -76,13 +76,17 @@ namespace AMDiS ...@@ -76,13 +76,17 @@ namespace AMDiS
/// Dimension of the world /// Dimension of the world
static constexpr int dow = Grid::dimensionworld; static constexpr int dow = Grid::dimensionworld;
using LinearSolverTraits = BackendTraits<GlobalBasis, typename Traits::CoefficientType>; private:
using LinearSolverType = LinearSolverInterface<LinearSolverTraits>; using LinAlgTraits = typename Traits::LinAlgTraits;
using CommunicationType = typename LinearSolverTraits::Comm; using Mat = typename LinAlgTraits::template MatrixImpl<typename Traits::CoefficientType>;
using Vec = typename LinAlgTraits::template VectorImpl<typename Traits::CoefficientType>;
using PartitionSet = typename LinAlgTraits::PartitionSet;
using SystemMatrix = BiLinearForm<GlobalBasis, GlobalBasis, typename Traits::CoefficientType>; public:
using SystemVector = LinearForm<GlobalBasis, typename Traits::CoefficientType>; using LinearSolver = LinearSolverInterface<Mat,Vec>;
using CoefficientVector = DOFVector<GlobalBasis, typename Traits::CoefficientType>; 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>;
public: public:
/** /**
...@@ -334,16 +338,16 @@ namespace AMDiS ...@@ -334,16 +338,16 @@ namespace AMDiS
std::shared_ptr<GlobalBasis const> globalBasis() const { return globalBasis_; } std::shared_ptr<GlobalBasis const> globalBasis() const { return globalBasis_; }
/// Return a reference to the linear solver, \ref linearSolver /// Return a reference to the linear solver, \ref linearSolver
std::shared_ptr<LinearSolverType> solver() { return linearSolver_; } std::shared_ptr<LinearSolver> solver() { return linearSolver_; }
std::shared_ptr<LinearSolverType const> solver() const { return linearSolver_; } std::shared_ptr<LinearSolver const> solver() const { return linearSolver_; }
/// Returns a reference to system-matrix, \ref systemMatrix_ /// Returns a reference to system-matrix, \ref systemMatrix_
std::shared_ptr<SystemMatrix> systemMatrix() { return systemMatrix_; } std::shared_ptr<SystemMatrix> systemMatrix() { return systemMatrix_; }
std::shared_ptr<SystemMatrix const> systemMatrix() const { return systemMatrix_; } std::shared_ptr<SystemMatrix const> systemMatrix() const { return systemMatrix_; }
/// Returns a reference to the solution vector, \ref solution_ /// Returns a reference to the solution vector, \ref solution_
std::shared_ptr<CoefficientVector> solutionVector() { return solution_; } std::shared_ptr<SolutionVector> solutionVector() { return solution_; }
std::shared_ptr<CoefficientVector const> solutionVector() const { return solution_; } std::shared_ptr<SolutionVector const> solutionVector() const { return solution_; }
/// Return a reference to the rhs system-vector, \ref rhs /// Return a reference to the rhs system-vector, \ref rhs
std::shared_ptr<SystemVector> rhsVector() { return rhs_; } std::shared_ptr<SystemVector> rhsVector() { return rhs_; }
...@@ -485,13 +489,13 @@ namespace AMDiS ...@@ -485,13 +489,13 @@ namespace AMDiS
// std::vector<Estimator*> estimator; // std::vector<Estimator*> estimator;
/// An object of the linearSolver Interface /// An object of the linearSolver Interface
std::shared_ptr<LinearSolverType> linearSolver_; std::shared_ptr<LinearSolver> linearSolver_;
/// Matrix that is filled during assembling /// Matrix that is filled during assembling
std::shared_ptr<SystemMatrix> systemMatrix_; std::shared_ptr<SystemMatrix> systemMatrix_;
/// Vector with the solution components /// Vector with the solution components
std::shared_ptr<CoefficientVector> solution_; std::shared_ptr<SolutionVector> solution_;
/// Vector (load-vector) corresponding to the right-hand side /// Vector (load-vector) corresponding to the right-hand side
/// of the equation, filled during assembling /// of the equation, filled during assembling
......
...@@ -240,7 +240,7 @@ template <class Traits> ...@@ -240,7 +240,7 @@ template <class Traits>
void ProblemStat<Traits>::createMatricesAndVectors() void ProblemStat<Traits>::createMatricesAndVectors()
{ {
systemMatrix_ = std::make_shared<SystemMatrix>(globalBasis_, globalBasis_); systemMatrix_ = std::make_shared<SystemMatrix>(globalBasis_, globalBasis_);
solution_ = std::make_shared<CoefficientVector>(globalBasis_); solution_ = std::make_shared<SolutionVector>(globalBasis_);
rhs_ = std::make_shared<SystemVector>(globalBasis_); rhs_ = std::make_shared<SystemVector>(globalBasis_);
auto localView = globalBasis_->localView(); auto localView = globalBasis_->localView();
...@@ -261,7 +261,7 @@ void ProblemStat<Traits>::createSolver() ...@@ -261,7 +261,7 @@ void ProblemStat<Traits>::createSolver()
Parameters::get(name_ + "->solver", solverName); Parameters::get(name_ + "->solver", solverName);
auto solverCreator auto solverCreator
= named(CreatorMap<LinearSolverType>::getCreator(solverName, name_ + "->solver")); = named(CreatorMap<LinearSolver>::getCreator(solverName, name_ + "->solver"));
linearSolver_ = solverCreator->createWithString(name_ + "->solver"); linearSolver_ = solverCreator->createWithString(name_ + "->solver");
} }
...@@ -291,7 +291,7 @@ void ProblemStat<Traits>::createMarker() ...@@ -291,7 +291,7 @@ void ProblemStat<Traits>::createMarker()
template <class Traits> template <class Traits>
void ProblemStat<Traits>::createFileWriter() void ProblemStat<Traits>::createFileWriter()
{ {
FileWriterCreator<CoefficientVector> creator(solution_, boundaryManager_); FileWriterCreator<SolutionVector> creator(solution_, boundaryManager_);
filewriter_.clear(); filewriter_.clear();
auto localView = globalBasis_->localView(); auto localView = globalBasis_->localView();
...@@ -382,8 +382,7 @@ solve(AdaptInfo& adaptInfo, bool createMatrixData, bool storeMatrixData) ...@@ -382,8 +382,7 @@ solve(AdaptInfo& adaptInfo, bool createMatrixData, bool storeMatrixData)
solverInfo.setStoreMatrixData(storeMatrixData); solverInfo.setStoreMatrixData(storeMatrixData);
solution_->resize(); solution_->resize();
linearSolver_->solve(systemMatrix_->impl().matrix(), solution_->impl().vector(), linearSolver_->solve(*systemMatrix_, *solution_, *rhs_, solverInfo);
rhs_->impl().vector(), globalBasis_->communicator(), solverInfo);
if (solverInfo.info() > 0) { if (solverInfo.info() > 0) {
msg("solution of discrete system needed {} seconds", t.elapsed()); msg("solution of discrete system needed {} seconds", t.elapsed());
...@@ -525,7 +524,7 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as ...@@ -525,7 +524,7 @@ buildAfterAdapt(AdaptInfo& /*adaptInfo*/, Flag /*flag*/, bool asmMatrix, bool as
msg("{} local DOFs", rhs_->localSize()); msg("{} local DOFs", rhs_->localSize());
// 2. traverse grid and assemble operators on the elements // 2. traverse grid and assemble operators on the elements
for (auto const& element : elements(gridView(), typename LinearSolverTraits::PartitionSet{})) { for (auto const& element : elements(gridView(), PartitionSet{})) {
localView.bind(element); localView.bind(element);
if (asmMatrix) if (asmMatrix)
......
...@@ -59,16 +59,20 @@ namespace AMDiS ...@@ -59,16 +59,20 @@ namespace AMDiS
} // end namespace Impl } // end namespace Impl
/// An Exemplar for ProblemStatTraits
template <class GlobalBasisType, class T = double> /// Wrapper around a global basis providing default traits
template <class GB, class T = double,
template <class> class TraitsImpl = BackendTraits>
struct DefaultProblemTraits struct DefaultProblemTraits
{ {
using GlobalBasis = GlobalBasisType; using GlobalBasis = GB;
using CoefficientType = T; using CoefficientType = T;
using LinAlgTraits = TraitsImpl<GB>;
}; };
/// Generator for a basis and default problem traits
template <class HostGrid, class PreBasisCreator, class T = double> template <class HostGrid, class PreBasisCreator, class T = double,
template <class> class TraitsImpl = BackendTraits>
struct DefaultBasisCreator struct DefaultBasisCreator
{ {
using Grid = AdaptiveGrid_t<HostGrid>; using Grid = AdaptiveGrid_t<HostGrid>;
...@@ -84,10 +88,12 @@ namespace AMDiS ...@@ -84,10 +88,12 @@ namespace AMDiS
return makeGlobalBasis(gridView, PreBasisCreator::create()); return makeGlobalBasis(gridView, PreBasisCreator::create());
} }
using GlobalBasis = Underlying_t<decltype(create(std::declval<GridView>()))>; using GlobalBasis = decltype(create(std::declval<GridView>()));
using CoefficientType = T; using CoefficientType = T;
using LinAlgTraits = TraitsImpl<GlobalBasis>;
}; };
/// \brief ProblemStatTraits for a (composite) basis composed of /// \brief ProblemStatTraits for a (composite) basis composed of
/// lagrange bases of different degree. /// lagrange bases of different degree.
template <class Grid, int... degrees> template <class Grid, int... degrees>
......
...@@ -8,13 +8,12 @@ install(FILES ...@@ -8,13 +8,12 @@ install(FILES
LinearSolverInterface.hpp LinearSolverInterface.hpp
MatrixFacade.hpp MatrixFacade.hpp
ParallelIndexSet.hpp ParallelIndexSet.hpp
PreconditionerInterface.hpp
RunnerInterface.hpp RunnerInterface.hpp
SolverInfo.hpp SolverInfo.hpp
SparsityPattern.hpp SparsityPattern.hpp
SymmetryStructure.hpp SymmetryStructure.hpp
Traits.hpp Traits.hpp
VectorDefaultImplementation.hpp VectorBase.hpp
VectorFacade.hpp VectorFacade.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/linearalgebra) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/linearalgebra)
......
...@@ -21,16 +21,12 @@ namespace AMDiS ...@@ -21,16 +21,12 @@ namespace AMDiS
* solvers where the backend provides an interface, can be assigned * solvers where the backend provides an interface, can be assigned
* by different Runner objects. * by different Runner objects.
**/ **/
template <class Traits, class Runner> template <class Mat, class Vec, class Runner>
class LinearSolver class LinearSolver
: public LinearSolverInterface<Traits> : public LinearSolverInterface<Mat,Vec>
{ {
using Self = LinearSolver; using Self = LinearSolver;
using Super = LinearSolverInterface<Traits>; using Super = LinearSolverInterface<Mat,Vec>;
using Mat = typename Traits::Mat;
using Vec = typename Traits::Vec;
using Comm = typename Traits::Comm;
public: public:
/// A creator to be used instead of the constructor. /// A creator to be used instead of the constructor.
...@@ -49,23 +45,25 @@ namespace AMDiS ...@@ -49,23 +45,25 @@ namespace AMDiS
: runner_(prefix, FWD(args)...) : runner_(prefix, FWD(args)...)
{} {}
Runner& runner() { return runner_; } Runner* runner() override
Runner const& runner() const { return runner_; } {
return &runner_;
}
private: protected:
/// Implements \ref LinearSolverInterface::solveSystemImpl() /// Implements \ref LinearSolverInterface::solveImpl()
void solveImpl(Mat const& A, Vec& x, Vec const& b, Comm const& comm, SolverInfo& solverInfo) override void solveImpl(Mat const& A, Vec& x, Vec const& b, SolverInfo& solverInfo) override
{ {
Dune::Timer t; Dune::Timer t;
if (solverInfo.doCreateMatrixData()) { if (solverInfo.doCreateMatrixData()) {
// init matrix or wrap block-matrix or ... // init matrix or wrap block-matrix or ...
runner_.init(A, comm); runner_.init(A.matrix());
} }
if (solverInfo.info() > 0) if (solverInfo.info() > 0)
msg("prepare solver needed {} seconds", t.elapsed()); msg("prepare solver needed {} seconds", t.elapsed());
int error = runner_.solve(A, x, b, solverInfo); int error = runner_.solve(A.matrix(), x.vector(), b.vector(), solverInfo);
solverInfo.setError(error); solverInfo.setError(error);
if (!solverInfo.doStoreMatrixData()) if (!solverInfo.doStoreMatrixData())
...@@ -73,7 +71,7 @@ namespace AMDiS ...@@ -73,7 +71,7 @@ namespace AMDiS
} }
private: private:
/// redirect the implementation to a runner. Implementing a \ref RunnerInterface /// redirect the implementation to a runner implementing a \ref RunnerInterface
Runner runner_; Runner runner_;
}; };
......
#pragma once #pragma once
/** \file LinearSolverInterface.h */ #include <amdis/Output.hpp>
#include <amdis/linearalgebra/RunnerInterface.hpp>
/** /**
* \defgroup Solver Solver module * \defgroup Solver Solver module
...@@ -15,15 +16,16 @@ namespace AMDiS ...@@ -15,15 +16,16 @@ namespace AMDiS
{ {
class SolverInfo; class SolverInfo;
template <class T, template <class> class MatrixImpl>
class MatrixFacade;
template <class T, template <class> class VectorImpl>
class VectorFacade;
/// Abstract base class for linear solvers /// Abstract base class for linear solvers
template <class Traits> template <class Mat, class Vec>
class LinearSolverInterface class LinearSolverInterface
{ {
protected:
using Mat = typename Traits::Mat;
using Vec = typename Traits::Vec;
using Comm = typename Traits::Comm;
public: public:
/// Destructor. /// Destructor.
virtual ~LinearSolverInterface() = default; virtual ~LinearSolverInterface() = default;
...@@ -38,14 +40,21 @@ namespace AMDiS ...@@ -38,14 +40,21 @@ namespace AMDiS
* \p x A [block-]vector for the unknown components. * \p x A [block-]vector for the unknown components.
* \p b A [block-]vector for the right-hand side of the linear system. * \p b A [block-]vector for the right-hand side of the linear system.
**/ **/
void solve(Mat const& A, Vec& x, Vec const& b, Comm const& comm, SolverInfo& solverInfo) template <class TA, class TX, class TY, template <class> class MI, template <class> class VI>
void solve(MatrixFacade<TA,MI> const& A, VectorFacade<TX,VI>& x, VectorFacade<TY,VI> const& b, SolverInfo& solverInfo)
{ {
solveImpl(A, x, b, comm, solverInfo); solveImpl(A.impl(), x.impl(), b.impl(), solverInfo);
} }
private: virtual RunnerInterface<Mat,Vec>* runner()
{
error_exit("Must be implemented by derived class.");
return nullptr;
}
protected:
/// main methods that all solvers must implement /// main methods that all solvers must implement
virtual void solveImpl(Mat const& A, Vec& x, Vec const& b, Comm const& comm, SolverInfo& solverInfo) = 0; virtual void solveImpl(Mat const& A, Vec& x, Vec const& b, SolverInfo& solverInfo) = 0;
}; };
} // end namespace AMDiS } // end namespace AMDiS
...@@ -7,29 +7,28 @@ namespace AMDiS ...@@ -7,29 +7,28 @@ namespace AMDiS
class SolverInfo; class SolverInfo;
/// Interface for Runner / Worker types used in solver classes /// Interface for Runner / Worker types used in solver classes
template <class Traits> template <class Mat, class Vec>
class RunnerInterface class RunnerInterface
{ {
protected: using M = typename Mat::BaseMatrix;
using Mat = typename Traits::Mat; using X = typename Vec::BaseVector;
using Vec = typename Traits::Vec; using Y = typename Vec::BaseVector;
using Comm = typename Traits::Comm;
public: public:
/// virtual destructor /// virtual destructor
virtual ~RunnerInterface() = default; virtual ~RunnerInterface() = default;
/// Is called at the beginning of a solution procedure /// Is called at the beginning of a solution procedure
virtual void init(Mat const& A, Comm const& comm) = 0; virtual void init(M const& A) = 0;
/// Is called at the end of a solution procedure /// Is called at the end of a solution procedure
virtual void exit() = 0; virtual void exit() = 0;
/// Solve the system A*x = b /// Solve the system A*x = b
virtual int solve(Mat const& A, Vec& x, Vec const& b, SolverInfo& solverInfo) = 0; virtual int solve(M const& A, X& x, Y const& b, SolverInfo& solverInfo) = 0;
/// Solve the adjoint system A^T*x = b /// Solve the system A*x = b
virtual int adjointSolve(Mat const& A, Vec& x, Vec const& b, SolverInfo& solverInfo