PFMG solver. More...
#include <Cabana_Grid_HypreStructuredSolver.hpp>
Public Types | |
using | base_type = HypreStructuredSolver<Scalar, EntityType, MemorySpace> |
Base HYPRE structured solver type. | |
![]() | |
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> | |
HypreStructPFMG (const ArrayLayout_t &layout, const bool is_preconditioner=false) | |
Constructor. | |
void | setMaxLevels (const int max_levels) |
Set the maximum number of multigrid levels. | |
void | setRelChange (const int rel_change) |
void | setRelaxType (const int relax_type) |
Set relaxation type. | |
void | setJacobiWeight (const double weight) |
Set the Jacobi weight. | |
void | setRAPType (const int rap_type) |
Set type of coarse-grid operator to use. | |
void | setNumPreRelax (const int num_pre_relax) |
Set number of relaxation sweeps before coarse-grid correction. | |
void | setNumPostRelax (const int num_post_relax) |
Set number of relaxation sweeps before coarse-grid correction. | |
void | setSkipRelax (const int skip_relax) |
void | setLogging (const int logging) |
Set the amount of logging to do. | |
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. | |
![]() | |
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 print_level) 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. | |
![]() | |
void | checkHypreError (const int error) const |
Check a hypre error. | |
Additional Inherited Members | |
![]() | |
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. | |
PFMG solver.
|
inlineoverrideprotectedvirtual |
Get the relative residual norm achieved on the last solve.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverridevirtual |
Get the preconditioner setup function.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverridevirtual |
Get the preconditioner solve function.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverridevirtual |
Get the preconditioner.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverrideprotectedvirtual |
Get the number of iterations taken on the last solve.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverrideprotectedvirtual |
Set maximum iteration implementation.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverrideprotectedvirtual |
Set a preconditioner.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverrideprotectedvirtual |
Set the output level.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inline |
Set type of coarse-grid operator to use.
0 - Galerkin (default) 1 - non-Galerkin 5-pt or 7-pt stencils
Both operators are constructed algebraically. The non-Galerkin option maintains a 5-pt stencil in 2D and a 7-pt stencil in 3D on all grid levels. The stencil coefficients are computed by averaging techniques.
|
inline |
Set relaxation type.
0 - Jacobi 1 - Weighted Jacobi (default) 2 - Red/Black Gauss-Seidel (symmetric: RB pre-relaxation, BR post-relaxation) 3 - Red/Black Gauss-Seidel (nonsymmetric: RB pre- and post-relaxation)
|
inline |
Additionally require that the relative difference in successive iterates be small.
|
inline |
Skip relaxation on certain grids for isotropic problems. This can greatly improve efficiency by eliminating unnecessary relaxations when the underlying problem is isotropic.
|
inlineoverrideprotectedvirtual |
Set convergence tolerance implementation.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverrideprotectedvirtual |
Setup implementation.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.
|
inlineoverrideprotectedvirtual |
Solver implementation.
Implements Cabana::Grid::HypreStructuredSolver< Scalar, EntityType, MemorySpace >.