|
NOX Development
|
Newton-like solver using a trust region. More...
#include <NOX_Solver_InexactTrustRegionBased.H>


Public Member Functions | |
| InexactTrustRegionBased (const Teuchos::RCP< NOX::Abstract::Group > &grp, const Teuchos::RCP< NOX::StatusTest::Generic > &tests, const Teuchos::RCP< Teuchos::ParameterList > ¶ms) | |
| Constructor. | |
| virtual | ~InexactTrustRegionBased () |
| 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. | |
| Public Member Functions inherited from NOX::Solver::Generic | |
| Generic () | |
| Constructor (does nothing). | |
| virtual | ~Generic () |
| Destructor (does nothing). | |
Protected Types | |
| enum | TrustRegionType { Standard , Inexact } |
| Type of Trust Region algorithm to use. More... | |
| enum | InnerIterationReturnType { Converged , Unconverged , Failed } |
| Return types for inner iteration status test. More... | |
| enum | StepType { Newton , Cauchy , Dogleg } |
| Enumerated list for each direction that may be required in the Trust region computation. More... | |
Protected Member Functions | |
| virtual NOX::StatusTest::StatusType | iterateStandard () |
| "Standard" trust region implementation | |
| virtual NOX::StatusTest::StatusType | iterateInexact () |
| "Inexact Trust Region" | |
| virtual void | init () |
| Print out initialization information and calcuation the RHS. | |
| virtual void | printUpdate () |
| Prints the current iteration information. | |
| virtual void | invalid (const std::string ¶m, double value) const |
| Print an error message and throw an error during parameter reads. | |
| virtual void | throwError (const std::string &method, const std::string &mesage) const |
| Print an error message and throw an error. | |
| NOX::StatusTest::StatusType | checkStep (const NOX::Abstract::Vector &step, double &radius) |
| Check to see if the current step is acceptable. If not, it reduces the trust region radius accordingly. | |
| virtual double | computeNorm (const NOX::Abstract::Vector &v) |
| Computes the norm of a given vector. | |
Protected Attributes | |
| TrustRegionType | method |
| Type of trust region algorithm to use. | |
| Teuchos::RCP< NOX::GlobalData > | globalDataPtr |
| Pointer to the global data object. | |
| Teuchos::RCP< NOX::Utils > | utils |
| Utils. | |
| InnerIterationReturnType | innerIterationStatus |
| Current status of the trust region inner iteration. | |
| Teuchos::RCP< NOX::Abstract::Group > | solnPtr |
| Current solution. | |
| Teuchos::RCP< NOX::Abstract::Group > | oldSolnPtr |
| Previous solution pointer. | |
| Teuchos::RCP< NOX::Abstract::Vector > | newtonVecPtr |
| Current newton direction pointer. | |
| Teuchos::RCP< NOX::Abstract::Vector > | cauchyVecPtr |
| Current cauchy direction pointer. | |
| Teuchos::RCP< NOX::Abstract::Vector > | rCauchyVecPtr |
| Extra vector used in computations. | |
| Teuchos::RCP< NOX::Abstract::Vector > | residualVecPtr |
| Extra vector used in computations. | |
| 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. | |
| Teuchos::RCP< Teuchos::ParameterList > | paramsPtr |
| Input parameters. | |
| NOX::Direction::Utils::InexactNewton | inNewtonUtils |
| Inexact Newton utitilities. | |
| 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 | 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. | |
| double | eta |
| Current linear solve tolerance (inexact only). | |
| double | eta_last |
| Linear solve tolerance used in last iteration (inexact only). | |
| 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. | |
| StepType | stepType |
| Type of step to be taken. | |
| Teuchos::RCP< NOX::MeritFunction::Generic > | meritFuncPtr |
| Stores merit function supplied by global data. | |
| bool | useCauchyInNewtonDirection |
| If set to true, the initial guess for the Newton direction computation will use the Cauchy direction as the initial guess. | |
| bool | writeOutputParamsToList |
| If set to true, statistics/counters will be output to the output list. | |
| bool | useCounters |
| If set to true, counters will be stored by the solver. | |
| NOX::SolverStats::TrustRegionStats * | counters |
| Counters for the algorithm. | |
| bool | useAredPredRatio |
| If set to true, the minimum improvement ratio condition uses an Ared/Pred approach. | |
| bool | useDoglegMinimization |
If set to true, the ![]() | |
| 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.










Output Paramters
A sublist called "Output" will be created at the top level of the parameter list and contain the following general solver parameters:
A sublist called "Output" will be created in the "Trust Region" sublist and contain the following trust region specific output parameters:

"Dogleg Steps: Average Fraction Between Cauchy and Newton Direction" - Average value of the fraction a dogleg step took between the Cauchy and Newton directions. This is the 

|
protected |
|
protected |
| NOX::Solver::InexactTrustRegionBased::InexactTrustRegionBased | ( | 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 aVecPtr, bVecPtr, cauchyVecPtr, counters, NOX::DeepCopy, globalDataPtr, init(), inNewtonUtils, meritFuncPtr, newtonVecPtr, observer, oldSolnPtr, paramsPtr, NOX::Solver::parseObserver(), radius, rCauchyVecPtr, NOX::Direction::Utils::InexactNewton::reset(), residualVecPtr, NOX::ShapeCopy, solnPtr, testPtr, useAredPredRatio, useCauchyInNewtonDirection, useCounters, useDoglegMinimization, utils, NOX::Solver::validateSolverOptionsSublist(), and writeOutputParamsToList.
|
protected |
Check to see if the current step is acceptable. If not, it reduces the trust region radius accordingly.
References NOX::StatusTest::Converged.
|
protectedvirtual |
Computes the norm of a given vector.
Defaults to the L-2 norm but could use a user defined norm also.
Referenced by iterateInexact(), and iterateStandard().
|
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 |
|
virtual |
|
protectedvirtual |
Print out initialization information and calcuation the RHS.
References cauchyPtr, checkType, contractFactor, contractTriggerRatio, counters, dx, expandFactor, expandTriggerRatio, NOX::Utils::fill(), globalDataPtr, Inexact, inNewtonUtils, invalid(), maxRadius, method, minRadius, minRatio, newtonPtr, nIter, NOX::Utils::Parameters, paramsPtr, NOX::Solver::parseStatusTestCheckType(), recoveryStep, Standard, status, NOX::StatusTest::Unconverged, useAredPredRatio, useCauchyInNewtonDirection, useCounters, useDoglegMinimization, and utils.
Referenced by InexactTrustRegionBased().
|
protectedvirtual |
|
protectedvirtual |
"Inexact Trust Region"
References NOX::Abstract::Group::applyJacobian(), NOX::Abstract::Group::applyJacobianInverse(), aVecPtr, bVecPtr, Cauchy, cauchyPtr, cauchyVecPtr, NOX::StatusTest::Generic::checkStatus(), checkType, NOX::Abstract::Group::computeF(), NOX::Abstract::Group::computeJacobian(), computeNorm(), NOX::Abstract::Group::computeX(), contractFactor, contractTriggerRatio, Converged, counters, NOX::Utils::Details, Dogleg, eta, eta_last, expandFactor, expandTriggerRatio, Failed, NOX::StatusTest::Failed, NOX::Utils::fill(), NOX::Abstract::Group::getF(), globalDataPtr, NOX::Abstract::Vector::init(), NOX::Utils::InnerIteration, innerIterationStatus, NOX::Abstract::Vector::innerProduct(), inNewtonUtils, NOX::Abstract::Group::isJacobian(), NOX::Abstract::Group::logLastLinearSolveStats(), maxRadius, meritFuncPtr, minRadius, minRatio, newF, Newton, newtonVecPtr, nIter, observer, NOX::Abstract::Group::Ok, oldF, oldSolnPtr, paramsPtr, radius, rCauchyVecPtr, recoveryStep, residualVecPtr, NOX::Abstract::Vector::scale(), solnPtr, status, step(), stepType, testPtr, throwError(), Unconverged, NOX::StatusTest::Unconverged, NOX::Abstract::Vector::update(), useAredPredRatio, useCauchyInNewtonDirection, useCounters, useDoglegMinimization, and utils.
Referenced by step().
|
protectedvirtual |
"Standard" trust region implementation
References aVecPtr, bVecPtr, Cauchy, cauchyPtr, cauchyVecPtr, NOX::StatusTest::Generic::checkStatus(), checkType, NOX::Abstract::Group::computeF(), computeNorm(), NOX::Abstract::Group::computeX(), contractFactor, contractTriggerRatio, counters, NOX::Utils::Details, Dogleg, dx, expandFactor, expandTriggerRatio, NOX::StatusTest::Failed, NOX::Utils::fill(), globalDataPtr, NOX::Utils::InnerIteration, NOX::Abstract::Vector::innerProduct(), maxRadius, meritFuncPtr, minRadius, minRatio, newF, Newton, newtonPtr, newtonVecPtr, nIter, observer, NOX::Abstract::Group::Ok, oldF, oldSolnPtr, radius, recoveryStep, solnPtr, status, step(), stepType, testPtr, NOX::StatusTest::Unconverged, useAredPredRatio, useCounters, and utils.
Referenced by step().
|
protectedvirtual |
Prints the current iteration information.
References NOX::StatusTest::Converged, dx, NOX::StatusTest::Failed, NOX::Utils::fill(), NOX::Abstract::Group::getF(), NOX::Abstract::Vector::MaxNorm, newF, nIter, NOX::Abstract::Vector::norm(), NOX::Utils::OuterIteration, NOX::Utils::OuterIterationStatusTest, radius, solnPtr, status, testPtr, NOX::StatusTest::Unconverged, and utils.
Referenced by step().
|
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 checkType, counters, dx, NOX::Utils::fill(), nIter, NOX::Utils::Parameters, status, testPtr, NOX::StatusTest::Unconverged, useCounters, and utils.
|
virtual |
Resets the solver and sets a new initial guess.
Implements NOX::Solver::Generic.
References checkType, counters, dx, NOX::Utils::fill(), meritFuncPtr, newF, nIter, NOX::Utils::Parameters, solnPtr, status, testPtr, NOX::StatusTest::Unconverged, useCounters, and utils.
|
virtual |
Resets the solver, sets a new status test, and sets a new initial guess.
Implements NOX::Solver::Generic.
References checkType, counters, dx, NOX::Utils::fill(), meritFuncPtr, newF, nIter, NOX::Utils::Parameters, solnPtr, status, testPtr, NOX::StatusTest::Unconverged, useCounters, and utils.
Referenced by solve().
|
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 counters, nIter, observer, paramsPtr, reset(), solnPtr, status, step(), NOX::StatusTest::Unconverged, useCounters, and writeOutputParamsToList.
|
virtual |
Do one nonlinear step in the iteration sequence and return status.
Implements NOX::Solver::Generic.
References checkType, Inexact, iterateInexact(), iterateStandard(), meritFuncPtr, method, newF, nIter, observer, printUpdate(), solnPtr, Standard, status, testPtr, and NOX::StatusTest::Unconverged.
Referenced by iterateInexact(), iterateStandard(), and solve().
|
protectedvirtual |
|
protected |
Extra vector used in computations.
Referenced by InexactTrustRegionBased(), iterateInexact(), and iterateStandard().
|
protected |
Extra vector used in computations.
Referenced by InexactTrustRegionBased(), iterateInexact(), and iterateStandard().
|
protected |
Cauchy Search Direction.
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
Current cauchy direction pointer.
Referenced by InexactTrustRegionBased(), iterateInexact(), and iterateStandard().
|
protected |
Type of check to use for status tests. See NOX::StatusTest for more details.
Referenced by init(), iterateInexact(), iterateStandard(), reset(), reset(), reset(), and step().
|
protected |
Constraction factor.
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
ratio < alpha triggers contraction
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
Counters for the algorithm.
Referenced by InexactTrustRegionBased(), init(), iterateInexact(), iterateStandard(), reset(), reset(), reset(), and solve().
|
protected |
norm(xnew - xold)
Referenced by init(), iterateStandard(), printUpdate(), reset(), reset(), and reset().
|
protected |
Current linear solve tolerance (inexact only).
Referenced by iterateInexact().
|
protected |
Linear solve tolerance used in last iteration (inexact only).
Referenced by iterateInexact().
|
protected |
Expansion factor.
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
ratio > beta triggers expansion
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
Pointer to the global data object.
Referenced by getSolverStatistics(), InexactTrustRegionBased(), init(), iterateInexact(), and iterateStandard().
|
protected |
Current status of the trust region inner iteration.
Referenced by iterateInexact().
|
protected |
Inexact Newton utitilities.
Referenced by InexactTrustRegionBased(), init(), and iterateInexact().
|
protected |
Maximum trust region radius.
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
Stores merit function supplied by global data.
Referenced by InexactTrustRegionBased(), iterateInexact(), iterateStandard(), reset(), reset(), and step().
|
protected |
|
protected |
Minimum trust region radius.
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
Minimum improvement ratio to accept step.
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
Value of 
Referenced by iterateInexact(), iterateStandard(), printUpdate(), reset(), reset(), and step().
|
protected |
Newton Search Direction.
Referenced by init(), and iterateStandard().
|
protected |
Current newton direction pointer.
Referenced by InexactTrustRegionBased(), iterateInexact(), and iterateStandard().
|
protected |
Number of nonlinear iterations.
Referenced by getNumIterations(), init(), iterateInexact(), iterateStandard(), printUpdate(), reset(), reset(), reset(), solve(), and step().
|
protected |
Pointer to a user defined NOX::Observer object.
Referenced by InexactTrustRegionBased(), iterateInexact(), iterateStandard(), solve(), and step().
|
protected |
Value of 
Referenced by iterateInexact(), and iterateStandard().
|
protected |
Previous solution pointer.
Referenced by getPreviousSolutionGroup(), getPreviousSolutionGroupPtr(), InexactTrustRegionBased(), iterateInexact(), and iterateStandard().
|
protected |
Input parameters.
Referenced by getList(), getListPtr(), InexactTrustRegionBased(), init(), iterateInexact(), and solve().
|
protected |
Radius of the trust region.
Referenced by InexactTrustRegionBased(), iterateInexact(), iterateStandard(), and printUpdate().
|
protected |
Extra vector used in computations.
Referenced by InexactTrustRegionBased(), and iterateInexact().
|
protected |
Take a step of this length in the Newton direction if the trust-region search fails
Referenced by init(), iterateInexact(), and iterateStandard().
|
protected |
Extra vector used in computations.
Referenced by InexactTrustRegionBased(), and iterateInexact().
|
protected |
Current solution.
Referenced by getSolutionGroup(), getSolutionGroupPtr(), InexactTrustRegionBased(), iterateInexact(), iterateStandard(), printUpdate(), reset(), reset(), solve(), and step().
|
protected |
Status of nonlinear solver.
Referenced by getStatus(), init(), iterateInexact(), iterateStandard(), printUpdate(), reset(), reset(), reset(), solve(), and step().
|
protected |
Type of step to be taken.
Referenced by iterateInexact(), and iterateStandard().
|
protected |
Stopping test.
Referenced by InexactTrustRegionBased(), iterateInexact(), iterateStandard(), printUpdate(), reset(), reset(), reset(), and step().
|
protected |
If set to true, the minimum improvement ratio condition uses an Ared/Pred approach.
Referenced by InexactTrustRegionBased(), init(), iterateInexact(), and iterateStandard().
|
protected |
If set to true, the initial guess for the Newton direction computation will use the Cauchy direction as the initial guess.
Referenced by InexactTrustRegionBased(), init(), and iterateInexact().
|
protected |
If set to true, counters will be stored by the solver.
Referenced by InexactTrustRegionBased(), init(), iterateInexact(), iterateStandard(), reset(), reset(), reset(), and solve().
|
protected |
If set to true, the 
Referenced by InexactTrustRegionBased(), init(), and iterateInexact().
|
protected |
Referenced by InexactTrustRegionBased(), init(), invalid(), iterateInexact(), iterateStandard(), printUpdate(), reset(), reset(), reset(), and throwError().
|
protected |
If set to true, statistics/counters will be output to the output list.
Referenced by InexactTrustRegionBased(), and solve().