Alamo
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Solver::Nonlocal::Linear Class Reference
Inheritance diagram for Solver::Nonlocal::Linear:
[legend]
Collaboration diagram for Solver::Nonlocal::Linear:
[legend]

Public Member Functions

 Linear ()
 
 Linear (Operator::Operator< Grid::Node > &a_lp)
 
 ~Linear ()
 
void Define (Operator::Operator< Grid::Node > &a_lp)
 
void Clear ()
 
Set::Scalar solveaffine (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_sol, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_rhs, Real a_tol_rel, Real a_tol_abs, bool copyrhs=false, const char *checkpoint_file=nullptr)
 
Set::Scalar solve (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_sol, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_rhs, Real a_tol_rel, Real a_tol_abs, const char *checkpoint_file=nullptr)
 
Set::Scalar solve (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_sol, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_rhs)
 
void apply (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_rhs, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &a_sol)
 
void setMaxIter (const int a_max_iter)
 
void setBottomMaxIter (const int a_bottom_max_iter)
 
void setMaxFmgIter (const int a_max_fmg_iter)
 
void setFixedIter (const int a_fixed_iter)
 
void setVerbose (const int a_verbose)
 
void setPreSmooth (const int a_pre_smooth)
 
void setPostSmooth (const int a_post_smooth)
 
void dumpOnConvergenceFail (const amrex::Vector< amrex::MultiFab * > &a_sol_mf, const amrex::Vector< amrex::MultiFab const * > &a_rhs_mf)
 

Static Public Member Functions

static void Parse (Linear &value, amrex::ParmParse &pp)
 

Protected Member Functions

void PrepareMLMG (amrex::MLMG &mlmg)
 

Protected Attributes

int max_iter = -1
 
int bottom_max_iter = -1
 
int max_fmg_iter = -1
 
int fixed_iter = -1
 
int verbose = -1
 
int pre_smooth = -1
 
int post_smooth = -1
 
int final_smooth = -1
 
int bottom_smooth = -1
 
std::string bottom_solver
 
Set::Scalar cg_tol_rel = -1.0
 
Set::Scalar cg_tol_abs = -1.0
 
Set::Scalar bottom_tol_rel = -1.0
 
Set::Scalar bottom_tol_abs = -1.0
 
Set::Scalar tol_rel = -1.0
 
Set::Scalar tol_abs = -1.0
 
Set::Scalar omega = -1.0
 
bool average_down_coeffs = false
 
bool normalize_ddw = false
 
Operator::Operator< Grid::Node > * linop
 
amrex::MLMG * mlmg
 
bool m_defined = false
 
bool m_dump_on_fail = false
 
bool m_abort_on_fail = true
 

Detailed Description

This class is a thin wrapper for the amrex::MLMG solver. It exists to set a range of default MLMG settings automatically, for instance, setCFStrategy, which may not be obvious to the user.

It also exists as a compatibility layer so that future fixes for compatibility with AMReX can be implemented here.

Definition at line 19 of file Linear.H.

Constructor & Destructor Documentation

◆ Linear() [1/2]

Solver::Nonlocal::Linear::Linear ( )
inline

Definition at line 23 of file Linear.H.

◆ Linear() [2/2]

Solver::Nonlocal::Linear::Linear ( Operator::Operator< Grid::Node > &  a_lp)
inline

Definition at line 27 of file Linear.H.

Here is the call graph for this function:

◆ ~Linear()

Solver::Nonlocal::Linear::~Linear ( )
inline

Definition at line 32 of file Linear.H.

Here is the call graph for this function:

Member Function Documentation

◆ apply()

void Solver::Nonlocal::Linear::apply ( amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_rhs,
amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_sol 
)
inline

Definition at line 171 of file Linear.H.

Here is the call graph for this function:

◆ Clear()

void Solver::Nonlocal::Linear::Clear ( )
inline

Definition at line 45 of file Linear.H.

Here is the call graph for this function:

◆ Define()

void Solver::Nonlocal::Linear::Define ( Operator::Operator< Grid::Node > &  a_lp)
inline

Definition at line 37 of file Linear.H.

Here is the call graph for this function:

◆ dumpOnConvergenceFail()

void Solver::Nonlocal::Linear::dumpOnConvergenceFail ( const amrex::Vector< amrex::MultiFab * > &  a_sol_mf,
const amrex::Vector< amrex::MultiFab const * > &  a_rhs_mf 
)
inline

Definition at line 188 of file Linear.H.

Here is the call graph for this function:

◆ Parse()

static void Solver::Nonlocal::Linear::Parse ( Linear value,
amrex::ParmParse &  pp 
)
inlinestatic

Definition at line 298 of file Linear.H.

Here is the call graph for this function:

◆ PrepareMLMG()

void Solver::Nonlocal::Linear::PrepareMLMG ( amrex::MLMG &  mlmg)
inlineprotected

Definition at line 257 of file Linear.H.

Here is the call graph for this function:

◆ setBottomMaxIter()

void Solver::Nonlocal::Linear::setBottomMaxIter ( const int  a_bottom_max_iter)
inline

Definition at line 181 of file Linear.H.

◆ setFixedIter()

void Solver::Nonlocal::Linear::setFixedIter ( const int  a_fixed_iter)
inline

Definition at line 183 of file Linear.H.

◆ setMaxFmgIter()

void Solver::Nonlocal::Linear::setMaxFmgIter ( const int  a_max_fmg_iter)
inline

Definition at line 182 of file Linear.H.

◆ setMaxIter()

void Solver::Nonlocal::Linear::setMaxIter ( const int  a_max_iter)
inline

Definition at line 180 of file Linear.H.

◆ setPostSmooth()

void Solver::Nonlocal::Linear::setPostSmooth ( const int  a_post_smooth)
inline

Definition at line 186 of file Linear.H.

◆ setPreSmooth()

void Solver::Nonlocal::Linear::setPreSmooth ( const int  a_pre_smooth)
inline

Definition at line 185 of file Linear.H.

◆ setVerbose()

void Solver::Nonlocal::Linear::setVerbose ( const int  a_verbose)
inline

Definition at line 184 of file Linear.H.

◆ solve() [1/2]

Set::Scalar Solver::Nonlocal::Linear::solve ( amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_sol,
amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_rhs 
)
inline

Definition at line 150 of file Linear.H.

Here is the call graph for this function:

◆ solve() [2/2]

Set::Scalar Solver::Nonlocal::Linear::solve ( amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_sol,
amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_rhs,
Real  a_tol_rel,
Real  a_tol_abs,
const char *  checkpoint_file = nullptr 
)
inline

Definition at line 133 of file Linear.H.

Here is the call graph for this function:

◆ solveaffine()

Set::Scalar Solver::Nonlocal::Linear::solveaffine ( amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_sol,
amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  a_rhs,
Real  a_tol_rel,
Real  a_tol_abs,
bool  copyrhs = false,
const char *  checkpoint_file = nullptr 
)
inline

Definition at line 54 of file Linear.H.

Here is the call graph for this function:

Field Documentation

◆ average_down_coeffs

bool Solver::Nonlocal::Linear::average_down_coeffs = false
protected

Definition at line 251 of file Linear.H.

◆ bottom_max_iter

int Solver::Nonlocal::Linear::bottom_max_iter = -1
protected

Definition at line 235 of file Linear.H.

◆ bottom_smooth

int Solver::Nonlocal::Linear::bottom_smooth = -1
protected

Definition at line 242 of file Linear.H.

◆ bottom_solver

std::string Solver::Nonlocal::Linear::bottom_solver
protected

Definition at line 243 of file Linear.H.

◆ bottom_tol_abs

Set::Scalar Solver::Nonlocal::Linear::bottom_tol_abs = -1.0
protected

Definition at line 247 of file Linear.H.

◆ bottom_tol_rel

Set::Scalar Solver::Nonlocal::Linear::bottom_tol_rel = -1.0
protected

Definition at line 246 of file Linear.H.

◆ cg_tol_abs

Set::Scalar Solver::Nonlocal::Linear::cg_tol_abs = -1.0
protected

Definition at line 245 of file Linear.H.

◆ cg_tol_rel

Set::Scalar Solver::Nonlocal::Linear::cg_tol_rel = -1.0
protected

Definition at line 244 of file Linear.H.

◆ final_smooth

int Solver::Nonlocal::Linear::final_smooth = -1
protected

Definition at line 241 of file Linear.H.

◆ fixed_iter

int Solver::Nonlocal::Linear::fixed_iter = -1
protected

Definition at line 237 of file Linear.H.

◆ linop

Operator::Operator<Grid::Node>* Solver::Nonlocal::Linear::linop
protected

Definition at line 254 of file Linear.H.

◆ m_abort_on_fail

bool Solver::Nonlocal::Linear::m_abort_on_fail = true
protected

Definition at line 389 of file Linear.H.

◆ m_defined

bool Solver::Nonlocal::Linear::m_defined = false
protected

Definition at line 386 of file Linear.H.

◆ m_dump_on_fail

bool Solver::Nonlocal::Linear::m_dump_on_fail = false
protected

Definition at line 388 of file Linear.H.

◆ max_fmg_iter

int Solver::Nonlocal::Linear::max_fmg_iter = -1
protected

Definition at line 236 of file Linear.H.

◆ max_iter

int Solver::Nonlocal::Linear::max_iter = -1
protected

Definition at line 234 of file Linear.H.

◆ mlmg

amrex::MLMG* Solver::Nonlocal::Linear::mlmg
protected

Definition at line 255 of file Linear.H.

◆ normalize_ddw

bool Solver::Nonlocal::Linear::normalize_ddw = false
protected

Definition at line 252 of file Linear.H.

◆ omega

Set::Scalar Solver::Nonlocal::Linear::omega = -1.0
protected

Definition at line 250 of file Linear.H.

◆ post_smooth

int Solver::Nonlocal::Linear::post_smooth = -1
protected

Definition at line 240 of file Linear.H.

◆ pre_smooth

int Solver::Nonlocal::Linear::pre_smooth = -1
protected

Definition at line 239 of file Linear.H.

◆ tol_abs

Set::Scalar Solver::Nonlocal::Linear::tol_abs = -1.0
protected

Definition at line 249 of file Linear.H.

◆ tol_rel

Set::Scalar Solver::Nonlocal::Linear::tol_rel = -1.0
protected

Definition at line 248 of file Linear.H.

◆ verbose

int Solver::Nonlocal::Linear::verbose = -1
protected

Definition at line 238 of file Linear.H.


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