#include <AMReX_MLMG.H>
Public Types | |
| enum class | CFStrategy : int { none , ghostnodes } |
| using | BCMode = MLLinOp::BCMode |
| using | Location = MLLinOp::Location |
| using | BottomSolver = amrex::BottomSolver |
Public Member Functions | |
| MLMG (MLLinOp &a_lp) | |
| ~MLMG () | |
| Real | solve (const Vector< MultiFab * > &a_sol, const Vector< MultiFab const * > &a_rhs, Real a_tol_rel, Real a_tol_abs, const char *checkpoint_file=nullptr) |
| Real | solve (Vector< Any > &a_sol, const Vector< Any > &a_rhs, Real a_tol_rel, Real a_tol_abs, const char *checkpoint_file=nullptr) |
| void | getGradSolution (const Vector< Array< MultiFab *, AMREX_SPACEDIM > > &a_grad_sol, Location a_loc=Location::FaceCenter) |
| void | getFluxes (const Vector< Array< MultiFab *, 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... | |
| void | getFluxes (const Vector< Array< MultiFab *, AMREX_SPACEDIM > > &a_flux, const Vector< MultiFab * > &a_sol, Location a_loc=Location::FaceCenter) |
| void | getFluxes (const Vector< MultiFab * > &a_flux, Location a_loc=Location::CellCenter) |
| void | getFluxes (const Vector< MultiFab * > &a_flux, const Vector< MultiFab * > &a_sol, Location a_loc=Location::CellCenter) |
| void | compResidual (const Vector< MultiFab * > &a_res, const Vector< MultiFab * > &a_sol, const Vector< MultiFab const * > &a_rhs) |
| void | apply (const Vector< MultiFab * > &out, const Vector< MultiFab * > &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 | 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 (Real t) noexcept |
| void | setBottomToleranceAbs (Real t) noexcept |
| Real | 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 | prepareForSolve (Vector< Any > &a_sol, const Vector< Any > &a_rhs) |
| void | prepareForNSolve () |
| void | oneIter (int iter) |
| void | miniCycle (int alev) |
| void | mgVcycle (int amrlev, int mglev) |
| void | mgFcycle () |
| void | bottomSolve () |
| void | NSolve (MLMG &a_solver, MultiFab &a_sol, MultiFab &a_rhs) |
| void | actualBottomSolve () |
| void | computeMLResidual (int amrlevmax) |
| void | computeResidual (int alev) |
| void | computeResWithCrseSolFineCor (int crse_amr_lev, int fine_amr_lev) |
| void | computeResWithCrseCorFineCor (int fine_amr_lev) |
| void | interpCorrection (int alev) |
| void | interpCorrection (int alev, int mglev) |
| void | addInterpCorrection (int alev, int mglev) |
| void | computeResOfCorrection (int amrlev, int mglev) |
| Real | ResNormInf (int amrlev, bool local=false) |
| Real | MLResNormInf (int alevmax, bool local=false) |
| Real | MLRhsNormInf (bool local=false) |
| void | buildFineMask () |
| void | makeSolvable () |
| void | makeSolvable (int amrlev, int mglev, Any &mf) |
| void | bottomSolveWithPETSc (Any &x, const Any &b) |
| int | bottomSolveWithCG (Any &x, const Any &b, MLCGSolver::Type type) |
| Real | getInitRHS () const noexcept |
| Real | getInitResidual () const noexcept |
| Real | getFinalResidual () const noexcept |
| Vector< Real > const & | getResidualHistory () const noexcept |
| int | getNumIters () const noexcept |
| Vector< int > const & | getNumCGIters () const noexcept |
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, Real a_tol_rel, Real a_tol_abs, const char *a_file_name) const |
Friends | |
| class | MLCGSolver |
| using amrex::MLMG::BCMode = MLLinOp::BCMode |
|
strong |
|
private |
| amrex::MLMG::MLMG | ( | MLLinOp & | a_lp | ) |
| amrex::MLMG::~MLMG | ( | ) |
| void amrex::MLMG::actualBottomSolve | ( | ) |
| void amrex::MLMG::bottomSolve | ( | ) |
| int amrex::MLMG::bottomSolveWithCG | ( | Any & | x, |
| const Any & | b, | ||
| MLCGSolver::Type | type | ||
| ) |
| void amrex::MLMG::buildFineMask | ( | ) |
|
private |
| void amrex::MLMG::compResidual | ( | const Vector< MultiFab * > & | a_res, |
| const Vector< MultiFab * > & | a_sol, | ||
| const Vector< MultiFab const * > & | a_rhs | ||
| ) |
| void amrex::MLMG::computeMLResidual | ( | int | amrlevmax | ) |
| void amrex::MLMG::computeResidual | ( | int | alev | ) |
| void amrex::MLMG::computeResWithCrseCorFineCor | ( | int | fine_amr_lev | ) |
|
inlinenoexcept |
|
inlinenoexcept |
| void amrex::MLMG::getFluxes | ( | const Vector< Array< MultiFab *, AMREX_SPACEDIM > > & | a_flux, |
| const Vector< MultiFab * > & | a_sol, | ||
| Location | a_loc = Location::FaceCenter |
||
| ) |
| void amrex::MLMG::getFluxes | ( | const Vector< Array< MultiFab *, AMREX_SPACEDIM > > & | a_flux, |
| Location | a_loc = Location::FaceCenter |
||
| ) |
For (alpha * a - beta * (del dot b grad)) phi = rhs, flux means -b grad phi
| a_flux | |
| a_loc |
| void amrex::MLMG::getFluxes | ( | const Vector< MultiFab * > & | a_flux, |
| const Vector< MultiFab * > & | a_sol, | ||
| Location | a_loc = Location::CellCenter |
||
| ) |
| void amrex::MLMG::getFluxes | ( | const Vector< MultiFab * > & | a_flux, |
| Location | a_loc = Location::CellCenter |
||
| ) |
| void amrex::MLMG::getGradSolution | ( | const Vector< Array< MultiFab *, AMREX_SPACEDIM > > & | a_grad_sol, |
| Location | a_loc = Location::FaceCenter |
||
| ) |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| void amrex::MLMG::interpCorrection | ( | int | alev | ) |
| void amrex::MLMG::makeSolvable | ( | ) |
| void amrex::MLMG::mgFcycle | ( | ) |
| void amrex::MLMG::miniCycle | ( | int | alev | ) |
| Real amrex::MLMG::MLResNormInf | ( | int | alevmax, |
| bool | local = false |
||
| ) |
| Real amrex::MLMG::MLRhsNormInf | ( | bool | local = false | ) |
|
inlinenoexcept |
| void amrex::MLMG::oneIter | ( | int | iter | ) |
| void amrex::MLMG::prepareForNSolve | ( | ) |
| Real amrex::MLMG::ResNormInf | ( | int | amrlev, |
| bool | local = false |
||
| ) |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| Real amrex::MLMG::solve | ( | const Vector< MultiFab * > & | a_sol, |
| const Vector< MultiFab const * > & | a_rhs, | ||
| Real | a_tol_rel, | ||
| Real | a_tol_abs, | ||
| const char * | checkpoint_file = nullptr |
||
| ) |
| Real amrex::MLMG::solve | ( | Vector< Any > & | a_sol, |
| const Vector< Any > & | a_rhs, | ||
| Real | a_tol_rel, | ||
| Real | a_tol_abs, | ||
| const char * | checkpoint_file = nullptr |
||
| ) |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
N Solve.
|
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
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 |