Block-Structured AMR Software Framework
amrex::MLCGSolverT< MF > Class Template Reference

#include <AMReX_MLCGSolver.H>

Public Types

enum class  Type { BiCGStab , CG }
 
using FAB = typename MLLinOpT< MF >::FAB
 
using RT = typename MLLinOpT< MF >::RT
 

Public Member Functions

 MLCGSolverT (MLLinOpT< MF > &_lp, Type _typ=Type::BiCGStab)
 
 ~MLCGSolverT ()
 
 MLCGSolverT (const MLCGSolverT< MF > &rhs)=delete
 
 MLCGSolverT (MLCGSolverT< MF > &&rhs)=delete
 
MLCGSolverT< MF > & operator= (const MLCGSolverT< MF > &rhs)=delete
 
MLCGSolverT< MF > & operator= (MLCGSolverT< MF > &&rhs)=delete
 
void setSolver (Type _typ) noexcept
 
int solve (MF &solnL, const MF &rhsL, RT eps_rel, RT eps_abs)
 
void setVerbose (int _verbose)
 
int getVerbose () const
 
void setMaxIter (int _maxiter)
 
int getMaxIter () const
 
void setInitSolnZeroed (bool _sol_zeroed)
 
bool getInitSolnZeroed () const
 
void setNGhost (int _nghost)
 
int getNGhost ()
 
RT dotxy (const MF &r, const MF &z, bool local=false)
 
RT norm_inf (const MF &res, bool local=false)
 
int solve_bicgstab (MF &solnL, const MF &rhsL, RT eps_rel, RT eps_abs)
 
int solve_cg (MF &solnL, const MF &rhsL, RT eps_rel, RT eps_abs)
 
int getNumIters () const noexcept
 

Private Attributes

MLLinOpT< MF > & Lp
 
Type solver_type
 
const int amrlev = 0
 
const int mglev
 
int verbose = 0
 
int maxiter = 100
 
IntVect nghost = IntVect(0)
 
int iter = -1
 
bool initial_vec_zeroed = false
 

Member Typedef Documentation

◆ FAB

template<typename MF >
using amrex::MLCGSolverT< MF >::FAB = typename MLLinOpT<MF>::FAB

◆ RT

template<typename MF >
using amrex::MLCGSolverT< MF >::RT = typename MLLinOpT<MF>::RT

Member Enumeration Documentation

◆ Type

template<typename MF >
enum amrex::MLCGSolverT::Type
strong
Enumerator
BiCGStab 
CG 

Constructor & Destructor Documentation

◆ MLCGSolverT() [1/3]

template<typename MF >
amrex::MLCGSolverT< MF >::MLCGSolverT ( MLLinOpT< MF > &  _lp,
Type  _typ = Type::BiCGStab 
)

◆ ~MLCGSolverT()

template<typename MF >
amrex::MLCGSolverT< MF >::~MLCGSolverT ( )
default

◆ MLCGSolverT() [2/3]

template<typename MF >
amrex::MLCGSolverT< MF >::MLCGSolverT ( const MLCGSolverT< MF > &  rhs)
delete

◆ MLCGSolverT() [3/3]

template<typename MF >
amrex::MLCGSolverT< MF >::MLCGSolverT ( MLCGSolverT< MF > &&  rhs)
delete

Member Function Documentation

◆ dotxy()

template<typename MF >
auto amrex::MLCGSolverT< MF >::dotxy ( const MF &  r,
const MF &  z,
bool  local = false 
)

◆ getInitSolnZeroed()

template<typename MF >
bool amrex::MLCGSolverT< MF >::getInitSolnZeroed ( ) const
inline

◆ getMaxIter()

template<typename MF >
int amrex::MLCGSolverT< MF >::getMaxIter ( ) const
inline

◆ getNGhost()

template<typename MF >
int amrex::MLCGSolverT< MF >::getNGhost ( )
inline

◆ getNumIters()

template<typename MF >
int amrex::MLCGSolverT< MF >::getNumIters ( ) const
inlinenoexcept

◆ getVerbose()

template<typename MF >
int amrex::MLCGSolverT< MF >::getVerbose ( ) const
inline

◆ norm_inf()

template<typename MF >
auto amrex::MLCGSolverT< MF >::norm_inf ( const MF &  res,
bool  local = false 
)

◆ operator=() [1/2]

template<typename MF >
MLCGSolverT<MF>& amrex::MLCGSolverT< MF >::operator= ( const MLCGSolverT< MF > &  rhs)
delete

◆ operator=() [2/2]

template<typename MF >
MLCGSolverT<MF>& amrex::MLCGSolverT< MF >::operator= ( MLCGSolverT< MF > &&  rhs)
delete

◆ setInitSolnZeroed()

template<typename MF >
void amrex::MLCGSolverT< MF >::setInitSolnZeroed ( bool  _sol_zeroed)
inline

Is the initial guess provided to the solver zero ? If so, set this to true. The solver will avoid a few operations if this is true. Default is false.

◆ setMaxIter()

template<typename MF >
void amrex::MLCGSolverT< MF >::setMaxIter ( int  _maxiter)
inline

◆ setNGhost()

template<typename MF >
void amrex::MLCGSolverT< MF >::setNGhost ( int  _nghost)
inline

◆ setSolver()

template<typename MF >
void amrex::MLCGSolverT< MF >::setSolver ( Type  _typ)
inlinenoexcept

◆ setVerbose()

template<typename MF >
void amrex::MLCGSolverT< MF >::setVerbose ( int  _verbose)
inline

◆ solve()

template<typename MF >
int amrex::MLCGSolverT< MF >::solve ( MF &  solnL,
const MF &  rhsL,
RT  eps_rel,
RT  eps_abs 
)

solve the system, Lp(solnL)=rhsL to relative err, tolerance Returns an int indicating success or failure. 0 means success 1 means failed for loss of precision 2 means iterations exceeded

◆ solve_bicgstab()

template<typename MF >
int amrex::MLCGSolverT< MF >::solve_bicgstab ( MF &  solnL,
const MF &  rhsL,
RT  eps_rel,
RT  eps_abs 
)

◆ solve_cg()

template<typename MF >
int amrex::MLCGSolverT< MF >::solve_cg ( MF &  solnL,
const MF &  rhsL,
RT  eps_rel,
RT  eps_abs 
)

Member Data Documentation

◆ amrlev

template<typename MF >
const int amrex::MLCGSolverT< MF >::amrlev = 0
private

◆ initial_vec_zeroed

template<typename MF >
bool amrex::MLCGSolverT< MF >::initial_vec_zeroed = false
private

◆ iter

template<typename MF >
int amrex::MLCGSolverT< MF >::iter = -1
private

◆ Lp

template<typename MF >
MLLinOpT<MF>& amrex::MLCGSolverT< MF >::Lp
private

◆ maxiter

template<typename MF >
int amrex::MLCGSolverT< MF >::maxiter = 100
private

◆ mglev

template<typename MF >
const int amrex::MLCGSolverT< MF >::mglev
private

◆ nghost

template<typename MF >
IntVect amrex::MLCGSolverT< MF >::nghost = IntVect(0)
private

◆ solver_type

template<typename MF >
Type amrex::MLCGSolverT< MF >::solver_type
private

◆ verbose

template<typename MF >
int amrex::MLCGSolverT< MF >::verbose = 0
private

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