opm-simulators
Loading...
Searching...
No Matches
Hypre::HyprePreconditioner< M, X, Y, Comm > Class Template Reference

Wrapper for Hypre's BoomerAMG preconditioner. More...

#include <HyprePreconditioner.hpp>

Inheritance diagram for Hypre::HyprePreconditioner< M, X, Y, Comm >:
Dune::PreconditionerWithUpdate< 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

 HyprePreconditioner (const M &A, const Opm::PropertyTree prm, const Comm &comm)
 Constructor for the HyprePreconditioner class.
 ~HyprePreconditioner ()
 Destructor for HyprePreconditioner.
void update () override
 Updates the preconditioner with the current matrix values.
void pre (X &v, 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.
Dune::SolverCategory::Category category () const override
 Returns the solver category.
bool hasPerfectUpdate () const override
 Checks if the preconditioner has a perfect update.

Detailed Description

template<class M, class X, class Y, class Comm>
class Hypre::HyprePreconditioner< M, X, Y, Comm >

Wrapper for Hypre's BoomerAMG preconditioner.

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

Supports four use cases:

  1. Input type is CPU and backend acceleration is CPU
  2. Input type is CPU and backend acceleration is GPU
  3. Input type is GPU and backend acceleration is GPU
  4. Input type is GPU and backend acceleration is CPU
Template Parameters
MThe matrix type
XThe vector type for the solution
YThe vector type for the right-hand side

Constructor & Destructor Documentation

◆ HyprePreconditioner()

template<class M, class X, class Y, class Comm>
Hypre::HyprePreconditioner< M, X, Y, Comm >::HyprePreconditioner ( const M & A,
const Opm::PropertyTree prm,
const Comm & comm )
inline

Constructor for the HyprePreconditioner 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.
commParallel communicator.

◆ ~HyprePreconditioner()

template<class M, class X, class Y, class Comm>
Hypre::HyprePreconditioner< M, X, Y, Comm >::~HyprePreconditioner ( )
inline

Destructor for HyprePreconditioner.

Cleans up resources allocated by the preconditioner.

Member Function Documentation

◆ apply()

template<class M, class X, class Y, class Comm>
void Hypre::HyprePreconditioner< M, X, Y, Comm >::apply ( X & v,
const Y & d )
inlineoverride

Applies the preconditioner to a vector.

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

Parameters
vThe update vector.
dThe defect vector.

◆ category()

template<class M, class X, class Y, class Comm>
Dune::SolverCategory::Category Hypre::HyprePreconditioner< M, X, Y, Comm >::category ( ) const
inlineoverride

Returns the solver category.

Returns
The solver category, which is sequential.

◆ hasPerfectUpdate()

template<class M, class X, class Y, class Comm>
bool Hypre::HyprePreconditioner< M, X, Y, Comm >::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, class Comm>
void Hypre::HyprePreconditioner< M, X, Y, Comm >::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, class Comm>
void Hypre::HyprePreconditioner< M, X, Y, Comm >::pre ( X & v,
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, class Comm>
void Hypre::HyprePreconditioner< M, X, Y, Comm >::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 >.


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