Amgx::AmgxPreconditioner< M, X, Y > Class Template Reference

Wrapper for AMGX's AMG preconditioner. More...

#include <AmgxPreconditioner.hpp>

Inheritance diagram for Amgx::AmgxPreconditioner< M, X, Y >:
Inheritance graph

Public Types

using matrix_type = M
 The matrix type the preconditioner is for. More...
 
using matrix_field_type = typename M::field_type
 The field type of the matrix. More...
 
using domain_type = X
 The domain type of the preconditioner. More...
 
using range_type = Y
 The range type of the preconditioner. More...
 
using vector_field_type = typename X::field_type
 The field type of the vectors. More...
 

Public Member Functions

 AmgxPreconditioner (const M &A, const Opm::PropertyTree prm)
 Constructor for AmgxPreconditioner. More...
 
 ~AmgxPreconditioner ()
 Destructor for AmgxPreconditioner. More...
 
void pre (X &, Y &) override
 Pre-processing step before applying the preconditioner. More...
 
void apply (X &v, const Y &d) override
 Applies the preconditioner to a vector. More...
 
void post (X &) override
 Post-processing step after applying the preconditioner. More...
 
void update () override
 Updates the preconditioner with the current matrix values. More...
 
Dune::SolverCategory::Category category () const override
 Returns the solver category. More...
 
bool hasPerfectUpdate () const override
 Checks if the preconditioner has a perfect update. More...
 

Static Public Attributes

static constexpr int block_size = 1
 

Detailed Description

template<class M, class X, class Y>
class Amgx::AmgxPreconditioner< M, X, Y >

Wrapper for AMGX's AMG preconditioner.

This class provides an interface to the AMG preconditioner from the AMGX library. It is designed to work with matrices, update vectors, and defect vectors specified by the template parameters. The AmgxInterface class provides a unified interface to AMGX's functionality, allowing for easy switching between CPU and GPU input data types.

Template Parameters
MThe matrix type
XThe vector type for the solution
YThe vector type for the right-hand side

Member Typedef Documentation

◆ domain_type

template<class M , class X , class Y >
using Amgx::AmgxPreconditioner< M, X, Y >::domain_type = X

The domain type of the preconditioner.

◆ matrix_field_type

template<class M , class X , class Y >
using Amgx::AmgxPreconditioner< M, X, Y >::matrix_field_type = typename M::field_type

The field type of the matrix.

◆ matrix_type

template<class M , class X , class Y >
using Amgx::AmgxPreconditioner< M, X, Y >::matrix_type = M

The matrix type the preconditioner is for.

◆ range_type

template<class M , class X , class Y >
using Amgx::AmgxPreconditioner< M, X, Y >::range_type = Y

The range type of the preconditioner.

◆ vector_field_type

template<class M , class X , class Y >
using Amgx::AmgxPreconditioner< M, X, Y >::vector_field_type = typename X::field_type

The field type of the vectors.

Constructor & Destructor Documentation

◆ AmgxPreconditioner()

template<class M , class X , class Y >
Amgx::AmgxPreconditioner< M, X, Y >::AmgxPreconditioner ( const M &  A,
const Opm::PropertyTree  prm 
)
inline

◆ ~AmgxPreconditioner()

Member Function Documentation

◆ apply()

template<class M , class X , class Y >
void Amgx::AmgxPreconditioner< M, X, Y >::apply ( X &  v,
const Y &  d 
)
inlineoverride

Applies the preconditioner to a vector.

Performs one AMG cycle to solve the system. Involves uploading vectors to AMGX, applying the preconditioner, and transferring the result back to the vector.

Parameters
vThe update vector.
dThe defect vector.

References Opm::gpuistl::AmgxInterface::transferVectorFromAmgx(), and Opm::gpuistl::AmgxInterface::transferVectorToAmgx().

◆ category()

template<class M , class X , class Y >
Dune::SolverCategory::Category Amgx::AmgxPreconditioner< M, X, Y >::category ( ) const
inlineoverride

Returns the solver category.

Returns
The solver category (sequential).

◆ hasPerfectUpdate()

template<class M , class X , class Y >
bool Amgx::AmgxPreconditioner< M, X, Y >::hasPerfectUpdate ( ) const
inlineoverridevirtual

Checks if the preconditioner has a perfect update.

Returns
True, as the preconditioner can be perfectly updated.

Implements Dune::PreconditionerWithUpdate< X, Y >.

◆ post()

template<class M , class X , class Y >
void Amgx::AmgxPreconditioner< M, X, Y >::post ( X &  )
inlineoverride

Post-processing step after applying the preconditioner.

This method is currently a no-op.

Parameters
vThe update vector.

◆ pre()

template<class M , class X , class Y >
void Amgx::AmgxPreconditioner< M, X, Y >::pre ( X &  ,
Y &   
)
inlineoverride

Pre-processing step before applying the preconditioner.

This method is currently a no-op.

Parameters
vThe update vector.
dThe defect vector.

◆ update()

template<class M , class X , class Y >
void Amgx::AmgxPreconditioner< M, X, Y >::update ( )
inlineoverridevirtual

Updates the preconditioner with the current matrix values.

This method should be called whenever the matrix values change.

Implements Dune::PreconditionerWithUpdate< X, Y >.

References Opm::gpuistl::AmgxInterface::updateMatrixValues().

Referenced by Amgx::AmgxPreconditioner< M, X, Y >::AmgxPreconditioner().

Member Data Documentation

◆ block_size

template<class M , class X , class Y >
constexpr int Amgx::AmgxPreconditioner< M, X, Y >::block_size = 1
staticconstexpr

The documentation for this class was generated from the following file: