#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) |
template<typename AMF > | |
void | getGradSolution (const Vector< Array< AMF *, AMREX_SPACEDIM > > &a_grad_sol, Location a_loc=Location::FaceCenter) |
template<typename AMF > | |
void | getGradSolution (std::initializer_list< Array< AMF *, AMREX_SPACEDIM >> a_grad_sol, Location a_loc=Location::FaceCenter) |
template<typename AMF > | |
void | getFluxes (const Vector< Array< AMF *, AMREX_SPACEDIM > > &a_flux, Location a_loc=Location::FaceCenter) |
For (alpha * a - beta * (del dot b grad)) phi = rhs , flux means -b grad phi More... | |
template<typename AMF > | |
void | getFluxes (std::initializer_list< Array< AMF *, AMREX_SPACEDIM >> a_flux, Location a_loc=Location::FaceCenter) |
template<typename AMF > | |
void | getFluxes (const Vector< Array< AMF *, AMREX_SPACEDIM > > &a_flux, const Vector< AMF * > &a_sol, Location a_loc=Location::FaceCenter) |
template<typename AMF > | |
void | getFluxes (std::initializer_list< Array< AMF *, AMREX_SPACEDIM >> 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 | 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)). More... | |
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 | setPreSmooth (int n) noexcept |
void | setPostSmooth (int n) noexcept |
void | setFinalSmooth (int n) noexcept |
void | setBottomSmooth (int n) noexcept |
void | setBottomSolver (BottomSolver s) 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 () noexcept |
void | setAlwaysUseBNorm (int flag) noexcept |
void | setFinalFillBC (int flag) noexcept |
int | numAMRLevels () const noexcept |
void | setNSolve (int flag) noexcept |
void | setNSolveGridSize (int s) 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 | prepareMGcycle () |
void | prepareForGMRES () |
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 |
Private Types | |
enum | timer_types { solve_time =0 , iter_time , bottom_time , ntimers } |
Private Member Functions | |
void | checkPoint (const Vector< MultiFab * > &a_sol, const Vector< MultiFab const * > &a_rhs, RT a_tol_rel, RT a_tol_abs, const char *a_file_name) const |
Friends | |
template<typename T > | |
class | MLCGSolverT |
template<typename M > | |
class | GMRESMLMGT |
using amrex::MLMGT< MF >::BCMode = typename MLLinOpT<MF>::BCMode |
using amrex::MLMGT< MF >::BottomSolver = amrex::BottomSolver |
using amrex::MLMGT< MF >::FAB = typename MLLinOpT<MF>::FAB |
using amrex::MLMGT< MF >::Location = typename MLLinOpT<MF>::Location |
using amrex::MLMGT< MF >::MFType = MF |
using amrex::MLMGT< MF >::RT = typename MLLinOpT<MF>::RT |
|
strong |
|
private |
amrex::MLMGT< MF >::MLMGT | ( | MLLinOpT< MF > & | a_lp | ) |
|
default |
|
delete |
|
delete |
void amrex::MLMGT< MF >::actualBottomSolve |
void amrex::MLMGT< MF >::addInterpCorrection | ( | int | alev, |
int | mglev | ||
) |
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)).
void amrex::MLMGT< MF >::bottomSolve |
int amrex::MLMGT< MF >::bottomSolveWithCG | ( | MF & | x, |
const MF & | b, | ||
typename MLCGSolverT< MF >::Type | type | ||
) |
|
private |
void amrex::MLMGT< MF >::compResidual | ( | const Vector< MF * > & | a_res, |
const Vector< MF * > & | a_sol, | ||
const Vector< MF const * > & | a_rhs | ||
) |
void amrex::MLMGT< MF >::computeMLResidual | ( | int | amrlevmax | ) |
void amrex::MLMGT< MF >::computeResidual | ( | int | alev | ) |
void amrex::MLMGT< MF >::computeResOfCorrection | ( | int | amrlev, |
int | mglev | ||
) |
void amrex::MLMGT< MF >::computeResWithCrseCorFineCor | ( | int | falev | ) |
void amrex::MLMGT< MF >::computeResWithCrseSolFineCor | ( | int | calev, |
int | falev | ||
) |
|
inlinenoexcept |
|
inlinenoexcept |
void amrex::MLMGT< MF >::getFluxes | ( | const Vector< AMF * > & | a_flux, |
const Vector< AMF * > & | a_sol, | ||
Location | a_loc = Location::CellCenter |
||
) |
void amrex::MLMGT< MF >::getFluxes | ( | const Vector< AMF * > & | a_flux, |
Location | a_loc = Location::CellCenter |
||
) |
void amrex::MLMGT< MF >::getFluxes | ( | const Vector< Array< AMF *, AMREX_SPACEDIM > > & | a_flux, |
const Vector< AMF * > & | a_sol, | ||
Location | a_loc = Location::FaceCenter |
||
) |
void amrex::MLMGT< MF >::getFluxes | ( | const Vector< Array< AMF *, AMREX_SPACEDIM > > & | a_flux, |
Location | a_loc = Location::FaceCenter |
||
) |
For (alpha * a - beta * (del dot b grad)) phi = rhs
, flux means -b grad phi
void amrex::MLMGT< MF >::getFluxes | ( | std::initializer_list< AMF * > | a_flux, |
Location | a_loc = Location::CellCenter |
||
) |
void amrex::MLMGT< MF >::getFluxes | ( | std::initializer_list< AMF * > | a_flux, |
std::initializer_list< AMF * > | a_sol, | ||
Location | a_loc = Location::CellCenter |
||
) |
void amrex::MLMGT< MF >::getFluxes | ( | std::initializer_list< Array< AMF *, AMREX_SPACEDIM >> | a_flux, |
Location | a_loc = Location::FaceCenter |
||
) |
void amrex::MLMGT< MF >::getFluxes | ( | std::initializer_list< Array< AMF *, AMREX_SPACEDIM >> | a_flux, |
std::initializer_list< AMF * > | a_sol, | ||
Location | a_loc = Location::FaceCenter |
||
) |
void amrex::MLMGT< MF >::getGradSolution | ( | const Vector< Array< AMF *, AMREX_SPACEDIM > > & | a_grad_sol, |
Location | a_loc = Location::FaceCenter |
||
) |
void amrex::MLMGT< MF >::getGradSolution | ( | std::initializer_list< Array< AMF *, AMREX_SPACEDIM >> | a_grad_sol, |
Location | a_loc = Location::FaceCenter |
||
) |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
void amrex::MLMGT< MF >::interpCorrection | ( | int | alev | ) |
void amrex::MLMGT< MF >::interpCorrection | ( | int | alev, |
int | mglev | ||
) |
void amrex::MLMGT< MF >::makeSolvable |
void amrex::MLMGT< MF >::makeSolvable | ( | int | amrlev, |
int | mglev, | ||
MF & | mf | ||
) |
void amrex::MLMGT< MF >::mgFcycle |
void amrex::MLMGT< MF >::mgVcycle | ( | int | amrlev, |
int | mglev | ||
) |
void amrex::MLMGT< MF >::miniCycle | ( | int | amrlev | ) |
auto amrex::MLMGT< MF >::MLResNormInf | ( | int | alevmax, |
bool | local = false |
||
) |
auto amrex::MLMGT< MF >::MLRhsNormInf | ( | bool | local = false | ) |
void amrex::MLMGT< MF >::NSolve | ( | MLMGT< MF > & | a_solver, |
MF & | a_sol, | ||
MF & | a_rhs | ||
) |
|
inlinenoexcept |
void amrex::MLMGT< MF >::oneIter | ( | int | iter | ) |
|
delete |
|
delete |
void amrex::MLMGT< MF >::prepareForFluxes | ( | Vector< MF const * > const & | a_sol | ) |
void amrex::MLMGT< MF >::prepareForGMRES |
void amrex::MLMGT< MF >::prepareForNSolve |
void amrex::MLMGT< MF >::prepareForSolve | ( | Vector< AMF * > const & | a_sol, |
Vector< AMF const * > const & | a_rhs | ||
) |
void amrex::MLMGT< MF >::prepareLinOp |
void amrex::MLMGT< MF >::prepareMGcycle |
auto amrex::MLMGT< MF >::ResNormInf | ( | int | alev, |
bool | local = false |
||
) |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
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 |
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 |
||
) |
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 |
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 |
||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
= rhs - L(sol)
L(cor) = res
|
private |
|
private |
|
private |
N Solve.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
pre
|
private |
post
|
private |
additional smoothing after bottom cg solver
|
private |
when smoother is used as bottom solver
|
private |
|
private |
= res - L(cor) Residual of the correction form
|
private |
Copy of original rhs L(sol) = rhs
|
private |
PETSc
To avoid confusion, terms like sol, cor, rhs, res, ... etc. are in the frame of the original equation, not the correction form Might be alias to argument a_sol
|
private |
|
private |
|
private |
|
private |
|
private |