20#ifndef OPM_GPUSOLVER_BACKEND_HEADER_INCLUDED
21#define OPM_GPUSOLVER_BACKEND_HEADER_INCLUDED
24#include <opm/simulators/linalg/gpubridge/GpuResult.hpp>
25#include <opm/simulators/linalg/gpubridge/BlockedMatrix.hpp>
31template<
class Scalar>
class WellContributions;
33namespace Accelerator {
35enum class SolverStatus {
37 GPU_SOLVER_ANALYSIS_FAILED,
38 GPU_SOLVER_CREATE_PRECONDITIONER_FAILED,
39 GPU_SOLVER_UNKNOWN_ERROR
44template<
class Scalar,
unsigned int block_size>
56 Scalar tolerance = 1
e-2;
63 unsigned int platformID = 0;
64 unsigned int deviceID = 0;
66 bool initialized =
false;
78 , tolerance(tolerance_)
81 Scalar tolerance_,
unsigned int deviceID_)
84 , tolerance(tolerance_)
91 , tolerance(tolerance_)
106 virtual void get_result(Scalar* x) = 0;
This struct resembles a blocked csr matrix, like Dune::BCRSMatrix.
Definition BlockedMatrix.hpp:29
This class is based on InverseOperatorResult struct from dune/istl/solver.hh It is needed to prevent ...
Definition GpuResult.hpp:31
This class serves to simplify choosing between different backend solvers, such as cusparseSolver and ...
Definition GpuSolver.hpp:46
virtual ~GpuSolver()=default
Define virtual destructor, so that the derivedclass destructor will be called.
virtual SolverStatus solve_system(std::shared_ptr< BlockedMatrix< Scalar > > matrix, Scalar *b, std::shared_ptr< BlockedMatrix< Scalar > > jacMatrix, WellContributions< Scalar > &wellContribs, GpuResult &res)=0
Define as pure virtual functions, so derivedclass must implement them.
GpuSolver(int linear_solver_verbosity, int max_it, Scalar tolerance_)
Construct a GpuSolver.
Definition GpuSolver.hpp:75
This class serves to eliminate the need to include the WellContributions into the matrix (with –matri...
Definition WellContributions.hpp:51
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242