Loading...
Searching...
No Matches
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 >:

## Public Types

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

## Public Member Functions

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

## 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

  M | The matrix type
  X | The vector type for the solution
  Y | The vector type for the right-hand side

## 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 AmgxPreconditioner.

Initializes the AMGX preconditioner with the given matrix and property tree.

Parameters

  A | The matrix for which to construct the preconditioner
  prm | The property tree containing configuration parameters

## ~AmgxPreconditioner()

template<class M, class X, class Y>

Amgx::AmgxPreconditioner< M, X, Y >::~AmgxPreconditioner | ( |  | ) |

inline

Destructor for AmgxPreconditioner.

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 )

inline override

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

  v | The update vector.
  d | The defect vector.

## category()

template<class M, class X, class Y>

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

inline override

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

inline override virtual

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 & |  | ) |

inline override

Post-processing step after applying the preconditioner.

This method is currently a no-op.

Parameters

  v | The update vector.

## pre()

template<class M, class X, class Y>

void Amgx::AmgxPreconditioner< M, X, Y >::pre | ( | X & | ,
|  | Y & | )

inline override

Pre-processing step before applying the preconditioner.

This method is currently a no-op.

Parameters

  v | The update vector.
  d | The defect vector.

## update()

template<class M, class X, class Y>

void Amgx::AmgxPreconditioner< M, X, Y >::update | ( |  | ) |

inline override virtual

Updates the preconditioner with the current matrix values.

This method should be called whenever the matrix values change.

Implements Dune::PreconditionerWithUpdate< X, Y >.

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

- opm/simulators/linalg/AmgxPreconditioner.hpp