GEOS
Typedefs | Enumerations | Functions | Variables
geos::hypre Namespace Reference

Contains some hypre-specific functions. More...

Typedefs

using execPolicy = parallelDevicePolicy<>
 Execution policy for operations on hypre data.
 

Enumerations

enum class  AMGCoarseningType : HYPRE_Int {
  CLJP = 0 , Ruge_Stueben = 3 , Falgout = 6 , CLJPDebug = 7 ,
  PMIS = 8 , PMISDebug = 9 , HMIS = 10 , CGC = 21 ,
  CGC_E = 22
}
 This enum class specifies the AMG parallel coarsening algorithm. More...
 
enum class  MGRInterpolationType : HYPRE_Int {
  injection = 0 , l1jacobi = 1 , jacobi = 2 , classicalModifiedInterpolation = 3 ,
  approximateInverse = 4 , blockJacobi = 12
}
 This enum class specifies the strategy for computing the level intepolation operator in MGR. More...
 
enum class  MGRRestrictionType : HYPRE_Int {
  injection = 0 , jacobi = 2 , approximateInverse = 3 , blockJacobi = 12 ,
  cprLike = 13 , blockColLumped = 14
}
 This enum class specifies the strategy for computing the level restriction operator in MGR. More...
 
enum class  MGRCoarseGridMethod : HYPRE_Int {
  galerkin = 0 , nonGalerkin = 1 , cprLikeDiag = 2 , cprLikeBlockDiag = 3 ,
  approximateInverse = 4
}
 This enum class specifies the strategy for level coarse grid computation in MGR. More...
 
enum class  MGRFRelaxationType : HYPRE_Int {
  none = -1 , singleVCycleSmoother = 1 , amgVCycle = 2 , forwardHybridGaussSeidel = 3 ,
  backwardHybridGaussSeidel = 4 , hybridSymmetricGaussSeidel = 6 , jacobi = 7 , l1hybridSymmetricGaussSeidel = 8 ,
  gsElim = 9 , l1forwardGaussSeidel = 13 , l1backwardGaussSeidel = 14 , l1jacobi = 18 ,
  gsElimWPivoting = 99 , gsElimWInverse = 199
}
 This enum class specifies the F-relaxation type. More...
 
enum class  MGRGlobalSmootherType : HYPRE_Int {
  none = -1 , blockJacobi = 0 , blockGaussSeidel = 1 , jacobi = 2 ,
  ilu0 = 16
}
 This enum class specifies the global smoother type. More...
 

Functions

constexpr HYPRE_MemoryLocation getMemoryLocation (LvArray::MemorySpace const space)
 
constexpr LvArray::MemorySpace getLvArrayMemorySpace (HYPRE_MemoryLocation const location)
 
void checkDeviceErrors (char const *msg, char const *file, int const line)
 
HYPRE_BigInt * toHypreBigInt (geos::globalIndex *const index)
 Converts a non-const array from GEOSX globalIndex type to HYPRE_BigInt. More...
 
HYPRE_BigInt const * toHypreBigInt (geos::globalIndex const *const index)
 Converts a const array from GEOSX globalIndex type to HYPRE_BigInt. More...
 
HYPRE_Vector parVectorToVectorAll (HYPRE_ParVector const vec)
 Gather a parallel vector on every rank. More...
 
HYPRE_Vector parVectorToVector (HYPRE_ParVector const vec, int const targetRank)
 Gather a parallel vector onto a single rank. More...
 
HYPRE_Int dummySetup (HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
 Dummy function that does nothing but conform to hypre's signature for preconditioner setup/apply functions. More...
 
HYPRE_Int SuperLUDistSolve (HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x)
 The missing wrapper compatible with hypre solver solve signature. More...
 
HYPRE_Int SuperLUDistDestroy (HYPRE_Solver solver)
 The missing wrapper compatible with hypre solver destroy signature. More...
 
HYPRE_Int relaxationCreate (HYPRE_Solver &solver, HYPRE_Int const type)
 Create a relaxation-based smoother. More...
 
HYPRE_Int relaxationSetup (HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x)
 Setup a relaxation-based smoother. More...
 
HYPRE_Int relaxationSolve (HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x)
 Solve with a relaxation-based smoother. More...
 
HYPRE_Int relaxationDestroy (HYPRE_Solver solver)
 Destroy a relaxation-based smoother. More...
 
HYPRE_Int chebyshevCreate (HYPRE_Solver &solver, HYPRE_Int const order, HYPRE_Int const eigNumIter)
 Create a Chebyshev smoother. More...
 
HYPRE_Int chebyshevSetup (HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x)
 Setup a Chebyshev smoother. More...
 
HYPRE_Int chebyshevSolve (HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x)
 Solve with a Chebyshev smoother. More...
 
HYPRE_Int chebyshevDestroy (HYPRE_Solver solver)
 Destroy a Chebyshev smoother. More...
 
HYPRE_Int getAMGCycleType (LinearSolverParameters::AMG::CycleType const &type)
 Returns hypre's identifier of the AMG cycle type. More...
 
HYPRE_Int getAMGRelaxationType (LinearSolverParameters::AMG::SmootherType const &type)
 Returns hypre's identifier of the AMG smoother type. More...
 
HYPRE_Int getAMGInterpolationType (LinearSolverParameters::AMG::InterpType const &type)
 Returns hypre's identifier of the AMG interpolation type. More...
 
HYPRE_Int getAMGAggressiveInterpolationType (LinearSolverParameters::AMG::AggInterpType const &type)
 Returns hypre's identifier of the AMG aggressive interpolation type. More...
 
HYPRE_Int getILUType (LinearSolverParameters::AMG::SmootherType const type)
 Returns hypre's identifier of the AMG ILU smoother type. More...
 
HYPRE_Int getAMGCoarseType (LinearSolverParameters::AMG::CoarseType const &type)
 Returns hypre's identifier of the AMG coarse solver type. More...
 
HYPRE_Int getAMGCoarseningType (LinearSolverParameters::AMG::CoarseningType const &type)
 Returns hypre's identifier of the AMG coarsening type. More...
 
HYPRE_Int getRelaxationType (LinearSolverParameters::PreconditionerType const type)
 Returns hypre's identifier of the relaxation preconditioner type. More...
 
HYPRE_Int getILUType (LinearSolverParameters::PreconditionerType const type)
 Returns hypre's identifier of the ILU preconditioner type. More...
 

Variables

constexpr LvArray::MemorySpace memorySpace = parallelDeviceMemorySpace
 Memory space used by hypre matrix/vector objects.
 
constexpr HYPRE_MemoryLocation memoryLocation = HYPRE_MEMORY_DEVICE
 Memory location used by hypre matrix/vector objects.
 

Detailed Description

Contains some hypre-specific functions.

Enumeration Type Documentation

◆ AMGCoarseningType

enum geos::hypre::AMGCoarseningType : HYPRE_Int
strong

This enum class specifies the AMG parallel coarsening algorithm.

Enumerator
CLJP 

Parallel coarsening algorithm using independent sets.

Ruge_Stueben 

Classical Ruge-Stueben coarsening on each processor.

Falgout 

Uses Ruge_Stueben first, followed by CLJP.

CLJPDebug 

Using a fixed random vector, for debugging purposes only.

PMIS 

Parallel coarsening algorithm using independent sets.

PMISDebug 

Using a fixed random vector, for debugging purposes only.

HMIS 

Uses one pass Ruge-Stueben on each processor independently, followed by PMIS.

CGC 

Coarsening by M. Griebel, B. Metsch and A. Schweitzer.

CGC_E 

Coarsening by M. Griebel, B. Metsch and A. Schweitzer.

Definition at line 520 of file HypreUtils.hpp.

◆ MGRCoarseGridMethod

enum geos::hypre::MGRCoarseGridMethod : HYPRE_Int
strong

This enum class specifies the strategy for level coarse grid computation in MGR.

Enumerator
galerkin 

Galerkin coarse grid computation using RAP.

nonGalerkin 

Non-Galerkin coarse grid computation with dropping strategy: inv(A_FF) approximated by its (block) diagonal inverse

cprLikeDiag 

Non-Galerkin coarse grid computation with dropping strategy: CPR-like approximation with inv(A_FF) approximated by its diagonal inverse

cprLikeBlockDiag 

Non-Galerkin coarse grid computation with dropping strategy: CPR-like approximation with inv(A_FF) approximated by its block diagonal inverse

approximateInverse 

Non-Galerkin coarse grid computation with dropping strategy: inv(A_FF) approximated by sparse approximate inverse

Definition at line 566 of file HypreUtils.hpp.

◆ MGRFRelaxationType

enum geos::hypre::MGRFRelaxationType : HYPRE_Int
strong

This enum class specifies the F-relaxation type.

Enumerator
none 

no F-relaxation if performed

singleVCycleSmoother 

V(1,0) cycle smoother.

amgVCycle 

Full AMG VCycle solver.

forwardHybridGaussSeidel 

hybrid Gauss-Seidel or SOR, forward solve

backwardHybridGaussSeidel 

hybrid Gauss-Seidel or SOR, backward solve

hybridSymmetricGaussSeidel 

hybrid symmetric Gauss-Seidel or SSOR

jacobi 

Jacobi.

l1hybridSymmetricGaussSeidel 

$\ell_1$-scaled hybrid symmetric Gauss-Seidel

gsElim 

Gaussian Elimination direct solver (for small systems)

l1forwardGaussSeidel 

$\ell_1$ Gauss-Seidel, forward solve

l1backwardGaussSeidel 

$\ell_1$ Gauss-Seidel, backward solve

l1jacobi 

$\ell_1$-scaled Jacobi

gsElimWPivoting 

Gaussian Elimination with pivoting direct solver (for small systems)

gsElimWInverse 

Direct Inversion with Gaussian Elimination (OK for larger systems)

Definition at line 583 of file HypreUtils.hpp.

◆ MGRGlobalSmootherType

enum geos::hypre::MGRGlobalSmootherType : HYPRE_Int
strong

This enum class specifies the global smoother type.

Enumerator
none 

no global smoothing is performed (default)

blockJacobi 

block Jacobi

blockGaussSeidel 

block Jacobi

jacobi 

Jacobi.

ilu0 

incomplete LU factorization

Definition at line 605 of file HypreUtils.hpp.

◆ MGRInterpolationType

enum geos::hypre::MGRInterpolationType : HYPRE_Int
strong

This enum class specifies the strategy for computing the level intepolation operator in MGR.

Enumerator
injection 

Injection $[0 I]^{T}$.

l1jacobi 

l1 Jacobi

jacobi 

Diagonal scaling.

classicalModifiedInterpolation 

Classical modified interpolation.

approximateInverse 

Approximate inverse.

blockJacobi 

Block-Jacobi.

Definition at line 537 of file HypreUtils.hpp.

◆ MGRRestrictionType

enum geos::hypre::MGRRestrictionType : HYPRE_Int
strong

This enum class specifies the strategy for computing the level restriction operator in MGR.

Enumerator
injection 

Injection $[0 I]$.

jacobi 

Diagonal scaling.

approximateInverse 

Approximate inverse.

blockJacobi 

Block-Jacobi.

cprLike 

CPR-like restriction.

blockColLumped 

Block column-lumped approximation.

Definition at line 552 of file HypreUtils.hpp.

Function Documentation

◆ chebyshevCreate()

HYPRE_Int geos::hypre::chebyshevCreate ( HYPRE_Solver &  solver,
HYPRE_Int const  order,
HYPRE_Int const  eigNumIter 
)

Create a Chebyshev smoother.

Parameters
solverthe solver
orderChebyshev order (degree)
eigNumIternumber of eigenvalue estimation iterations
Returns
always 0

◆ chebyshevDestroy()

HYPRE_Int geos::hypre::chebyshevDestroy ( HYPRE_Solver  solver)

Destroy a Chebyshev smoother.

Parameters
solverthe solver
Returns
always 0

◆ chebyshevSetup()

HYPRE_Int geos::hypre::chebyshevSetup ( HYPRE_Solver  solver,
HYPRE_ParCSRMatrix  A,
HYPRE_ParVector  b,
HYPRE_ParVector  x 
)

Setup a Chebyshev smoother.

Parameters
solverthe solver
Athe matrix
bthe rhs vector (unused)
xthe solution vector (unused)
Returns
hypre error code

◆ chebyshevSolve()

HYPRE_Int geos::hypre::chebyshevSolve ( HYPRE_Solver  solver,
HYPRE_ParCSRMatrix  A,
HYPRE_ParVector  b,
HYPRE_ParVector  x 
)

Solve with a Chebyshev smoother.

Parameters
solverthe solver
Athe matrix
bthe rhs vector (unused)
xthe solution vector (unused)
Returns
hypre error code

◆ checkDeviceErrors()

void geos::hypre::checkDeviceErrors ( char const *  msg,
char const *  file,
int const  line 
)
inline
Parameters
msg
file
line

Definition at line 154 of file HypreUtils.hpp.

◆ dummySetup()

HYPRE_Int geos::hypre::dummySetup ( HYPRE_Solver  ,
HYPRE_ParCSRMatrix  ,
HYPRE_ParVector  ,
HYPRE_ParVector   
)

Dummy function that does nothing but conform to hypre's signature for preconditioner setup/apply functions.

Returns
always 0 (success)

Typical use is to prevent hypre from calling preconditioner setup when we have already called it on out side.

◆ getAMGAggressiveInterpolationType()

HYPRE_Int geos::hypre::getAMGAggressiveInterpolationType ( LinearSolverParameters::AMG::AggInterpType const &  type)
inline

Returns hypre's identifier of the AMG aggressive interpolation type.

Parameters
typeAMG aggressive interpolation type
Returns
hypre AMG aggressive interpolation type identifier code

Definition at line 406 of file HypreUtils.hpp.

◆ getAMGCoarseningType()

HYPRE_Int geos::hypre::getAMGCoarseningType ( LinearSolverParameters::AMG::CoarseningType const &  type)
inline

Returns hypre's identifier of the AMG coarsening type.

Parameters
typeAMG coarsening type
Returns
hypre AMG coarsening type identifier code

Definition at line 467 of file HypreUtils.hpp.

◆ getAMGCoarseType()

HYPRE_Int geos::hypre::getAMGCoarseType ( LinearSolverParameters::AMG::CoarseType const &  type)
inline

Returns hypre's identifier of the AMG coarse solver type.

Parameters
typeAMG coarse solver type
Returns
hypre AMG coarse solver type identifier code

Definition at line 443 of file HypreUtils.hpp.

◆ getAMGCycleType()

HYPRE_Int geos::hypre::getAMGCycleType ( LinearSolverParameters::AMG::CycleType const &  type)
inline

Returns hypre's identifier of the AMG cycle type.

Parameters
typeAMG cycle type
Returns
hypre AMG cycle type identifier code

Definition at line 346 of file HypreUtils.hpp.

◆ getAMGInterpolationType()

HYPRE_Int geos::hypre::getAMGInterpolationType ( LinearSolverParameters::AMG::InterpType const &  type)
inline

Returns hypre's identifier of the AMG interpolation type.

Parameters
typeAMG interpolation type
Returns
hypre AMG interpolation type identifier code

Definition at line 382 of file HypreUtils.hpp.

◆ getAMGRelaxationType()

HYPRE_Int geos::hypre::getAMGRelaxationType ( LinearSolverParameters::AMG::SmootherType const &  type)
inline

Returns hypre's identifier of the AMG smoother type.

Parameters
typeAMG smoother type
Returns
hypre AMG smoother type identifier code

Definition at line 361 of file HypreUtils.hpp.

◆ getILUType() [1/2]

HYPRE_Int geos::hypre::getILUType ( LinearSolverParameters::AMG::SmootherType const  type)
inline

Returns hypre's identifier of the AMG ILU smoother type.

Parameters
typeAMG ILU smoother type
Returns
hypre AMG ILU smoother type identifier code

Definition at line 428 of file HypreUtils.hpp.

◆ getILUType() [2/2]

HYPRE_Int geos::hypre::getILUType ( LinearSolverParameters::PreconditionerType const  type)
inline

Returns hypre's identifier of the ILU preconditioner type.

Parameters
typeILU preconditioner type
Returns
hypre ILU preconditioner type identifier code

Definition at line 506 of file HypreUtils.hpp.

◆ getLvArrayMemorySpace()

constexpr LvArray::MemorySpace geos::hypre::getLvArrayMemorySpace ( HYPRE_MemoryLocation const  location)
constexpr
Returns
LvArray memory space corresponding to hypre's memory location.
Parameters
locationthe location

Definition at line 99 of file HypreUtils.hpp.

◆ getMemoryLocation()

constexpr HYPRE_MemoryLocation geos::hypre::getMemoryLocation ( LvArray::MemorySpace const  space)
constexpr
Returns
Hypre memory location corresponding to a given LvArray memory space.
Parameters
spacethe space

Definition at line 80 of file HypreUtils.hpp.

◆ getRelaxationType()

HYPRE_Int geos::hypre::getRelaxationType ( LinearSolverParameters::PreconditionerType const  type)
inline

Returns hypre's identifier of the relaxation preconditioner type.

Parameters
typerelaxation preconditioner type
Returns
hypre relaxation preconditioner type identifier code

Definition at line 486 of file HypreUtils.hpp.

◆ parVectorToVector()

HYPRE_Vector geos::hypre::parVectorToVector ( HYPRE_ParVector const  vec,
int const  targetRank 
)

Gather a parallel vector onto a single rank.

Parameters
vecthe vector to gather
targetRankthe rank to gather the vector on
Returns
a newly allocated serial vector on targetRank, nullptr on the rest
Note
caller takes ownership and must dispose of the vector appropriately

◆ parVectorToVectorAll()

HYPRE_Vector geos::hypre::parVectorToVectorAll ( HYPRE_ParVector const  vec)

Gather a parallel vector on every rank.

Parameters
vecthe vector to gather
Returns
a newly allocated serial vector (may be null on ranks that don't have any elements)
Note
caller takes ownership and must dispose of the vector appropriately

This is a wrapper around hypre_ParVectorToVectorAll() that works for both host-based and device-based vectors without relying on Unified Memory.

◆ relaxationCreate()

HYPRE_Int geos::hypre::relaxationCreate ( HYPRE_Solver &  solver,
HYPRE_Int const  type 
)

Create a relaxation-based smoother.

Parameters
solverthe solver
typehypre's internal identifier of the relaxation type
Returns
always 0

◆ relaxationDestroy()

HYPRE_Int geos::hypre::relaxationDestroy ( HYPRE_Solver  solver)

Destroy a relaxation-based smoother.

Parameters
solverthe solver
Returns
always 0

◆ relaxationSetup()

HYPRE_Int geos::hypre::relaxationSetup ( HYPRE_Solver  solver,
HYPRE_ParCSRMatrix  A,
HYPRE_ParVector  b,
HYPRE_ParVector  x 
)

Setup a relaxation-based smoother.

Parameters
solverthe solver
Athe matrix
bthe rhs vector (unused)
xthe solution vector (unused)
Returns
hypre error code

◆ relaxationSolve()

HYPRE_Int geos::hypre::relaxationSolve ( HYPRE_Solver  solver,
HYPRE_ParCSRMatrix  A,
HYPRE_ParVector  b,
HYPRE_ParVector  x 
)

Solve with a relaxation-based smoother.

Parameters
solverthe solver
Athe matrix
bthe rhs vector (unused)
xthe solution vector (unused)
Returns
hypre error code

◆ SuperLUDistDestroy()

HYPRE_Int geos::hypre::SuperLUDistDestroy ( HYPRE_Solver  solver)

The missing wrapper compatible with hypre solver destroy signature.

Parameters
solverthe solver
Returns
hypre error code

◆ SuperLUDistSolve()

HYPRE_Int geos::hypre::SuperLUDistSolve ( HYPRE_Solver  solver,
HYPRE_ParCSRMatrix  A,
HYPRE_ParVector  b,
HYPRE_ParVector  x 
)

The missing wrapper compatible with hypre solver solve signature.

Parameters
solverthe solver
Athe matrix (unused)
bthe rhs vector
xthe solution vector
Returns
hypre error code

◆ toHypreBigInt() [1/2]

HYPRE_BigInt* geos::hypre::toHypreBigInt ( geos::globalIndex *const  index)
inline

Converts a non-const array from GEOSX globalIndex type to HYPRE_BigInt.

Parameters
[in]indexthe input array
Returns
the converted array

Definition at line 189 of file HypreUtils.hpp.

◆ toHypreBigInt() [2/2]

HYPRE_BigInt const* geos::hypre::toHypreBigInt ( geos::globalIndex const *const  index)
inline

Converts a const array from GEOSX globalIndex type to HYPRE_BigInt.

Parameters
[in]indexthe input array
Returns
the converted array

Definition at line 199 of file HypreUtils.hpp.