|
IFEM
90A354
|
Class for PETSc solver parameters. More...
#include <PETScSolParams.h>

Public Member Functions | |
| PETScSolParams (const LinSolParams &spar, const ProcessAdm &padm) | |
| Default constructor. More... | |
| ~PETScSolParams () | |
| Destructor. | |
| void | setupPC (PC &pc, size_t block, const std::string &prefix, const std::set< int > &blockEqs, bool setup) |
| Set up preconditioner parameters for PC object. More... | |
| size_t | getNoBlocks () const |
| Obtain number of blocks. | |
| const LinSolParams::BlockParams & | getBlock (size_t i) const |
| Obtain settings for a given block. | |
| int | getIntValue (const std::string &key) const |
| Get integer setting. | |
| double | getDoubleValue (const std::string &key) const |
| Get integer setting. | |
| std::string | getStringValue (const std::string &key) const |
| Get string setting. | |
| bool | hasValue (const std::string &key) const |
| Get integer setting. | |
| LinAlg::LinearSystemType | getLinSysType () const |
| Returns the linear system type. | |
Protected Member Functions | |
| bool | addDirSmoother (PC pc, const Mat &P, int iBlock, const ISMat &dirIndexSet) |
| Set directional smoother. More... | |
| void | setMLOptions (const std::string &prefix, const SettingMap &map) |
| Set ML options. More... | |
| void | setGAMGOptions (const std::string &prefix, const SettingMap &map) |
| Set GAMG options. More... | |
| void | setHypreOptions (const std::string &prefix, const SettingMap &map) |
| Set Hypre options. More... | |
| void | setupCoarseSolver (PC &pc, const std::string &prefix, const SettingMap &map) |
| Setup the coarse solver in a multigrid. More... | |
| void | setupSmoothers (PC &pc, size_t iBlock, const ISMat &dirIndexSet, const std::set< int > &blockEqs, bool setup) |
| Setup the smoothers in a multigrid. More... | |
| void | setupAdditiveSchwarz (PC &pc, size_t block, bool asmlu, bool smoother, const std::set< int > &blockEqs, bool setup) |
| Setup an additive Schwarz preconditioner. More... | |
Protected Attributes | |
| const LinSolParams & | params |
| Reference to linear solver parameters. | |
| const ProcessAdm & | adm |
| Reference to process administrator. | |
Class for PETSc solver parameters.
It contains information about solver method, preconditioner and convergence criteria.
|
inline |
Default constructor.
| [in] | spar | The base linear solver parameters |
| [in] | padm | The process administrator |
|
protected |
Set directional smoother.
| [in] | pc | The preconditioner to add smoother for |
| [in] | P | The preconditioner matrix |
| [in] | iBlock | The index of the block to add smoother to |
| [in] | dirIndexSet | The index set for the smoother |
References LinSolParams::BlockParams::dirSmoother, LinSolParams::getBlock(), params, PCPermApply(), PCPermCreate(), PCPermDestroy(), and PCPermSetUp().
|
protected |
Set GAMG options.
| [in] | prefix | The prefix of the block to set parameters for |
| [in] | map | The map of settings to use |
References condSetup().
Referenced by setupPC().
|
protected |
Set Hypre options.
| [in] | prefix | The prefix of the block to set parameters for |
| [in] | map | The settings to apply |
References AddPrefix(), and condSetup().
Referenced by setupPC().
|
protected |
Set ML options.
| [in] | prefix | The prefix of the block to set parameters for |
| [in] | map | The map of settings to use |
References condSetup().
Referenced by setupPC().
|
protected |
Setup an additive Schwarz preconditioner.
| pc | The preconditioner to set coarse solver for | |
| [in] | block | The block the preconditioner belongs to |
| [in] | asmlu | True to use LU subdomain solvers |
| [in] | smoother | True if this is a smoother in multigrid |
| blockEqs | The local equations belonging to block | |
| setup | True to setup preconditioner |
References adm, ProcessAdm::dd, LinSolParams::getBlock(), DomainDecomposition::getGlobalEq(), SettingMap::getIntValue(), DomainDecomposition::getMinEq(), DomainDecomposition::getSubdomains(), and params.
Referenced by setupPC(), and setupSmoothers().
|
protected |
Setup the coarse solver in a multigrid.
| [in] | pc | The preconditioner to set coarse solver for |
| [in] | prefix | The prefix of the block to set parameters for |
| [in] | map | The settings to apply |
References AddPrefix(), and SettingMap::getStringValue().
Referenced by setupPC().
| void PETScSolParams::setupPC | ( | PC & | pc, |
| size_t | block, | ||
| const std::string & | prefix, | ||
| const std::set< int > & | blockEqs, | ||
| bool | setup | ||
| ) |
Set up preconditioner parameters for PC object.
| pc | Preconditioner to configure |
| block | Block this preconditioner applies to |
| prefix | PETsc param prefix for block |
| blockEqs | The local equations belonging to block |
| setup | True to setup preconditioner |
References adm, LinSolParams::getBlock(), SettingMap::getIntValue(), ProcessAdm::getNoProcs(), SettingMap::getStringValue(), SettingMap::hasValue(), params, setGAMGOptions(), setHypreOptions(), setMLOptions(), setupAdditiveSchwarz(), setupCoarseSolver(), and setupSmoothers().
Referenced by PETScMatrix::setParameters().
|
protected |
Setup the smoothers in a multigrid.
| [in] | pc | The preconditioner to set coarse solver for |
| [in] | iBlock | The index of the block to set parameters for |
| [in] | dirIndexSet | The index set for direction smoothers |
| blockEqs | The local equations belonging to block | |
| setup | True to setup preconditioner |
References adm, LinSolParams::getBlock(), SettingMap::getIntValue(), ProcessAdm::getNoProcs(), SettingMap::getStringValue(), params, and setupAdditiveSchwarz().
Referenced by setupPC().