opm-simulators
Loading...
Searching...
No Matches
Opm::Accelerator::amgclSolverBackend< Scalar, block_size > Class Template Reference

This class does not implement a solver, but converts the BCSR format to normal CSR and uses amgcl for solving Note amgcl also implements blocked solvers, but looks like it needs unblocked input data. More...

#include <amgclSolverBackend.hpp>

Inheritance diagram for Opm::Accelerator::amgclSolverBackend< Scalar, block_size >:
Opm::Accelerator::GpuSolver< Scalar, block_size >

Public Member Functions

 amgclSolverBackend (int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID)
 Construct an amgcl solver.
 ~amgclSolverBackend () override
 Destroy a openclSolver, and free memory.
SolverStatus solve_system (std::shared_ptr< BlockedMatrix< Scalar > > matrix, Scalar *b, std::shared_ptr< BlockedMatrix< Scalar > > jacMatrix, WellContributions< Scalar > &wellContribs, GpuResult &res) override
 Solve linear system, A*x = b, matrix A must be in blocked-CSR format.
void get_result (Scalar *x) override
 Get result after linear solve, and peform postprocessing if necessary.
Public Member Functions inherited from Opm::Accelerator::GpuSolver< Scalar, block_size >
 GpuSolver (int linear_solver_verbosity, int max_it, Scalar tolerance_)
 Construct a GpuSolver.
 GpuSolver (int linear_solver_verbosity, int max_it, Scalar tolerance_, unsigned int deviceID_)
 GpuSolver (int linear_solver_verbosity, int max_it, double tolerance_, unsigned int platformID_, unsigned int deviceID_)
virtual ~GpuSolver ()=default
 Define virtual destructor, so that the derivedclass destructor will be called.

Additional Inherited Members

Protected Attributes inherited from Opm::Accelerator::GpuSolver< Scalar, block_size >
int verbosity = 0
int maxit = 200
Scalar tolerance = 1e-2
int N
int Nb
int nnz
int nnzb
unsigned int platformID = 0
unsigned int deviceID = 0
bool initialized = false

Detailed Description

template<class Scalar, unsigned int block_size>
class Opm::Accelerator::amgclSolverBackend< Scalar, block_size >

This class does not implement a solver, but converts the BCSR format to normal CSR and uses amgcl for solving Note amgcl also implements blocked solvers, but looks like it needs unblocked input data.

Constructor & Destructor Documentation

◆ amgclSolverBackend()

template<class Scalar, unsigned int block_size>
Opm::Accelerator::amgclSolverBackend< Scalar, block_size >::amgclSolverBackend ( int linear_solver_verbosity,
int maxit,
Scalar tolerance,
unsigned int platformID,
unsigned int deviceID )

Construct an amgcl solver.

Parameters
[in]linear_solver_verbosityverbosity of amgclSolver
[in]maxitmaximum number of iterations for amgclSolver
[in]tolerancerequired relative tolerance for amgclSolver
[in]platformIDthe OpenCL platform to be used
[in]deviceIDthe device to be used

Member Function Documentation

◆ get_result()

template<class Scalar, unsigned int block_size>
void Opm::Accelerator::amgclSolverBackend< Scalar, block_size >::get_result ( Scalar * x)
overridevirtual

Get result after linear solve, and peform postprocessing if necessary.

Parameters
[in,out]xresulting x vector, caller must guarantee that x points to a valid array

Implements Opm::Accelerator::GpuSolver< Scalar, block_size >.

◆ solve_system()

template<class Scalar, unsigned int block_size>
SolverStatus Opm::Accelerator::amgclSolverBackend< Scalar, block_size >::solve_system ( std::shared_ptr< BlockedMatrix< Scalar > > matrix,
Scalar * b,
std::shared_ptr< BlockedMatrix< Scalar > > jacMatrix,
WellContributions< Scalar > & wellContribs,
GpuResult & res )
overridevirtual

Solve linear system, A*x = b, matrix A must be in blocked-CSR format.

Parameters
[in]matrixmatrix A
[in]binput vector, contains N values
[in]jacMatrixmatrix for preconditioner
[in]wellContribsWellContributions, to apply them separately, instead of adding them to matrix A
[in,out]ressummary of solver result
Returns
status code

Implements Opm::Accelerator::GpuSolver< Scalar, block_size >.


The documentation for this class was generated from the following files:
  • opm/simulators/linalg/gpubridge/amgclSolverBackend.hpp
  • opm/simulators/linalg/gpubridge/amgclSolverBackend.cpp