#include <SASolver.h>

Public Types | |
| typedef std::shared_ptr< AMP::Solver::SolverStrategy > | shared_ptr |
| enum class | SolverStatus { ConvergedOnAbsTol , ConvergedOnRelTol , ConvergedUserCondition , MaxIterations , DivergedLineSearch , DivergedStepSize , DivergedFunctionCount , DivergedOnNan , DivergedNestedSolver , DivergedOther } |
Static Public Member Functions | |
| static std::unique_ptr< SolverStrategy > | createSolver (std::shared_ptr< SolverStrategyParameters > params) |
| static std::string | statusToString (SolverStatus status) |
Protected Member Functions | |
| virtual bool | checkStoppingCriteria (AMP::Scalar res_norm, bool check_iters=true) |
| std::unique_ptr< SolverStrategy > | createRelaxation (size_t lvl, std::shared_ptr< Operator::Operator > A, std::shared_ptr< AMG::RelaxationParameters > params) |
| void | getBaseFromInput (std::shared_ptr< AMP::Database > db) |
| void | makeCoarseSolver () |
| void | resetLevelOptions () |
| reset level-by-level options to overall defaults from outer DB | |
| void | setLevelOptions (const size_t lvl) |
| set level-by-level options to match specific level DB if found | |
| void | setup (std::shared_ptr< LinearAlgebra::Variable > xVar, std::shared_ptr< LinearAlgebra::Variable > bVar) |
| void | smoothP_JacobiL1 (std::shared_ptr< LinearAlgebra::Matrix > A, std::shared_ptr< LinearAlgebra::Matrix > &P) const |
Protected Attributes | |
| std::string | d_agg_type |
| Aggregation method for producing tentative prolongator. | |
| std::shared_ptr< AMG::Aggregator > | d_aggregator |
| Aggregator, may be replaced as level-by-level settings are updated. | |
| bool | d_bComputeResidual = false |
| bool | d_bIsNestedSolver = false |
| bool | d_bUseZeroInitialGuess = true |
| std::unique_ptr< SolverStrategy > | d_coarse_solver |
| Coarse level solver. | |
| std::shared_ptr< SolverStrategyParameters > | d_coarse_solver_params |
| Parameters defining coarse level solver. | |
| CoarsenSettings | d_coarsen_settings |
| Settings applicable to all coarsening methods. | |
| SolverStatus | d_ConvergenceStatus = SolverStatus::DivergedOther |
| KappaKCycle::settings | d_cycle_settings |
| Cycle type, tolerance, kappa value. | |
| AMP::Scalar | d_dAbsoluteTolerance = 1.0e-14 |
| std::shared_ptr< AMP::Database > | d_db = nullptr |
| AMP::Scalar | d_dInitialResidual |
| AMP::Scalar | d_dRelativeTolerance = 1.0e-09 |
| AMP::Scalar | d_dResidualNorm |
| AMP::Utilities::ExecutionSpace | d_exec_space = AMP::Utilities::ExecutionSpace::unspecified |
| execution space for the solver | |
| std::shared_ptr< AMP::Database > | d_global_db = nullptr |
| int | d_iDebugPrintInfoLevel = 0 |
| int | d_iMaxIterations = 0 |
| int | d_iNumberIterations = 0 |
| int | d_iObjectId |
| std::vector< int > | d_iterationHistory |
| keeps track of iteration statistics over solver lifetime | |
| std::vector< AMG::KCycleLevel > | d_levels |
| storage for all levels in hierarchy | |
| size_t | d_max_levels |
| Maximum depth of AMG hierarchy. | |
| Utilities::MemoryType | d_mem_loc |
| Memory location for all given operator and all internally created operators. | |
| AMP::Utilities::MemoryType | d_memory_location = AMP::Utilities::MemoryType::none |
| memory storage address space | |
| size_t | d_min_coarse_global |
| Smallest number of global rows allowed in operator, terminates hierarchy. | |
| int | d_min_coarse_local |
| Smallest number of locally owned rows allowed in operator, terminates hierarchy. | |
| int | d_num_smooth_prol |
| Number of smoothing steps applied to tentative prolongator. | |
| PairwiseCoarsenSettings | d_pair_coarsen_settings |
| Settings specific to pairwise coarsening method. | |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_pFunctionScaling |
| std::shared_ptr< AMP::Solver::SolverStrategy > | d_pNestedSolver = nullptr |
| nested solver used by this solver | |
| std::shared_ptr< AMP::Operator::Operator > | d_pOperator = nullptr |
| std::shared_ptr< AMP::Database > | d_post_relax_db |
| Database defining post-cycle relaxation solver. | |
| std::shared_ptr< AMG::RelaxationParameters > | d_post_relax_params |
| Parameters read from d_post_relax_db. | |
| std::shared_ptr< AMP::Database > | d_pre_relax_db |
| Database defining pre-cycle relaxation solver. | |
| std::shared_ptr< AMG::RelaxationParameters > | d_pre_relax_params |
| Parameters read from d_pre_relax_db. | |
| float | d_prol_spec_lower |
| Lower bound on spectrum for prolongator smoother, must be in (0,1) | |
| float | d_prol_trunc |
| Truncation parameter for pruning smoothed prolongator, removes [-trunc,trunc]. | |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_pSolutionScaling |
| bool | d_save_to_file |
| flag to save hierarchy after setup phase | |
| std::string | d_save_to_file_name |
| base path+name for saving hierarchy | |
| bool | d_save_to_file_on_ftc |
| flag to save hierarchy after failure to converge | |
| std::string | d_sName |
| std::shared_ptr< AMP::IO::Writer > | d_writer = nullptr |
Static Protected Attributes | |
| static int | d_iInstanceId |
Definition at line 23 of file SASolver.h.
|
inherited |
Definition at line 30 of file SolverStrategy.h.
|
stronginherited |
| Enumerator | |
|---|---|
| ConvergedOnAbsTol | |
| ConvergedOnRelTol | |
| ConvergedUserCondition | |
| MaxIterations | |
| DivergedLineSearch | |
| DivergedStepSize | |
| DivergedFunctionCount | |
| DivergedOnNan | |
| DivergedNestedSolver | |
| DivergedOther | |
Definition at line 62 of file SolverStrategy.h.
|
explicit |
|
pure virtualinherited |
Solve the system \(A(u) = f\). This is a pure virtual function that the derived classes need to provide an implementation of.
| [in] | f | shared pointer to right hand side vector |
| [out] | u | shared pointer to approximate computed solution |
Implemented in AMP::Solver::BDFRadDifOpPJacOpSplitPrec, AMP::Solver::AMG::UASolver, AMP::Solver::BandedSolver, AMP::Solver::BiCGSTABSolver< T >, AMP::Solver::CGSolver< T >, AMP::Solver::ColumnSolver, AMP::Solver::ConstraintsEliminationSolver, AMP::Solver::DiagonalSolver< T >, AMP::Solver::BoomerAMGSolver, AMP::Solver::HypreSolver, AMP::Solver::CoupledFlow1DSolver, AMP::Solver::Flow1DSolver, AMP::Solver::PelletStackMechanicsSolver, AMP::Solver::NonlinearKrylovAccelerator< T >, AMP::Solver::OnePointSolver, AMP::Solver::PetscKrylovSolver, AMP::Solver::PetscSNESSolver, AMP::Solver::QMRCGSTABSolver< T >, AMP::Solver::TFQMRSolver< T >, AMP::Solver::TrilinosMLSolver, AMP::Solver::TrilinosMueLuSolver, and AMP::Solver::TrilinosNOXSolver.
|
override |
|
protectedvirtualinherited |
|
protected |
|
inlinestatic |
Definition at line 28 of file SASolver.h.
|
inlineinherited |
Definition at line 208 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dAbsoluteTolerance.
|
protectedinherited |
Definition at line 225 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::ConvergedUserCondition, and AMP::Solver::SolverStrategy::d_ConvergenceStatus.
|
inlineinherited |
Definition at line 230 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_ConvergenceStatus.
|
inlineinherited |
Definition at line 232 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_ConvergenceStatus, and AMP::Solver::SolverStrategy::statusToString().
Get level of diagnostic information printed during iterations.
Definition at line 137 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iDebugPrintInfoLevel.
|
inlineinherited |
Definition at line 269 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_exec_space.
|
inlineinherited |
Definition at line 267 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_pFunctionScaling.
|
inlinevirtualinherited |
Definition at line 241 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dInitialResidual.
|
inlinevirtualinherited |
Definition at line 243 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iterationHistory.
Return the number of iterations taken by the solver to converge.
Definition at line 142 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iNumberIterations.
Definition at line 218 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iMaxIterations.
|
inlinevirtualinherited |
Return a nested solver (eg preconditioner) if it exists. By default return a nullptr
Reimplemented in AMP::Solver::PetscSNESSolver.
Definition at line 172 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_pNestedSolver.
|
virtualinherited |
Return a shared pointer to the operator registered with the solver.
|
inlineinherited |
Definition at line 212 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dRelativeTolerance.
|
inlinevirtualinherited |
Definition at line 239 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dResidualNorm.
|
inlineinherited |
Definition at line 266 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_pSolutionScaling.
|
virtualinherited |
Initialize the solution vector and potentially create internal vectors needed for solution
| [in] | parameters | The parameters object contains a database object. Currently there are no required fields for the database object. |
Reimplemented in AMP::Solver::BoomerAMGSolver, AMP::Solver::HypreBiCGSTABSolver, AMP::Solver::HypreGMRESSolver, AMP::Solver::HyprePCGSolver, AMP::Solver::HypreSolver, AMP::Solver::Flow1DSolver, AMP::Solver::PetscKrylovSolver, AMP::Solver::TrilinosMLSolver, AMP::Solver::TrilinosMueLuSolver, AMP::Solver::TrilinosNOXSolver, AMP::Solver::BiCGSTABSolver< T >, AMP::Solver::CGSolver< T >, AMP::Solver::DiagonalSolver< T >, AMP::Solver::GMRESRSolver< T >, AMP::Solver::GMRESSolver< T >, AMP::Solver::QMRCGSTABSolver< T >, and AMP::Solver::TFQMRSolver< T >.
|
protected |
Definition at line 237 of file SolverStrategy.h.
|
inlinevirtualinherited |
Reimplemented in AMP::Solver::PetscSNESSolver.
Definition at line 251 of file SolverStrategy.h.
|
inlinevirtualinherited |
Reimplemented in AMP::Solver::NonlinearKrylovAccelerator< T >.
Definition at line 220 of file SolverStrategy.h.
|
virtualinherited |
Register the operator that the solver will use during solves
| [in] | op | shared pointer to operator \(A()\) for equation \(A(u) = f\) |
Reimplemented in AMP::Solver::BiCGSTABSolver< T >, AMP::Solver::CGSolver< T >, AMP::Solver::DiagonalSolver< T >, AMP::Solver::GMRESSolver< T >, AMP::Solver::HypreSolver, AMP::Solver::PetscKrylovSolver, AMP::Solver::TFQMRSolver< T >, AMP::Solver::TrilinosMLSolver, AMP::Solver::TrilinosMueLuSolver, AMP::Solver::NonlinearKrylovAccelerator< T >, AMP::Solver::AMG::HybridGS, AMP::Solver::AMG::JacobiL1, and AMP::Solver::AMG::UASolver.
|
override |
|
inlinevirtualinherited |
Registers a writer with the solver.
This function will register a writer with the solver. The solver may then register any vector components it "owns" with the writer.
| writer | The writer to register |
Definition at line 186 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_writer.
|
virtualinherited |
Resets the solver internally with new parameters if necessary
| parameters | SolverStrategyParameters object that is NULL by default |
Reimplemented in AMP::Solver::TrilinosNOXSolver, AMP::Solver::BandedSolver, AMP::Solver::BoomerAMGSolver, AMP::Solver::HypreBiCGSTABSolver, AMP::Solver::HypreGMRESSolver, AMP::Solver::HyprePCGSolver, AMP::Solver::HypreSolver, AMP::Solver::TrilinosMLSolver, AMP::Solver::TrilinosMueLuSolver, AMP::Solver::CoupledFlow1DSolver, and AMP::Solver::Flow1DSolver.
|
protected |
reset level-by-level options to overall defaults from outer DB
|
virtualinherited |
Resets the operator registered with the solver with new parameters if necessary
| parameters | OperatorParameters object that is NULL by default |
Reimplemented in AMP::Solver::PetscKrylovSolver, AMP::Solver::BandedSolver, AMP::Solver::ColumnSolver, AMP::Solver::HypreSolver, AMP::Solver::CoupledFlow1DSolver, AMP::Solver::Flow1DSolver, AMP::Solver::PelletStackMechanicsSolver, AMP::Solver::TrilinosMLSolver, and AMP::Solver::TrilinosMueLuSolver.
|
virtualinherited |
|
inlinevirtualinherited |
Definition at line 210 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dAbsoluteTolerance.
|
inlineinherited |
for multiphysics problems it may be necessary to scale the solution
Definition at line 259 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_pFunctionScaling, and AMP::Solver::SolverStrategy::d_pSolutionScaling.
|
inlinevirtualinherited |
Specify level of diagnostic information printed during iterations.
| [in] | print_level | integer level value with permissible values 0 and higher. Setting to zero should provide minimial debugging information with higher values resulting in increasingly verbose information being printed out. |
Definition at line 132 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iDebugPrintInfoLevel.
|
inlineinherited |
Definition at line 270 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_exec_space.
|
virtualinherited |
Provide the initial guess for the solver. This is a pure virtual function that the derived classes need to provide an implementation of.
| [in] | initialGuess | shared pointer to the initial guess vector. |
Reimplemented in AMP::Solver::ColumnSolver, AMP::Solver::CoupledFlow1DSolver, AMP::Solver::Flow1DSolver, AMP::Solver::PetscSNESSolver, and AMP::Solver::TrilinosNOXSolver.
Tell a solver that it is nested inside some outer solver.
Definition at line 166 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_bIsNestedSolver.
set level-by-level options to match specific level DB if found
|
inlinevirtualinherited |
Definition at line 216 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iMaxIterations.
|
inlinevirtualinherited |
Set a nested solver, eg, Krylov for Newton, preconditioner for Krylov etc. Null op in base class
Definition at line 159 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_pNestedSolver.
|
inlinevirtualinherited |
Definition at line 214 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dRelativeTolerance.
|
protected |
|
inlinevirtualinherited |
Tells the solver to use an initial guess of zero and not try to copy an initial guess into the solution vector
| [in] | use_zero_guess | boolean to specify whether zero initial guess should be used or not. |
Reimplemented in AMP::Solver::PetscKrylovSolver.
Definition at line 150 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_bUseZeroInitialGuess.
|
protected |
|
inlinestaticinherited |
Definition at line 75 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::ConvergedOnAbsTol, AMP::Solver::SolverStrategy::ConvergedOnRelTol, AMP::Solver::SolverStrategy::ConvergedUserCondition, AMP::Solver::SolverStrategy::DivergedFunctionCount, AMP::Solver::SolverStrategy::DivergedLineSearch, AMP::Solver::SolverStrategy::DivergedNestedSolver, AMP::Solver::SolverStrategy::DivergedOnNan, AMP::Solver::SolverStrategy::DivergedStepSize, and AMP::Solver::SolverStrategy::MaxIterations.
Referenced by AMP::Solver::SolverStrategy::getConvergenceStatusString().
|
inlineoverridevirtual |
Return the name of the solver.
Implements AMP::Solver::SolverStrategy.
Definition at line 33 of file SASolver.h.
|
protected |
Aggregation method for producing tentative prolongator.
Definition at line 69 of file SASolver.h.
|
protected |
Aggregator, may be replaced as level-by-level settings are updated.
Definition at line 82 of file SASolver.h.
Definition at line 295 of file SolverStrategy.h.
Definition at line 294 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::setIsNestedSolver().
Definition at line 292 of file SolverStrategy.h.
Referenced by AMP::Solver::OnePointSolver::apply(), and AMP::Solver::SolverStrategy::setZeroInitialGuess().
|
protected |
Coarse level solver.
Definition at line 90 of file SASolver.h.
|
protected |
Parameters defining coarse level solver.
Definition at line 88 of file SASolver.h.
|
protected |
Settings applicable to all coarsening methods.
Definition at line 71 of file SASolver.h.
|
protectedinherited |
Definition at line 276 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getConverged(), AMP::Solver::SolverStrategy::getConvergenceStatus(), and AMP::Solver::SolverStrategy::getConvergenceStatusString().
|
protected |
Cycle type, tolerance, kappa value.
Definition at line 53 of file SASolver.h.
|
protectedinherited |
Definition at line 287 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getAbsoluteTolerance(), and AMP::Solver::SolverStrategy::setAbsoluteTolerance().
|
protectedinherited |
Definition at line 304 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 285 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getInitialResidual().
|
protectedinherited |
Definition at line 288 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getRelativeTolerance(), and AMP::Solver::SolverStrategy::setRelativeTolerance().
|
protectedinherited |
Definition at line 284 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getResidualNorm().
|
protectedinherited |
execution space for the solver
Definition at line 324 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getExecutionSpace(), and AMP::Solver::SolverStrategy::setExecutionSpace().
|
protectedinherited |
Pointer to global database This is temporary fix and eventually either d_global_db or d_db should go away This is introduced to allow for solver factories to access databases in the global database for the construction of nested solvers
Definition at line 311 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 290 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getDebugPrintInfoLevel(), and AMP::Solver::SolverStrategy::setDebugPrintInfoLevel().
|
staticprotectedinherited |
Definition at line 299 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 282 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getMaxIterations(), and AMP::Solver::SolverStrategy::setMaxIterations().
|
protectedinherited |
Definition at line 280 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getIterations().
|
protectedinherited |
Definition at line 297 of file SolverStrategy.h.
|
protectedinherited |
keeps track of iteration statistics over solver lifetime
Definition at line 302 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getIterationHistory().
|
protected |
storage for all levels in hierarchy
Definition at line 80 of file SASolver.h.
|
protected |
Maximum depth of AMG hierarchy.
Definition at line 47 of file SASolver.h.
|
protected |
Memory location for all given operator and all internally created operators.
Definition at line 45 of file SASolver.h.
|
protectedinherited |
memory storage address space
Definition at line 327 of file SolverStrategy.h.
|
protected |
Smallest number of global rows allowed in operator, terminates hierarchy.
Definition at line 51 of file SASolver.h.
|
protected |
Smallest number of locally owned rows allowed in operator, terminates hierarchy.
Definition at line 49 of file SASolver.h.
|
protected |
Number of smoothing steps applied to tentative prolongator.
Definition at line 63 of file SASolver.h.
|
protected |
Settings specific to pairwise coarsening method.
Definition at line 73 of file SASolver.h.
|
protectedinherited |
Definition at line 314 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getFunctionScaling(), and AMP::Solver::SolverStrategy::setComponentScalings().
|
protectedinherited |
nested solver used by this solver
Definition at line 319 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getNestedSolver(), and AMP::Solver::SolverStrategy::setNestedSolver().
|
protectedinherited |
Definition at line 316 of file SolverStrategy.h.
|
protected |
Database defining post-cycle relaxation solver.
Definition at line 77 of file SASolver.h.
|
protected |
Parameters read from d_post_relax_db.
Definition at line 86 of file SASolver.h.
|
protected |
Database defining pre-cycle relaxation solver.
Definition at line 75 of file SASolver.h.
|
protected |
Parameters read from d_pre_relax_db.
Definition at line 84 of file SASolver.h.
|
protected |
Lower bound on spectrum for prolongator smoother, must be in (0,1)
Definition at line 65 of file SASolver.h.
|
protected |
Truncation parameter for pruning smoothed prolongator, removes [-trunc,trunc].
Definition at line 67 of file SASolver.h.
|
protectedinherited |
Definition at line 313 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getSolutionScaling(), and AMP::Solver::SolverStrategy::setComponentScalings().
|
protected |
flag to save hierarchy after setup phase
Definition at line 55 of file SASolver.h.
|
protected |
base path+name for saving hierarchy
Definition at line 59 of file SASolver.h.
|
protected |
flag to save hierarchy after failure to converge
Definition at line 57 of file SASolver.h.
|
protectedinherited |
Definition at line 278 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 321 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::registerWriter().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:45. Comments on this page |