NOX Development
|
Nonlinear solver based on Anderson Acceleration. More...
#include <NOX_Solver_AndersonAcceleration.H>
Public Member Functions | |
AndersonAcceleration (const Teuchos::RCP< NOX::Abstract::Group > &grp, const Teuchos::RCP< NOX::StatusTest::Generic > &tests, const Teuchos::RCP< Teuchos::ParameterList > ¶ms) | |
Constructor. | |
virtual | ~AndersonAcceleration () |
Destructor. | |
virtual void | reset () |
Resets the solver for another solve. This resets the counters and status only. Uses the final solution from the last solve as the initial guess for the next solve. | |
virtual void | reset (const NOX::Abstract::Vector &initialGuess) |
Resets the solver and sets a new initial guess. | |
virtual void | reset (const NOX::Abstract::Vector &initialGuess, const Teuchos::RCP< NOX::StatusTest::Generic > &tests) |
Resets the solver, sets a new status test, and sets a new initial guess. | |
virtual NOX::StatusTest::StatusType | step () |
Do one nonlinear step in the iteration sequence and return status. | |
virtual NOX::StatusTest::StatusType | solve () |
Solve the nonlinear problem and return final status. | |
virtual const NOX::Abstract::Group & | getSolutionGroup () const |
Return a reference to the current solution group. | |
virtual const NOX::Abstract::Group & | getPreviousSolutionGroup () const |
Return a reference to the previous solution group. | |
virtual NOX::StatusTest::StatusType | getStatus () const |
Returns the current status of the solver. | |
virtual int | getNumIterations () const |
Get number of iterations. | |
virtual const Teuchos::ParameterList & | getList () const |
Return a reference to the solver parameters. | |
virtual double | getStepSize () const |
virtual Teuchos::RCP< const NOX::Abstract::Group > | getSolutionGroupPtr () const |
Return a RCP to the solution group. | |
virtual Teuchos::RCP< const NOX::Abstract::Group > | getPreviousSolutionGroupPtr () const |
Return a RCP to the previous solution group. | |
virtual Teuchos::RCP< const Teuchos::ParameterList > | getListPtr () const |
Return a RCP to the solver parameters. | |
virtual Teuchos::RCP< const NOX::SolverStats > | getSolverStatistics () const |
Return a RCP to the solver statistics. | |
![]() | |
Generic () | |
Constructor (does nothing) | |
virtual | ~Generic () |
Destructor (does nothing) | |
Protected Member Functions | |
virtual void | init () |
Print out initialization information and calcuate the RHS. | |
virtual void | printUpdate () |
Prints the current iteration information. | |
void | qrAdd (NOX::Abstract::Vector &newCol) |
Updates QR factors by addition of a column. | |
void | qrDelete () |
Updates QR factors by deletion of a column. | |
void | reorthogonalize () |
Reorthogonalized columns of Q and updates factorization. | |
Protected Attributes | |
Teuchos::RCP< NOX::GlobalData > | globalDataPtr |
Pointer to the global data object. | |
Teuchos::RCP< NOX::Utils > | utilsPtr |
Utils. | |
Teuchos::RCP< NOX::Abstract::Group > | solnPtr |
Current solution. | |
Teuchos::RCP< NOX::Abstract::Group > | oldSolnPtr |
Previous solution pointer. | |
Teuchos::RCP< NOX::StatusTest::Generic > | testPtr |
Stopping test. | |
Teuchos::RCP< Teuchos::ParameterList > | paramsPtr |
Input parameters. | |
Teuchos::RCP< NOX::LineSearch::Generic > | lineSearchPtr |
Linesearch. | |
bool | precond |
Flag for preconditioning. | |
bool | recomputeJacobian |
Flag to recompute Jacobian each iterate. Needed if Jacobian required to apply preconditioner. | |
Teuchos::RCP< NOX::Abstract::Vector > | workVec |
Vector for temporary storage. | |
Teuchos::RCP< NOX::Abstract::Vector > | precF |
Current preconditioned function value. | |
Teuchos::RCP< NOX::Abstract::Vector > | oldPrecF |
Previous preconditioned function value. | |
int | storeParam |
Maximum storage depth. | |
int | nStore |
Current storage depth. | |
double | mixParam |
Mixing parameter. | |
double | stepSize |
Current step. | |
std::vector< Teuchos::RCP< NOX::Abstract::Vector > > | xMat |
"Matrix" of successive iterate differences | |
std::vector< Teuchos::RCP< NOX::Abstract::Vector > > | qMat |
Q factor the for least-squares problem. | |
Teuchos::SerialDenseMatrix< int, double > | rMat |
R factor for the least-squares problem. | |
int | nIter |
Number of nonlinear iterations. | |
int | orthoFrequency |
Frequency for reorthogonalization of QR factors. If nonpositive, we never reorthogonalize. | |
NOX::StatusTest::StatusType | status |
Status of nonlinear solver. | |
NOX::StatusTest::CheckType | checkType |
Type of check to use for status tests. See NOX::StatusTest for more details. | |
Teuchos::RCP< NOX::Observer > | observer |
Pointer to a user defined NOX::Observer object. | |
std::vector< double > | WORK |
Scratch space for condition number estimation using LAPACK. | |
std::vector< int > | IWORK |
Scratch space for condition number estimation using LAPACK. | |
bool | adjustForConditionNumber |
If true, the QR matrix will be resized if the condiiton number is greater than the dropTolerance. | |
double | dropTolerance |
Value of the condition number above which the QR matrix is resized. | |
int | accelerationStartIteration |
The nonlinear iteration where Anderson Acceleration will start. | |
bool | disableChecksForUnitTesting |
Disables the storage depth size check - used for unit testing corner cases only. | |
Nonlinear solver based on Anderson Acceleration.
Solves
This method requires a mixing parameter
For the first iteration, the solver computes
Each iteration afterward, the solver does the following.
Set
Solve the least-squares problem:
Calculate the new iterate: $x_{k+1} = \sum_{i=0}^{m_k} \alpha_i[x_{k-i} + \beta M(x_{k-i})F(x_{k-i})]$.
The iterations progress until the status tests (see NOX::StatusTest) determine either failure or convergence.
Input Parameters
The following parameter list entries are valid for this solver:
Output Parameters
Every time solve() is called, a sublist for output parameters called "Output" will be created and contain the following parameters.
"Output":
NOX::Solver::AndersonAcceleration::AndersonAcceleration | ( | const Teuchos::RCP< NOX::Abstract::Group > & | grp, |
const Teuchos::RCP< NOX::StatusTest::Generic > & | tests, | ||
const Teuchos::RCP< Teuchos::ParameterList > & | params ) |
Constructor.
See reset(NOX::Abstract::Group&, NOX::StatusTest::Generic&, Teuchos::ParameterList&) for description
References NOX::DeepCopy, globalDataPtr, init(), observer, NOX::Solver::parseObserver(), NOX::ShapeCopy, utilsPtr, and NOX::Solver::validateSolverOptionsSublist().
|
virtual |
Return a reference to the solver parameters.
Implements NOX::Solver::Generic.
|
inlinevirtual |
|
virtual |
Get number of iterations.
Implements NOX::Solver::Generic.
|
virtual |
Return a reference to the previous solution group.
Implements NOX::Solver::Generic.
|
inlinevirtual |
Return a RCP to the previous solution group.
Implements NOX::Solver::Generic.
References oldSolnPtr.
|
virtual |
Return a reference to the current solution group.
Implements NOX::Solver::Generic.
|
inlinevirtual |
|
virtual |
Return a RCP to the solver statistics.
Implements NOX::Solver::Generic.
|
virtual |
Returns the current status of the solver.
Implements NOX::Solver::Generic.
|
virtual |
Resets the solver for another solve. This resets the counters and status only. Uses the final solution from the last solve as the initial guess for the next solve.
NOTE: All NOX solvers will call reset() automatically at teh beginning of the solve() method. We add the reset() method to the solver interface for the application to call in case the application needs to reset counters and status manually before the next call to solve() is made.
Implements NOX::Solver::Generic.
References NOX::StatusTest::Unconverged.
|
virtual |
Resets the solver and sets a new initial guess.
Implements NOX::Solver::Generic.
References NOX::StatusTest::Unconverged.
|
virtual |
Resets the solver, sets a new status test, and sets a new initial guess.
Implements NOX::Solver::Generic.
References NOX::StatusTest::Unconverged.
|
virtual |
Solve the nonlinear problem and return final status.
By "solve", we call iterate() until the NOX::StatusTest value is either NOX::StatusTest::Converged or NOX::StatusTest::Failed.
Implements NOX::Solver::Generic.
References NOX::StatusTest::Unconverged.
|
virtual |
Do one nonlinear step in the iteration sequence and return status.
Implements NOX::Solver::Generic.
References NOX::StatusTest::Converged, NOX::Utils::Details, NOX::StatusTest::Failed, NOX::Abstract::Group::Ok, NOX::StatusTest::Unconverged, and NOX::Utils::Warning.