20 #ifndef OPM_BDASOLVER_BACKEND_HEADER_INCLUDED
21 #define OPM_BDASOLVER_BACKEND_HEADER_INCLUDED
24 #include <opm/simulators/linalg/bda/BdaResult.hpp>
25 #include <opm/simulators/linalg/bda/WellContributions.hpp>
32 enum class SolverStatus {
34 BDA_SOLVER_ANALYSIS_FAILED,
35 BDA_SOLVER_CREATE_PRECONDITIONER_FAILED,
36 BDA_SOLVER_UNKNOWN_ERROR
41 template <
unsigned int block_size>
56 double tolerance = 1e-2;
58 std::string bitstream =
"";
65 unsigned int platformID = 0;
66 unsigned int deviceID = 0;
68 bool initialized =
false;
78 BdaSolver(
int linear_solver_verbosity,
int max_it,
double tolerance_,
unsigned int deviceID_) : verbosity(linear_solver_verbosity), maxit(max_it), tolerance(tolerance_), deviceID(deviceID_) {};
79 BdaSolver(
int linear_solver_verbosity,
int max_it,
double tolerance_,
unsigned int platformID_,
unsigned int deviceID_) : verbosity(linear_solver_verbosity), maxit(max_it), tolerance(tolerance_), platformID(platformID_), deviceID(deviceID_) {};
80 BdaSolver(std::string fpga_bitstream,
int linear_solver_verbosity,
int max_it,
double tolerance_) : verbosity(linear_solver_verbosity), maxit(max_it), tolerance(tolerance_), bitstream(fpga_bitstream) {};
87 double *vals,
int *rows,
int *cols,
90 virtual void get_result(
double *x) = 0;
This class serves to eliminate the need to include the WellContributions into the matrix (with –matri...
Definition: WellContributions.hpp:61
This class is based on InverseOperatorResult struct from dune/istl/solver.hh It is needed to prevent ...
Definition: BdaResult.hpp:29
This class serves to simplify choosing between different backend solvers, such as cusparseSolver and ...
Definition: BdaSolver.hpp:43
BdaSolver(int linear_solver_verbosity, int max_it, double tolerance_, unsigned int deviceID_)
Construct a BdaSolver, can be cusparseSolver, openclSolver, fpgaSolver.
Definition: BdaSolver.hpp:78
virtual SolverStatus solve_system(int N, int nnz, int dim, double *vals, int *rows, int *cols, double *b, WellContributions &wellContribs, BdaResult &res)=0
Define as pure virtual functions, so derivedclass must implement them.
virtual ~BdaSolver()
Define virtual destructor, so that the derivedclass destructor will be called.
Definition: BdaSolver.hpp:83