AMDiS  0.3
The Adaptive Multi-Dimensional Simulation Toolbox
RunnerInterface.hpp
1 #pragma once
2 
3 #include <amdis/Output.hpp>
4 
5 namespace AMDiS
6 {
7  class SolverInfo;
8 
10  template <class Mat, class Vec>
12  {
13  using M = typename Mat::BaseMatrix;
14  using X = typename Vec::BaseVector;
15  using Y = typename Vec::BaseVector;
16 
17  public:
19  virtual ~RunnerInterface() = default;
20 
22  virtual void init(M const& A) = 0;
23 
25  virtual void exit() = 0;
26 
28  virtual int solve(M const& A, X& x, Y const& b, SolverInfo& solverInfo) = 0;
29 
31  virtual int adjointSolve(M const& A, X& x, Y const& b, SolverInfo& solverInfo)
32  {
33  error_exit("Must be implemented by derived class.");
34  return 0;
35  }
36  };
37 
38 } // end namespace AMDiS
virtual int adjointSolve(M const &A, X &x, Y const &b, SolverInfo &solverInfo)
Solve the system A*x = b.
Definition: RunnerInterface.hpp:31
virtual void init(M const &A)=0
Is called at the beginning of a solution procedure.
void error_exit(std::string const &str, Args &&... args)
print a message and exit
Definition: Output.hpp:142
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
virtual int solve(M const &A, X &x, Y const &b, SolverInfo &solverInfo)=0
Solve the system A*x = b.
virtual ~RunnerInterface()=default
virtual destructor
Definition: SolverInfo.hpp:11
virtual void exit()=0
Is called at the end of a solution procedure.
Interface for Runner / Worker types used in solver classes.
Definition: RunnerInterface.hpp:11