Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace > Class Template Reference

Jacobi solver. More...

#include <Cabana_Grid_HypreStructuredSolver.hpp>

Inheritance diagram for Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >:
Collaboration diagram for Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >:

Public Types

using base_type = HypreStructuredSolver<Scalar, EntityType, MemorySpace>
 Base HYPRE structured solver type.
 
- Public Types inherited from Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >
using entity_type = EntityType
 Entity type.
 
using memory_space = MemorySpace
 Kokkos memory space..
 
using value_type = Scalar
 Scalar value type.
 

Public Member Functions

template<class ArrayLayout_t>
 HypreStructJacobi (const ArrayLayout_t &layout, const bool is_preconditioner=false)
 Constructor.
 
HYPRE_StructSolver getHypreSolver () const override
 Get the preconditioner.
 
HYPRE_PtrToStructSolverFcn getHypreSetupFunction () const override
 Get the preconditioner setup function.
 
HYPRE_PtrToStructSolverFcn getHypreSolveFunction () const override
 Get the preconditioner solve function.
 
- Public Member Functions inherited from Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >
template<class ArrayLayout_t>
 HypreStructuredSolver (const ArrayLayout_t &layout, const bool is_preconditioner=false)
 Hypre memory space compatibility check.
 
bool isPreconditioner () const
 Return if this solver is a preconditioner.
 
template<std::size_t NumSpaceDim>
void setMatrixStencil (const std::vector< std::array< int, NumSpaceDim > > &stencil, const bool is_symmetric=false)
 Set the operator stencil.
 
template<class Array_t>
void setMatrixValues (const Array_t &values)
 Set the matrix values.
 
void printMatrix (const char *prefix)
 Print the hypre matrix to output file.
 
void printLHS (const char *prefix)
 Print the hypre LHS to output file.
 
void printRHS (const char *prefix)
 Print the hypre RHS to output file.
 
void setTolerance (const double tol)
 Set convergence tolerance implementation.
 
void setMaxIter (const int max_iter)
 Set maximum iteration implementation.
 
void setPrintLevel (const int print_level)
 Set the output level.
 
void setPreconditioner (const std::shared_ptr< HypreStructuredSolver< Scalar, EntityType, MemorySpace > > &preconditioner)
 Set a preconditioner.
 
void setup ()
 Setup the problem.
 
template<class Array_t>
void solve (const Array_t &b, Array_t &x)
 Solve the problem Ax = b for x.
 
int getNumIter ()
 Get the number of iterations taken on the last solve.
 
double getFinalRelativeResidualNorm ()
 Get the relative residual norm achieved on the last solve.
 

Protected Member Functions

void setToleranceImpl (const double tol) override
 Set convergence tolerance implementation.
 
void setMaxIterImpl (const int max_iter) override
 Set maximum iteration implementation.
 
void setPrintLevelImpl (const int) override
 Set the output level.
 
void setupImpl () override
 Setup implementation.
 
void solveImpl () override
 Solver implementation.
 
int getNumIterImpl () override
 Get the number of iterations taken on the last solve.
 
double getFinalRelativeResidualNormImpl () override
 Get the relative residual norm achieved on the last solve.
 
void setPreconditionerImpl (const HypreStructuredSolver< Scalar, EntityType, MemorySpace > &) override
 Set a preconditioner.
 
- Protected Member Functions inherited from Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >
void checkHypreError (const int error) const
 Check a hypre error.
 

Additional Inherited Members

- Protected Attributes inherited from Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >
HYPRE_StructMatrix _A
 Matrix for the problem Ax = b.
 
HYPRE_StructVector _b
 Forcing term for the problem Ax = b.
 
HYPRE_StructVector _x
 Solution to the problem Ax = b.
 

Detailed Description

template<class Scalar, class EntityType, class MemorySpace>
class Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >

Jacobi solver.

Member Function Documentation

◆ getFinalRelativeResidualNormImpl()

template<class Scalar, class EntityType, class MemorySpace>
double Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::getFinalRelativeResidualNormImpl ( )
inlineoverrideprotectedvirtual

Get the relative residual norm achieved on the last solve.

Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.

◆ getHypreSetupFunction()

template<class Scalar, class EntityType, class MemorySpace>
HYPRE_PtrToStructSolverFcn Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::getHypreSetupFunction ( ) const
inlineoverridevirtual

Get the preconditioner setup function.

Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.

◆ getHypreSolveFunction()

template<class Scalar, class EntityType, class MemorySpace>
HYPRE_PtrToStructSolverFcn Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::getHypreSolveFunction ( ) const
inlineoverridevirtual

Get the preconditioner solve function.

Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.

◆ getHypreSolver()

template<class Scalar, class EntityType, class MemorySpace>
HYPRE_StructSolver Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::getHypreSolver ( ) const
inlineoverridevirtual

◆ getNumIterImpl()

template<class Scalar, class EntityType, class MemorySpace>
int Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::getNumIterImpl ( )
inlineoverrideprotectedvirtual

Get the number of iterations taken on the last solve.

Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.

◆ setMaxIterImpl()

template<class Scalar, class EntityType, class MemorySpace>
void Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::setMaxIterImpl ( const int max_iter)
inlineoverrideprotectedvirtual

Set maximum iteration implementation.

Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.

◆ setPreconditionerImpl()

template<class Scalar, class EntityType, class MemorySpace>
void Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::setPreconditionerImpl ( const HypreStructuredSolver< Scalar, EntityType, MemorySpace > & preconditioner)
inlineoverrideprotectedvirtual

◆ setPrintLevelImpl()

template<class Scalar, class EntityType, class MemorySpace>
void Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::setPrintLevelImpl ( const int print_level)
inlineoverrideprotectedvirtual

◆ setToleranceImpl()

template<class Scalar, class EntityType, class MemorySpace>
void Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::setToleranceImpl ( const double tol)
inlineoverrideprotectedvirtual

Set convergence tolerance implementation.

Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.

◆ setupImpl()

template<class Scalar, class EntityType, class MemorySpace>
void Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::setupImpl ( )
inlineoverrideprotectedvirtual

◆ solveImpl()

template<class Scalar, class EntityType, class MemorySpace>
void Cabana::Grid::HypreStructJacobi< Scalar, EntityType, MemorySpace >::solveImpl ( )
inlineoverrideprotectedvirtual

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