#include <NonlinearKrylovAccelerator.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< AMP::Solver::SolverStrategy > | createSolver (std::shared_ptr< AMP::Solver::SolverStrategyParameters > solverStrategyParameters) |
| static std::string | statusToString (SolverStatus status) |
Protected Member Functions | |
| virtual bool | checkStoppingCriteria (AMP::Scalar res_norm, bool check_iters=true) |
| void | getBaseFromInput (std::shared_ptr< AMP::Database > db) |
Static Protected Attributes | |
| static int | d_iInstanceId |
Private Member Functions | |
| std::shared_ptr< AMP::Operator::Operator > | createPreconditionerOperator (std::shared_ptr< AMP::Operator::Operator > op) |
| void | factorizeNormalMatrix (void) |
| std::vector< T > | forwardbackwardSolve (std::shared_ptr< AMP::LinearAlgebra::Vector > f) |
| forward backward solve for Cholesky | |
| void | getFromInput (std::shared_ptr< AMP::Database > db) |
| void | initialize (std::shared_ptr< AMP::LinearAlgebra::Vector > solution_vector) |
| NonlinearKrylovAccelerator ()=delete | |
| NonlinearKrylovAccelerator (const NonlinearKrylovAccelerator &)=delete | |
| NonlinearKrylovAccelerator (NonlinearKrylovAccelerator &&)=delete | |
| NonlinearKrylovAccelerator & | operator= (const NonlinearKrylovAccelerator &)=delete |
Private Attributes | |
| bool | d_adaptive_damping = false |
| whether to use damping | |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_correction_vector |
| correction vectors | |
| int | d_current_correction = 0 |
| T | d_eta = 1.0 |
| keeps track of the number of function applications | |
| int | d_first = 0 |
| matrix of w vector inner products | |
| int | d_free = 0 |
| index of last subspace vector | |
| bool | d_freeze_pc = true |
| whether the solver uses a preconditioner or not | |
| int | d_function_apply_count = 0 |
| keeps track of the number of preconditioner applications | |
| T ** | d_h |
| function difference vectors | |
| int | d_last = 0 |
| index of first subspace vector | |
| int | d_maximum_function_evals = 0 |
| previous index link field in doubly-linked subspace v | |
| int | d_mvec = 0 |
| use qr factorization to solve the least squares problem | |
| std::vector< int > | d_next |
| index of the initial vector in free storage linked list | |
| bool | d_pending = false |
| boolean: a nonempty subspace | |
| int | d_preconditioner_apply_count |
| std::vector< int > | d_prev |
| next index link field | |
| bool | d_print_residuals = false |
| flag determining whether the preconditioner is frozen or not | |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_residual_vector |
| correction vectors | |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | d_solution_vector |
| vector drop tolerance | |
| bool | d_solver_initialized = false |
| whether to print the residuals | |
| bool | d_subspace = false |
| bool | d_use_damping = false |
| bool | d_use_qr = false |
| contains pending vectors – boolean | |
| bool | d_uses_preconditioner = false |
| damping factor | |
| std::vector< std::shared_ptr< AMP::LinearAlgebra::Vector > > | d_v |
| correction vectors | |
| T | d_vtol = 0.0 |
| maximum number of subspace vectors | |
| std::vector< std::shared_ptr< AMP::LinearAlgebra::Vector > > | d_w |
| correction vectors | |
Definition at line 17 of file NonlinearKrylovAccelerator.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 |
|
privatedelete |
|
privatedelete |
|
privatedelete |
|
overridevirtual |
Solve the system \(A(u) = f\). The solution \(u\) and the right hand side \(f\) are specified via vectors on the patch hierarchy. This function returns zero if the solver converged within the specified tolerances and nonzero otherwise. Member functions getIterations() and getRelativeNorm() return the iterations and relative norm, respectively, from the solver.
| f | vector for right hand side, can be nullptr |
| u | vector for solution variables |
Implements AMP::Solver::SolverStrategy.
|
protectedvirtualinherited |
| void AMP::Solver::NonlinearKrylovAccelerator< T >::correction | ( | std::shared_ptr< AMP::LinearAlgebra::Vector > | f | ) |
|
private |
|
inlinestatic |
Definition at line 27 of file NonlinearKrylovAccelerator.h.
|
private |
|
private |
forward backward solve for Cholesky
|
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.
|
private |
|
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.
| int AMP::Solver::NonlinearKrylovAccelerator< T >::getMaxFunctionEvaluations | ( | ) | const |
Get maximum function evaluations by nonlinear solver.
Definition at line 218 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iMaxIterations.
| int AMP::Solver::NonlinearKrylovAccelerator< T >::getMaxNonlinearIterations | ( | ) | const |
Get maximum iterations for nonlinear solver.
|
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.
|
private |
|
override |
|
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 >.
|
privatedelete |
Definition at line 237 of file SolverStrategy.h.
|
inlinevirtualinherited |
Reimplemented in AMP::Solver::PetscSNESSolver.
Definition at line 251 of file SolverStrategy.h.
|
overridevirtual |
Reimplemented from AMP::Solver::SolverStrategy.
|
finaloverridevirtual |
Register the operator that the solver will use during solves
| [in] | op | shared pointer to operator \(A()\) for equation \(A(u) = f\) |
Reimplemented from AMP::Solver::SolverStrategy.
|
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.
|
override |
Resets the solver internally with new parameters if necessary
| parameters | SolverStrategyParameters object that is NULL by default |
|
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.
|
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.
| void AMP::Solver::NonlinearKrylovAccelerator< T >::setMaxFunctionEvaluations | ( | int | max_feval | ) |
Set maximum function evaluations in nonlinear solver.
|
inlinevirtualinherited |
Definition at line 216 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iMaxIterations.
| void AMP::Solver::NonlinearKrylovAccelerator< T >::setMaxNonlinearIterations | ( | int | max_nli | ) |
Set maximum iterations for nonlinear solver.
|
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.
|
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.
|
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 32 of file NonlinearKrylovAccelerator.h.
|
private |
whether to use damping
Definition at line 144 of file NonlinearKrylovAccelerator.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().
|
protectedinherited |
Definition at line 276 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getConverged(), AMP::Solver::SolverStrategy::getConvergenceStatus(), and AMP::Solver::SolverStrategy::getConvergenceStatusString().
|
private |
correction vectors
Definition at line 117 of file NonlinearKrylovAccelerator.h.
|
private |
Definition at line 131 of file NonlinearKrylovAccelerator.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().
|
private |
keeps track of the number of function applications
Definition at line 137 of file NonlinearKrylovAccelerator.h.
|
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().
|
private |
matrix of w vector inner products
Definition at line 124 of file NonlinearKrylovAccelerator.h.
|
private |
index of last subspace vector
Definition at line 126 of file NonlinearKrylovAccelerator.h.
|
private |
whether the solver uses a preconditioner or not
Definition at line 140 of file NonlinearKrylovAccelerator.h.
|
private |
keeps track of the number of preconditioner applications
Definition at line 135 of file NonlinearKrylovAccelerator.h.
|
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.
|
private |
function difference vectors
Definition at line 121 of file NonlinearKrylovAccelerator.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().
|
private |
index of first subspace vector
Definition at line 125 of file NonlinearKrylovAccelerator.h.
|
private |
previous index link field in doubly-linked subspace v
Definition at line 130 of file NonlinearKrylovAccelerator.h.
|
protectedinherited |
memory storage address space
Definition at line 327 of file SolverStrategy.h.
|
private |
use qr factorization to solve the least squares problem
Definition at line 112 of file NonlinearKrylovAccelerator.h.
|
private |
index of the initial vector in free storage linked list
Definition at line 127 of file NonlinearKrylovAccelerator.h.
|
private |
boolean: a nonempty subspace
Definition at line 109 of file NonlinearKrylovAccelerator.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.
|
private |
current number of corrections, updated each time correction is called
Definition at line 133 of file NonlinearKrylovAccelerator.h.
|
private |
next index link field
Definition at line 128 of file NonlinearKrylovAccelerator.h.
|
private |
flag determining whether the preconditioner is frozen or not
Definition at line 141 of file NonlinearKrylovAccelerator.h.
|
protectedinherited |
Definition at line 313 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getSolutionScaling(), and AMP::Solver::SolverStrategy::setComponentScalings().
|
private |
correction vectors
Definition at line 116 of file NonlinearKrylovAccelerator.h.
|
protectedinherited |
Definition at line 278 of file SolverStrategy.h.
|
private |
vector drop tolerance
Definition at line 115 of file NonlinearKrylovAccelerator.h.
|
private |
whether to print the residuals
Definition at line 142 of file NonlinearKrylovAccelerator.h.
|
private |
Definition at line 108 of file NonlinearKrylovAccelerator.h.
|
private |
Definition at line 143 of file NonlinearKrylovAccelerator.h.
|
private |
contains pending vectors – boolean
Definition at line 110 of file NonlinearKrylovAccelerator.h.
|
private |
damping factor
Definition at line 139 of file NonlinearKrylovAccelerator.h.
|
private |
correction vectors
Definition at line 119 of file NonlinearKrylovAccelerator.h.
|
private |
maximum number of subspace vectors
Definition at line 113 of file NonlinearKrylovAccelerator.h.
|
private |
correction vectors
Definition at line 120 of file NonlinearKrylovAccelerator.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 |