5 #include <dune/common/timer.hh> 8 #include <amdis/CreatorInterface.hpp> 9 #include <amdis/Output.hpp> 10 #include <amdis/linearalgebra/LinearSolverInterface.hpp> 11 #include <amdis/linearalgebra/SolverInfo.hpp> 24 template <
class Mat,
class Vec,
class Runner>
37 return std::make_unique<Self>(prefix);
43 template <
class... Args>
45 : runner_(prefix, FWD(args)...)
48 Runner* runner()
override 60 runner_.init(A.matrix());
63 if (solverInfo.
info() > 0)
64 msg(
"prepare solver needed {} seconds", t.elapsed());
66 int error = runner_.solve(A.matrix(), x.vector(), b.vector(), solverInfo);
A creator to be used instead of the constructor.
Definition: LinearSolver.hpp:33
bool doCreateMatrixData() const
Returns createMatrixData.
Definition: SolverInfo.hpp:56
Interface for creators with name.
Definition: CreatorInterface.hpp:42
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
int info() const
Returns info.
Definition: SolverInfo.hpp:38
void msg(std::string const &str, Args &&... args)
print a message
Definition: Output.hpp:98
Abstract base class for linear solvers.
Definition: LinearSolverInterface.hpp:27
Wrapper class for various solvers. These solvers are parametrized by MatrixType and VectorType...
Definition: LinearSolver.hpp:25
bool doStoreMatrixData() const
Returns storeMatrixData.
Definition: SolverInfo.hpp:62
LinearSolver(std::string prefix, Args &&... args)
Constructor.
Definition: LinearSolver.hpp:44
void setError(int e)
Sets error_.
Definition: SolverInfo.hpp:98
void solveImpl(Mat const &A, Vec &x, Vec const &b, SolverInfo &solverInfo) override
Implements LinearSolverInterface::solveImpl()
Definition: LinearSolver.hpp:55
std::unique_ptr< Super > createWithString(std::string prefix) override
Must be implemented by sub classes of CreatorInterfaceName. Creates a new instance of the sub class o...
Definition: LinearSolver.hpp:35
Definition: SolverInfo.hpp:11