Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::MLMGT< MF > Class Template Reference

#include <AMReX_MLMG.H>

Classes

class  error
 

Public Types

enum class  CFStrategy : int { none , ghostnodes }
 
using MFType = MF
 
using FAB = typename MLLinOpT< MF >::FAB
 
using RT = typename MLLinOpT< MF >::RT
 
using BCMode = typename MLLinOpT< MF >::BCMode
 
using Location = typename MLLinOpT< MF >::Location
 
using BottomSolver = amrex::BottomSolver
 

Public Member Functions

 MLMGT (MLLinOpT< MF > &a_lp)
 
 ~MLMGT ()
 
 MLMGT (MLMGT< MF > const &)=delete
 
 MLMGT (MLMGT< MF > &&)=delete
 
MLMGT< MF > & operator= (MLMGT< MF > const &)=delete
 
MLMGT< MF > & operator= (MLMGT< MF > &&)=delete
 
template<typename AMF >
RT solve (const Vector< AMF * > &a_sol, const Vector< AMF const * > &a_rhs, RT a_tol_rel, RT a_tol_abs, const char *checkpoint_file=nullptr)
 
template<typename AMF >
RT solve (std::initializer_list< AMF * > a_sol, std::initializer_list< AMF const * > a_rhs, RT a_tol_rel, RT a_tol_abs, const char *checkpoint_file=nullptr)
 
RT precond (Vector< MF * > const &a_sol, Vector< MF const * > const &a_rhs, RT a_tol_rel, RT a_tol_abs)
 
template<typename AMF >
void getGradSolution (const Vector< Array< AMF *, 3 > > &a_grad_sol, Location a_loc=Location::FaceCenter)
 
template<typename AMF >
void getGradSolution (std::initializer_list< Array< AMF *, 3 > > a_grad_sol, Location a_loc=Location::FaceCenter)
 
template<typename AMF >
void getFluxes (const Vector< Array< AMF *, 3 > > &a_flux, Location a_loc=Location::FaceCenter)
 For (alpha * a - beta * (del dot b grad)) phi = rhs, flux means -b grad phi
 
template<typename AMF >
void getFluxes (std::initializer_list< Array< AMF *, 3 > > a_flux, Location a_loc=Location::FaceCenter)
 
template<typename AMF >
void getFluxes (const Vector< Array< AMF *, 3 > > &a_flux, const Vector< AMF * > &a_sol, Location a_loc=Location::FaceCenter)
 
template<typename AMF >
void getFluxes (std::initializer_list< Array< AMF *, 3 > > a_flux, std::initializer_list< AMF * > a_sol, Location a_loc=Location::FaceCenter)
 
template<typename AMF >
void getFluxes (const Vector< AMF * > &a_flux, Location a_loc=Location::CellCenter)
 
template<typename AMF >
void getFluxes (std::initializer_list< AMF * > a_flux, Location a_loc=Location::CellCenter)
 
template<typename AMF >
void getFluxes (const Vector< AMF * > &a_flux, const Vector< AMF * > &a_sol, Location a_loc=Location::CellCenter)
 
template<typename AMF >
void getFluxes (std::initializer_list< AMF * > a_flux, std::initializer_list< AMF * > a_sol, Location a_loc=Location::CellCenter)
 
void compResidual (const Vector< MF * > &a_res, const Vector< MF * > &a_sol, const Vector< MF const * > &a_rhs)
 
void getEBFluxes (const Vector< MF * > &a_eb_flux)
 
void getEBFluxes (const Vector< MF * > &a_eb_flux, const Vector< MF * > &a_sol)
 
void apply (const Vector< MF * > &out, const Vector< MF * > &in)
 out = L(in). Note that, if no actual solve is needed, one could turn off multigrid coarsening by constructing a MLLinOp object with an appropriate LPInfo object (e.g., with LPInfo().setMaxCoarseningLevel(0)).
 
void applyPrecond (const Vector< MF * > &out, const Vector< MF * > &in)
 out = L(in) as a preconditioner
 
int getVerbose () const
 
int getBottomVerbose () const
 
void incPrintIdentation ()
 
void decPrintIdentation ()
 
void setThrowException (bool t) noexcept
 
void setVerbose (int v) noexcept
 
void setMaxIter (int n) noexcept
 
void setMaxFmgIter (int n) noexcept
 
void setFixedIter (int nit) noexcept
 
void setPrecondIter (int nit) noexcept
 
void setPreSmooth (int n) noexcept
 
void setPostSmooth (int n) noexcept
 
void setFinalSmooth (int n) noexcept
 
void setBottomSmooth (int n) noexcept
 
void setBottomSolver (BottomSolver s) noexcept
 
BottomSolver getBottomSolver () const noexcept
 
void setCFStrategy (CFStrategy a_cf_strategy) noexcept
 
void setBottomVerbose (int v) noexcept
 
void setBottomMaxIter (int n) noexcept
 
void setBottomTolerance (RT t) noexcept
 
void setBottomToleranceAbs (RT t) noexcept
 
RT getBottomToleranceAbs () const noexcept
 
void setAlwaysUseBNorm (int flag) noexcept
 
void setConvergenceNormType (MLMGNormType norm) noexcept
 
void setFinalFillBC (int flag) noexcept
 
int numAMRLevels () const noexcept
 
void setNSolve (int flag) noexcept
 
void setNSolveGridSize (int s) noexcept
 
void setNoGpuSync (bool do_not_sync) noexcept
 
void prepareForFluxes (Vector< MF const * > const &a_sol)
 
template<typename AMF >
void prepareForSolve (Vector< AMF * > const &a_sol, Vector< AMF const * > const &a_rhs)
 
void prepareForNSolve ()
 
void prepareLinOp ()
 
void preparePrecond ()
 
void oneIter (int iter)
 
void miniCycle (int amrlev)
 
void mgVcycle (int amrlev, int mglev)
 
void mgFcycle ()
 
void bottomSolve ()
 
void NSolve (MLMGT< MF > &a_solver, MF &a_sol, MF &a_rhs)
 
void actualBottomSolve ()
 
void computeMLResidual (int amrlevmax)
 
void computeResidual (int alev)
 
void computeResWithCrseSolFineCor (int calev, int falev)
 
void computeResWithCrseCorFineCor (int falev)
 
void interpCorrection (int alev)
 
void interpCorrection (int alev, int mglev)
 
void addInterpCorrection (int alev, int mglev)
 
void computeResOfCorrection (int amrlev, int mglev)
 
RT ResNormInf (int alev, bool local=false)
 
RT MLResNormInf (int alevmax, bool local=false)
 
RT MLRhsNormInf (bool local=false)
 
void makeSolvable ()
 
void makeSolvable (int amrlev, int mglev, MF &mf)
 
int bottomSolveWithCG (MF &x, const MF &b, typename MLCGSolverT< MF >::Type type)
 
RT getInitRHS () const noexcept
 
RT getInitResidual () const noexcept
 
RT getFinalResidual () const noexcept
 
Vector< RT > const & getResidualHistory () const noexcept
 
int getNumIters () const noexcept
 
Vector< int > const & getNumCGIters () const noexcept
 
MLLinOpT< MF > & getLinOp ()
 
template<typename AMF >
auto solve (std::initializer_list< AMF * > a_sol, std::initializer_list< AMF const * > a_rhs, RT a_tol_rel, RT a_tol_abs, const char *checkpoint_file) -> RT
 
template<typename AMF >
auto solve (const Vector< AMF * > &a_sol, const Vector< AMF const * > &a_rhs, RT a_tol_rel, RT a_tol_abs, const char *checkpoint_file) -> RT
 

Friends

template<typename T >
class MLCGSolverT
 
template<typename M >
class GMRESMLMGT
 

Member Typedef Documentation

◆ BCMode

template<typename MF >
using amrex::MLMGT< MF >::BCMode = typename MLLinOpT<MF>::BCMode

◆ BottomSolver

template<typename MF >
using amrex::MLMGT< MF >::BottomSolver = amrex::BottomSolver

◆ FAB

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

◆ Location

template<typename MF >
using amrex::MLMGT< MF >::Location = typename MLLinOpT<MF>::Location

◆ MFType

template<typename MF >
using amrex::MLMGT< MF >::MFType = MF

◆ RT

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

Member Enumeration Documentation

◆ CFStrategy

template<typename MF >
enum class amrex::MLMGT::CFStrategy : int
strong
Enumerator
none 
ghostnodes 

Constructor & Destructor Documentation

◆ MLMGT() [1/3]

template<typename MF >
amrex::MLMGT< MF >::MLMGT ( MLLinOpT< MF > &  a_lp)

◆ ~MLMGT()

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

◆ MLMGT() [2/3]

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

◆ MLMGT() [3/3]

template<typename MF >
amrex::MLMGT< MF >::MLMGT ( MLMGT< MF > &&  )
delete

Member Function Documentation

◆ actualBottomSolve()

template<typename MF >
void amrex::MLMGT< MF >::actualBottomSolve ( )

◆ addInterpCorrection()

template<typename MF >
void amrex::MLMGT< MF >::addInterpCorrection ( int  alev,
int  mglev 
)

◆ apply()

template<typename MF >
void amrex::MLMGT< MF >::apply ( const Vector< MF * > &  out,
const Vector< MF * > &  in 
)

out = L(in). Note that, if no actual solve is needed, one could turn off multigrid coarsening by constructing a MLLinOp object with an appropriate LPInfo object (e.g., with LPInfo().setMaxCoarseningLevel(0)).

◆ applyPrecond()

template<typename MF >
void amrex::MLMGT< MF >::applyPrecond ( const Vector< MF * > &  out,
const Vector< MF * > &  in 
)

out = L(in) as a preconditioner

◆ bottomSolve()

template<typename MF >
void amrex::MLMGT< MF >::bottomSolve ( )

◆ bottomSolveWithCG()

template<typename MF >
int amrex::MLMGT< MF >::bottomSolveWithCG ( MF &  x,
const MF &  b,
typename MLCGSolverT< MF >::Type  type 
)

◆ compResidual()

template<typename MF >
void amrex::MLMGT< MF >::compResidual ( const Vector< MF * > &  a_res,
const Vector< MF * > &  a_sol,
const Vector< MF const * > &  a_rhs 
)

◆ computeMLResidual()

template<typename MF >
void amrex::MLMGT< MF >::computeMLResidual ( int  amrlevmax)

◆ computeResidual()

template<typename MF >
void amrex::MLMGT< MF >::computeResidual ( int  alev)

◆ computeResOfCorrection()

template<typename MF >
void amrex::MLMGT< MF >::computeResOfCorrection ( int  amrlev,
int  mglev 
)

◆ computeResWithCrseCorFineCor()

template<typename MF >
void amrex::MLMGT< MF >::computeResWithCrseCorFineCor ( int  falev)

◆ computeResWithCrseSolFineCor()

template<typename MF >
void amrex::MLMGT< MF >::computeResWithCrseSolFineCor ( int  calev,
int  falev 
)

◆ decPrintIdentation()

template<typename MF >
void amrex::MLMGT< MF >::decPrintIdentation ( )

◆ getBottomSolver()

template<typename MF >
BottomSolver amrex::MLMGT< MF >::getBottomSolver ( ) const
inlinenoexcept

◆ getBottomToleranceAbs()

template<typename MF >
RT amrex::MLMGT< MF >::getBottomToleranceAbs ( ) const
inlinenoexcept

◆ getBottomVerbose()

template<typename MF >
int amrex::MLMGT< MF >::getBottomVerbose ( ) const
inline

◆ getEBFluxes() [1/2]

template<typename MF >
void amrex::MLMGT< MF >::getEBFluxes ( const Vector< MF * > &  a_eb_flux)

◆ getEBFluxes() [2/2]

template<typename MF >
void amrex::MLMGT< MF >::getEBFluxes ( const Vector< MF * > &  a_eb_flux,
const Vector< MF * > &  a_sol 
)

◆ getFinalResidual()

template<typename MF >
RT amrex::MLMGT< MF >::getFinalResidual ( ) const
inlinenoexcept

◆ getFluxes() [1/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( const Vector< AMF * > &  a_flux,
const Vector< AMF * > &  a_sol,
Location  a_loc = Location::CellCenter 
)

◆ getFluxes() [2/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( const Vector< AMF * > &  a_flux,
Location  a_loc = Location::CellCenter 
)

◆ getFluxes() [3/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( const Vector< Array< AMF *, 3 > > &  a_flux,
const Vector< AMF * > &  a_sol,
Location  a_loc = Location::FaceCenter 
)

◆ getFluxes() [4/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( const Vector< Array< AMF *, 3 > > &  a_flux,
Location  a_loc = Location::FaceCenter 
)

For (alpha * a - beta * (del dot b grad)) phi = rhs, flux means -b grad phi

◆ getFluxes() [5/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( std::initializer_list< AMF * >  a_flux,
Location  a_loc = Location::CellCenter 
)

◆ getFluxes() [6/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( std::initializer_list< AMF * >  a_flux,
std::initializer_list< AMF * >  a_sol,
Location  a_loc = Location::CellCenter 
)

◆ getFluxes() [7/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( std::initializer_list< Array< AMF *, 3 > >  a_flux,
Location  a_loc = Location::FaceCenter 
)

◆ getFluxes() [8/8]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getFluxes ( std::initializer_list< Array< AMF *, 3 > >  a_flux,
std::initializer_list< AMF * >  a_sol,
Location  a_loc = Location::FaceCenter 
)

◆ getGradSolution() [1/2]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getGradSolution ( const Vector< Array< AMF *, 3 > > &  a_grad_sol,
Location  a_loc = Location::FaceCenter 
)

◆ getGradSolution() [2/2]

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::getGradSolution ( std::initializer_list< Array< AMF *, 3 > >  a_grad_sol,
Location  a_loc = Location::FaceCenter 
)

◆ getInitResidual()

template<typename MF >
RT amrex::MLMGT< MF >::getInitResidual ( ) const
inlinenoexcept

◆ getInitRHS()

template<typename MF >
RT amrex::MLMGT< MF >::getInitRHS ( ) const
inlinenoexcept

◆ getLinOp()

template<typename MF >
MLLinOpT< MF > & amrex::MLMGT< MF >::getLinOp ( )
inline

◆ getNumCGIters()

template<typename MF >
Vector< int > const & amrex::MLMGT< MF >::getNumCGIters ( ) const
inlinenoexcept

◆ getNumIters()

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

◆ getResidualHistory()

template<typename MF >
Vector< RT > const & amrex::MLMGT< MF >::getResidualHistory ( ) const
inlinenoexcept

◆ getVerbose()

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

◆ incPrintIdentation()

template<typename MF >
void amrex::MLMGT< MF >::incPrintIdentation ( )

◆ interpCorrection() [1/2]

template<typename MF >
void amrex::MLMGT< MF >::interpCorrection ( int  alev)

◆ interpCorrection() [2/2]

template<typename MF >
void amrex::MLMGT< MF >::interpCorrection ( int  alev,
int  mglev 
)

◆ makeSolvable() [1/2]

template<typename MF >
void amrex::MLMGT< MF >::makeSolvable ( )

◆ makeSolvable() [2/2]

template<typename MF >
void amrex::MLMGT< MF >::makeSolvable ( int  amrlev,
int  mglev,
MF &  mf 
)

◆ mgFcycle()

template<typename MF >
void amrex::MLMGT< MF >::mgFcycle ( )

◆ mgVcycle()

template<typename MF >
void amrex::MLMGT< MF >::mgVcycle ( int  amrlev,
int  mglev 
)

◆ miniCycle()

template<typename MF >
void amrex::MLMGT< MF >::miniCycle ( int  amrlev)

◆ MLResNormInf()

template<typename MF >
auto amrex::MLMGT< MF >::MLResNormInf ( int  alevmax,
bool  local = false 
)

◆ MLRhsNormInf()

template<typename MF >
auto amrex::MLMGT< MF >::MLRhsNormInf ( bool  local = false)

◆ NSolve()

template<typename MF >
void amrex::MLMGT< MF >::NSolve ( MLMGT< MF > &  a_solver,
MF &  a_sol,
MF &  a_rhs 
)

◆ numAMRLevels()

template<typename MF >
int amrex::MLMGT< MF >::numAMRLevels ( ) const
inlinenoexcept

◆ oneIter()

template<typename MF >
void amrex::MLMGT< MF >::oneIter ( int  iter)

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ precond()

template<typename MF >
auto amrex::MLMGT< MF >::precond ( Vector< MF * > const &  a_sol,
Vector< MF const * > const &  a_rhs,
RT  a_tol_rel,
RT  a_tol_abs 
)

◆ prepareForFluxes()

template<typename MF >
void amrex::MLMGT< MF >::prepareForFluxes ( Vector< MF const * > const &  a_sol)

◆ prepareForNSolve()

template<typename MF >
void amrex::MLMGT< MF >::prepareForNSolve ( )

◆ prepareForSolve()

template<typename MF >
template<typename AMF >
void amrex::MLMGT< MF >::prepareForSolve ( Vector< AMF * > const &  a_sol,
Vector< AMF const * > const &  a_rhs 
)

◆ prepareLinOp()

template<typename MF >
void amrex::MLMGT< MF >::prepareLinOp ( )

◆ preparePrecond()

template<typename MF >
void amrex::MLMGT< MF >::preparePrecond ( )

◆ ResNormInf()

template<typename MF >
auto amrex::MLMGT< MF >::ResNormInf ( int  alev,
bool  local = false 
)

◆ setAlwaysUseBNorm()

template<typename MF >
void amrex::MLMGT< MF >::setAlwaysUseBNorm ( int  flag)
noexcept

◆ setBottomMaxIter()

template<typename MF >
void amrex::MLMGT< MF >::setBottomMaxIter ( int  n)
inlinenoexcept

◆ setBottomSmooth()

template<typename MF >
void amrex::MLMGT< MF >::setBottomSmooth ( int  n)
inlinenoexcept

◆ setBottomSolver()

template<typename MF >
void amrex::MLMGT< MF >::setBottomSolver ( BottomSolver  s)
inlinenoexcept

◆ setBottomTolerance()

template<typename MF >
void amrex::MLMGT< MF >::setBottomTolerance ( RT  t)
inlinenoexcept

◆ setBottomToleranceAbs()

template<typename MF >
void amrex::MLMGT< MF >::setBottomToleranceAbs ( RT  t)
inlinenoexcept

◆ setBottomVerbose()

template<typename MF >
void amrex::MLMGT< MF >::setBottomVerbose ( int  v)
inlinenoexcept

◆ setCFStrategy()

template<typename MF >
void amrex::MLMGT< MF >::setCFStrategy ( CFStrategy  a_cf_strategy)
inlinenoexcept

◆ setConvergenceNormType()

template<typename MF >
void amrex::MLMGT< MF >::setConvergenceNormType ( MLMGNormType  norm)
inlinenoexcept

◆ setFinalFillBC()

template<typename MF >
void amrex::MLMGT< MF >::setFinalFillBC ( int  flag)
inlinenoexcept

◆ setFinalSmooth()

template<typename MF >
void amrex::MLMGT< MF >::setFinalSmooth ( int  n)
inlinenoexcept

◆ setFixedIter()

template<typename MF >
void amrex::MLMGT< MF >::setFixedIter ( int  nit)
inlinenoexcept

◆ setMaxFmgIter()

template<typename MF >
void amrex::MLMGT< MF >::setMaxFmgIter ( int  n)
inlinenoexcept

◆ setMaxIter()

template<typename MF >
void amrex::MLMGT< MF >::setMaxIter ( int  n)
inlinenoexcept

◆ setNoGpuSync()

template<typename MF >
void amrex::MLMGT< MF >::setNoGpuSync ( bool  do_not_sync)
inlinenoexcept

◆ setNSolve()

template<typename MF >
void amrex::MLMGT< MF >::setNSolve ( int  flag)
inlinenoexcept

◆ setNSolveGridSize()

template<typename MF >
void amrex::MLMGT< MF >::setNSolveGridSize ( int  s)
inlinenoexcept

◆ setPostSmooth()

template<typename MF >
void amrex::MLMGT< MF >::setPostSmooth ( int  n)
inlinenoexcept

◆ setPrecondIter()

template<typename MF >
void amrex::MLMGT< MF >::setPrecondIter ( int  nit)
inlinenoexcept

◆ setPreSmooth()

template<typename MF >
void amrex::MLMGT< MF >::setPreSmooth ( int  n)
inlinenoexcept

◆ setThrowException()

template<typename MF >
void amrex::MLMGT< MF >::setThrowException ( bool  t)
inlinenoexcept

◆ setVerbose()

template<typename MF >
void amrex::MLMGT< MF >::setVerbose ( int  v)
inlinenoexcept

◆ solve() [1/4]

template<typename MF >
template<typename AMF >
auto amrex::MLMGT< MF >::solve ( const Vector< AMF * > &  a_sol,
const Vector< AMF const * > &  a_rhs,
RT  a_tol_rel,
RT  a_tol_abs,
const char *  checkpoint_file 
) -> RT

◆ solve() [2/4]

template<typename MF >
template<typename AMF >
RT amrex::MLMGT< MF >::solve ( const Vector< AMF * > &  a_sol,
const Vector< AMF const * > &  a_rhs,
RT  a_tol_rel,
RT  a_tol_abs,
const char *  checkpoint_file = nullptr 
)

◆ solve() [3/4]

template<typename MF >
template<typename AMF >
auto amrex::MLMGT< MF >::solve ( std::initializer_list< AMF * >  a_sol,
std::initializer_list< AMF const * >  a_rhs,
RT  a_tol_rel,
RT  a_tol_abs,
const char *  checkpoint_file 
) -> RT

◆ solve() [4/4]

template<typename MF >
template<typename AMF >
RT amrex::MLMGT< MF >::solve ( std::initializer_list< AMF * >  a_sol,
std::initializer_list< AMF const * >  a_rhs,
RT  a_tol_rel,
RT  a_tol_abs,
const char *  checkpoint_file = nullptr 
)

Friends And Related Symbol Documentation

◆ GMRESMLMGT

template<typename MF >
template<typename M >
friend class GMRESMLMGT
friend

◆ MLCGSolverT

template<typename MF >
template<typename T >
friend class MLCGSolverT
friend

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