NOX Development
|
Newton-like solver using a trust region. More...
#include <NOX_Solver_TrustRegionBased.H>
Public Member Functions | |
TrustRegionBased (const Teuchos::RCP< NOX::Abstract::Group > &grp, const Teuchos::RCP< NOX::StatusTest::Generic > &tests, const Teuchos::RCP< Teuchos::ParameterList > ¶ms) | |
Constructor. | |
virtual | ~TrustRegionBased () |
Destructor. | |
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 void | reset (const NOX::Abstract::Vector &initialGuess) |
Resets the solver and sets a new initial guess. | |
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 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 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) | |
virtual void | reset ()=0 |
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 &initial_guess)=0 |
Resets the solver and sets a new initial guess. | |
virtual void | reset (const NOX::Abstract::Vector &initial_guess, const Teuchos::RCP< NOX::StatusTest::Generic > &test)=0 |
Resets the solver, sets a new status test, and sets a new initial guess. | |
virtual NOX::StatusTest::StatusType | step ()=0 |
Do one nonlinear step in the iteration sequence and return status. | |
virtual NOX::StatusTest::StatusType | solve ()=0 |
Solve the nonlinear problem and return final status. | |
virtual const NOX::Abstract::Group & | getSolutionGroup () const =0 |
Return a reference to the current solution group. | |
virtual const NOX::Abstract::Group & | getPreviousSolutionGroup () const =0 |
Return a reference to the previous solution group. | |
virtual NOX::StatusTest::StatusType | getStatus () const =0 |
Returns the current status of the solver. | |
virtual int | getNumIterations () const =0 |
Get number of iterations. | |
virtual const Teuchos::ParameterList & | getList () const =0 |
Return a reference to the solver parameters. | |
virtual Teuchos::RCP< const NOX::Abstract::Group > | getSolutionGroupPtr () const =0 |
Return a RCP to the solution group. | |
virtual Teuchos::RCP< const NOX::Abstract::Group > | getPreviousSolutionGroupPtr () const =0 |
Return a RCP to the previous solution group. | |
virtual Teuchos::RCP< const Teuchos::ParameterList > | getListPtr () const =0 |
Return a RCP to the solver parameters. | |
virtual Teuchos::RCP< const NOX::SolverStats > | getSolverStatistics () const =0 |
Return a RCP to the solver statistics. | |
Protected Types | |
enum | StepType { Newton , Cauchy , Dogleg } |
Enumerated list for each direction that may be required in the Trust region computation. More... | |
Protected Attributes | |
Teuchos::RCP< NOX::GlobalData > | globalDataPtr |
Pointer to the global data object. | |
Teuchos::RCP< NOX::Utils > | utilsPtr |
Printing Utils. | |
Teuchos::RCP< NOX::Abstract::Group > | solnPtr |
Current solution. | |
Teuchos::RCP< NOX::Abstract::Group > | oldSolnPtr |
Previous solution pointer. | |
Teuchos::RCP< NOX::Abstract::Vector > | newtonVecPtr |
Current search direction.pointer. | |
Teuchos::RCP< NOX::Abstract::Vector > | cauchyVecPtr |
Current search direction.pointer. | |
Teuchos::RCP< NOX::Abstract::Vector > | aVecPtr |
Extra vector used in computations. | |
Teuchos::RCP< NOX::Abstract::Vector > | bVecPtr |
Extra vector used in computations. | |
Teuchos::RCP< NOX::StatusTest::Generic > | testPtr |
Stopping test. | |
NOX::StatusTest::CheckType | checkType |
Type of check to use for status tests. See NOX::StatusTest for more details. | |
Teuchos::RCP< Teuchos::ParameterList > | paramsPtr |
Input parameters. | |
Teuchos::RCP< NOX::Direction::Generic > | newtonPtr |
Newton Search Direction. | |
Teuchos::RCP< NOX::Direction::Generic > | cauchyPtr |
Cauchy Search Direction. | |
double | radius |
Radius of the trust region. | |
double | minRatio |
Minimum improvement ratio to accept step. | |
double | initRadius |
Initial trust region radius. | |
double | minRadius |
Minimum trust region radius. | |
double | maxRadius |
Maximum trust region radius. | |
double | contractTriggerRatio |
ratio < alpha triggers contraction | |
double | expandTriggerRatio |
ratio > beta triggers expansion | |
double | expandFactor |
Expansion factor. | |
double | contractFactor |
Constraction factor. | |
double | recoveryStep |
double | newF |
Value of ![]() | |
double | oldF |
Value of ![]() | |
double | dx |
norm(xnew - xold) | |
int | nIter |
Number of nonlinear iterations. | |
NOX::StatusTest::StatusType | status |
Status of nonlinear solver. | |
StepType | stepType |
Type of step to be taken. | |
Teuchos::RCP< NOX::MeritFunction::Generic > | meritFuncPtr |
Stores a user supplied merit function if supplied in the parameter list. | |
bool | useAredPredRatio |
If set to true, the minimum improvement ratio condition uses an Ared/Pred approach. | |
Teuchos::RCP< NOX::Observer > | observer |
Pointer to a user defined NOX::Observer object. | |
Newton-like solver using a trust region.
Our goal is to solve:
The trust region subproblem (TRSP) at iteration
where
The "improvement ratio" for a given step
An iteration consists of the following steps.
Compute Newton-like direction:
Compute Cauchy-like direction:
If this is the first iteration, initialize
Initialize
While
Compute the direction
If
Otherwise if
Otherwise, take a Dog Leg step by setting
Set
If
Update the solution:
Update trust region:
If
Otherwise if
Otherwise if
Input Paramters
The following parameters should be specified in the "Trust Region" sublist based to the solver.
"Minimum Trust Region Radius" (
Output Paramters
A sublist for output parameters called "Output" will be created and contain the following parameters:
"2-Norm or Residual" - Two-norm of final residual
|
protected |
TrustRegionBased::TrustRegionBased | ( | const Teuchos::RCP< NOX::Abstract::Group > & | grp, |
const Teuchos::RCP< NOX::StatusTest::Generic > & | tests, | ||
const Teuchos::RCP< Teuchos::ParameterList > & | params | ||
) |
Constructor.
See reset() for description.
References globalDataPtr, init(), meritFuncPtr, observer, NOX::Solver::parseObserver(), utilsPtr, and NOX::Solver::validateSolverOptionsSublist().
|
virtual |
|
inlinevirtual |
|
virtual |
|
virtual |
Return a reference to the previous solution group.
Implements NOX::Solver::Generic.
References oldSolnPtr.
|
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.
References solnPtr.
|
inlinevirtual |
|
virtual |
Return a RCP to the solver statistics.
Implements NOX::Solver::Generic.
|
virtual |
|
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 dx, nIter, status, and NOX::StatusTest::Unconverged.
Referenced by solve().
|
virtual |
Resets the solver and sets a new initial guess.
Implements NOX::Solver::Generic.
References dx, nIter, solnPtr, status, and NOX::StatusTest::Unconverged.
|
virtual |
Resets the solver, sets a new status test, and sets a new initial guess.
Implements NOX::Solver::Generic.
References dx, nIter, solnPtr, status, testPtr, and 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 nIter, observer, paramsPtr, reset(), solnPtr, status, step(), and NOX::StatusTest::Unconverged.
|
virtual |
Do one nonlinear step in the iteration sequence and return status.
Implements NOX::Solver::Generic.
References aVecPtr, bVecPtr, Cauchy, cauchyPtr, cauchyVecPtr, NOX::StatusTest::Generic::checkStatus(), checkType, NOX::Abstract::Group::computeF(), NOX::Abstract::Group::computeX(), contractFactor, contractTriggerRatio, NOX::Utils::Debug, Dogleg, dx, expandFactor, expandTriggerRatio, NOX::StatusTest::Failed, NOX::Utils::fill(), NOX::Abstract::Group::getNormF(), globalDataPtr, initRadius, NOX::Utils::InnerIteration, maxRadius, meritFuncPtr, minRadius, minRatio, newF, Newton, newtonPtr, newtonVecPtr, nIter, NOX::Abstract::Vector::norm(), observer, NOX::Abstract::Group::Ok, oldF, oldSolnPtr, printUpdate(), radius, recoveryStep, solnPtr, status, step(), stepType, testPtr, NOX::StatusTest::Unconverged, useAredPredRatio, and utilsPtr.
|
protected |
Extra vector used in computations.
We have both a pointer and a reference because we need to create a DERIVED object and then want to have a reference to it.
Referenced by step().
|
protected |
Extra vector used in computations.
We have both a pointer and a reference because we need to create a DERIVED object and then want to have a reference to it.
Referenced by step().
|
protected |
Current search direction.pointer.
We have both a pointer and a reference because we need to create a DERIVED object and then want to have a reference to it.
Referenced by step().
|
protected |
Current search direction.pointer.
We have both a pointer and a reference because we need to create a DERIVED object and then want to have a reference to it.
Referenced by step().
|
protected |
Previous solution pointer.
We have both a pointer and a reference because we need to create a DERIVED object and then want to have a reference to it.
Referenced by getPreviousSolutionGroup(), getPreviousSolutionGroupPtr(), and step().
|
protected |