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 the AmgxPreconditioner class. More...
 
 ~AmgxPreconditioner ()
 Destructor for the AmgxPreconditioner class. 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.

Template Parameters
MThe matrix type the preconditioner is for.
XThe type of the update vector.
YThe type of the defect vector.

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

Constructor for the AmgxPreconditioner class.

Initializes the preconditioner with the given matrix and property tree.

Parameters
AThe matrix for which the preconditioner is constructed.
prmThe property tree containing configuration parameters.

References Amgx::AmgxPreconditioner< M, X, Y >::block_size, Opm::PropertyTree::get(), Amgx::AmgxConfig::toString(), and Amgx::AmgxPreconditioner< M, X, Y >::update().

◆ ~AmgxPreconditioner()

template<class M , class X , class Y >
Amgx::AmgxPreconditioner< M, X, Y >::~AmgxPreconditioner ( )
inline

Destructor for the AmgxPreconditioner class.

Cleans up resources allocated by the preconditioner.

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 downloading the result.

Parameters
vThe update vector.
dThe defect vector.

References Amgx::AmgxPreconditioner< M, X, Y >::block_size.

◆ 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, which is 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, indicating that 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 >.

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: