#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 NOX::StatusTest::StatusType | getStatus () |
Check current convergence and failure status. | |
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 int | getNumIterations () const |
Get number of iterations. | |
virtual const Teuchos::ParameterList & | getList () const |
Return a refernece to the solver parameters. | |
Protected Types | |
enum | StepType { Newton, Cauchy, Dogleg } |
Enumerated list for each direction that may be required in the Trust region computation. More... | |
Protected Member Functions | |
virtual void | init () |
Print out initialization information and calcuation the RHS. | |
virtual void | invalid (const string ¶m, double value) const |
Print and error message and throw and error. | |
virtual void | printUpdate () |
Prints the current iteration information. | |
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 | 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. | |
NOX::Solver::PrePostOperator | prePostOperator |
Pointer to a user defined NOX::Abstract::PrePostOperator object. |
Our goal is to solve: where
. Alternatively, we might say that we wish to solve
The trust region subproblem (TRSP) at iteration is given by
where
The "improvement ratio" for a given step is defined as
An iteration consists of the following steps.
Input Paramters
The following parameters should be specified in the "Trust Region" sublist based to the solver.
Output Paramters
A sublist for output parameters called "Output" will be created and contain the following parameters:
Definition at line 239 of file NOX_Solver_TrustRegionBased.H.
enum NOX::Solver::TrustRegionBased::StepType [protected] |
Enumerated list for each direction that may be required in the Trust region computation.
Newton | Use the Newton direction. |
Cauchy | Use the Cauchy direction. |
Dogleg | Use the doglog direction. |
Definition at line 371 of file NOX_Solver_TrustRegionBased.H.
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.
Definition at line 58 of file NOX_Solver_TrustRegionBased.C.
References NOX::DeepCopy, init(), and NOX::ShapeCopy.
TrustRegionBased::~TrustRegionBased | ( | ) | [virtual] |
void TrustRegionBased::reset | ( | const NOX::Abstract::Vector & | initial_guess, | |
const Teuchos::RCP< NOX::StatusTest::Generic > & | test | |||
) | [virtual] |
Resets the solver, sets a new status test, and sets a new initial guess.
Implements NOX::Solver::Generic.
Definition at line 159 of file NOX_Solver_TrustRegionBased.C.
References dx, NOX::Utils::fill(), nIter, NOX::Utils::Parameters, paramsPtr, solnPtr, status, testPtr, NOX::StatusTest::Unconverged, and utilsPtr.
void TrustRegionBased::reset | ( | const NOX::Abstract::Vector & | initial_guess | ) | [virtual] |
Resets the solver and sets a new initial guess.
Implements NOX::Solver::Generic.
Definition at line 180 of file NOX_Solver_TrustRegionBased.C.
References dx, NOX::Utils::fill(), nIter, NOX::Utils::Parameters, paramsPtr, solnPtr, status, NOX::StatusTest::Unconverged, and utilsPtr.
NOX::StatusTest::StatusType TrustRegionBased::getStatus | ( | ) | [virtual] |
Check current convergence and failure status.
Implements NOX::Solver::Generic.
Definition at line 204 of file NOX_Solver_TrustRegionBased.C.
References status.
NOX::StatusTest::StatusType TrustRegionBased::step | ( | ) | [virtual] |
Do one nonlinear step in the iteration sequence and return status.
Implements NOX::Solver::Generic.
Definition at line 209 of file NOX_Solver_TrustRegionBased.C.
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(), NOX::Utils::InnerIteration, maxRadius, meritFuncPtr, minRadius, minRatio, newF, Newton, newtonPtr, newtonVecPtr, nIter, NOX::Abstract::Vector::norm(), NOX::Abstract::Group::Ok, oldF, oldSolnPtr, prePostOperator, printUpdate(), radius, recoveryStep, NOX::Solver::PrePostOperator::runPostIterate(), NOX::Solver::PrePostOperator::runPreIterate(), solnPtr, status, stepType, testPtr, NOX::StatusTest::Unconverged, useAredPredRatio, and utilsPtr.
Referenced by solve().
NOX::StatusTest::StatusType TrustRegionBased::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.
Definition at line 490 of file NOX_Solver_TrustRegionBased.C.
References nIter, paramsPtr, prePostOperator, NOX::Solver::PrePostOperator::runPostSolve(), NOX::Solver::PrePostOperator::runPreSolve(), solnPtr, status, step(), and NOX::StatusTest::Unconverged.
const Abstract::Group & TrustRegionBased::getSolutionGroup | ( | ) | const [virtual] |
Return a reference to the current solution group.
Implements NOX::Solver::Generic.
Definition at line 508 of file NOX_Solver_TrustRegionBased.C.
References solnPtr.
const Abstract::Group & TrustRegionBased::getPreviousSolutionGroup | ( | ) | const [virtual] |
Return a reference to the previous solution group.
Implements NOX::Solver::Generic.
Definition at line 513 of file NOX_Solver_TrustRegionBased.C.
References oldSolnPtr.
int TrustRegionBased::getNumIterations | ( | ) | const [virtual] |
Get number of iterations.
Implements NOX::Solver::Generic.
Definition at line 518 of file NOX_Solver_TrustRegionBased.C.
References nIter.
const Teuchos::ParameterList & TrustRegionBased::getList | ( | ) | const [virtual] |
Return a refernece to the solver parameters.
Implements NOX::Solver::Generic.
Definition at line 523 of file NOX_Solver_TrustRegionBased.C.
References paramsPtr.
void TrustRegionBased::init | ( | ) | [protected, virtual] |
Print out initialization information and calcuation the RHS.
Definition at line 79 of file NOX_Solver_TrustRegionBased.C.
References cauchyPtr, checkType, contractFactor, contractTriggerRatio, dx, expandFactor, expandTriggerRatio, NOX::Utils::fill(), globalDataPtr, invalid(), maxRadius, minRadius, minRatio, newtonPtr, nIter, NOX::Utils::Parameters, paramsPtr, NOX::Solver::parseStatusTestCheckType(), recoveryStep, status, NOX::StatusTest::Unconverged, useAredPredRatio, and utilsPtr.
Referenced by TrustRegionBased().
void NOX::Solver::TrustRegionBased::invalid | ( | const string & | param, | |
double | value | |||
) | const [protected, virtual] |
Print and error message and throw and error.
Definition at line 150 of file NOX_Solver_TrustRegionBased.C.
References utilsPtr.
Referenced by init().
void TrustRegionBased::printUpdate | ( | ) | [protected, virtual] |
Prints the current iteration information.
Definition at line 529 of file NOX_Solver_TrustRegionBased.C.
References NOX::StatusTest::Converged, dx, NOX::StatusTest::Failed, NOX::Utils::fill(), NOX::Abstract::Vector::MaxNorm, newF, nIter, NOX::Utils::OuterIteration, NOX::Utils::OuterIterationStatusTest, radius, solnPtr, status, testPtr, NOX::StatusTest::Unconverged, and utilsPtr.
Referenced by step().
Teuchos::RCP<NOX::GlobalData> NOX::Solver::TrustRegionBased::globalDataPtr [protected] |
Pointer to the global data object.
Definition at line 280 of file NOX_Solver_TrustRegionBased.H.
Referenced by init().
Teuchos::RCP<NOX::Utils> NOX::Solver::TrustRegionBased::utilsPtr [protected] |
Printing Utils.
Definition at line 283 of file NOX_Solver_TrustRegionBased.H.
Referenced by init(), invalid(), printUpdate(), reset(), and step().
Teuchos::RCP<NOX::Abstract::Group> NOX::Solver::TrustRegionBased::solnPtr [protected] |
Current solution.
Definition at line 286 of file NOX_Solver_TrustRegionBased.H.
Referenced by getSolutionGroup(), printUpdate(), reset(), solve(), and step().
Teuchos::RCP<NOX::Abstract::Group> NOX::Solver::TrustRegionBased::oldSolnPtr [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.
Definition at line 291 of file NOX_Solver_TrustRegionBased.H.
Referenced by getPreviousSolutionGroup(), and step().
Teuchos::RCP<NOX::Abstract::Vector> NOX::Solver::TrustRegionBased::newtonVecPtr [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.
Definition at line 296 of file NOX_Solver_TrustRegionBased.H.
Referenced by step().
Teuchos::RCP<NOX::Abstract::Vector> NOX::Solver::TrustRegionBased::cauchyVecPtr [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.
Definition at line 301 of file NOX_Solver_TrustRegionBased.H.
Referenced by step().
Teuchos::RCP<NOX::Abstract::Vector> NOX::Solver::TrustRegionBased::aVecPtr [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.
Definition at line 306 of file NOX_Solver_TrustRegionBased.H.
Referenced by step().
Teuchos::RCP<NOX::Abstract::Vector> NOX::Solver::TrustRegionBased::bVecPtr [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.
Definition at line 311 of file NOX_Solver_TrustRegionBased.H.
Referenced by step().
Teuchos::RCP<NOX::StatusTest::Generic> NOX::Solver::TrustRegionBased::testPtr [protected] |
Stopping test.
Definition at line 314 of file NOX_Solver_TrustRegionBased.H.
Referenced by printUpdate(), reset(), and step().
Type of check to use for status tests. See NOX::StatusTest for more details.
Definition at line 317 of file NOX_Solver_TrustRegionBased.H.
Teuchos::RCP<Teuchos::ParameterList> NOX::Solver::TrustRegionBased::paramsPtr [protected] |
Teuchos::RCP<NOX::Direction::Generic> NOX::Solver::TrustRegionBased::newtonPtr [protected] |
Teuchos::RCP<NOX::Direction::Generic> NOX::Solver::TrustRegionBased::cauchyPtr [protected] |
double NOX::Solver::TrustRegionBased::radius [protected] |
Radius of the trust region.
Definition at line 329 of file NOX_Solver_TrustRegionBased.H.
Referenced by printUpdate(), and step().
double NOX::Solver::TrustRegionBased::minRatio [protected] |
Minimum improvement ratio to accept step.
Definition at line 332 of file NOX_Solver_TrustRegionBased.H.
double NOX::Solver::TrustRegionBased::minRadius [protected] |
double NOX::Solver::TrustRegionBased::maxRadius [protected] |
double NOX::Solver::TrustRegionBased::contractTriggerRatio [protected] |
double NOX::Solver::TrustRegionBased::expandTriggerRatio [protected] |
double NOX::Solver::TrustRegionBased::expandFactor [protected] |
double NOX::Solver::TrustRegionBased::contractFactor [protected] |
double NOX::Solver::TrustRegionBased::recoveryStep [protected] |
Take a step of this length in the Newton direction if the trust-region search fails
Definition at line 354 of file NOX_Solver_TrustRegionBased.H.
double NOX::Solver::TrustRegionBased::newF [protected] |
Value of at current solution.
Definition at line 357 of file NOX_Solver_TrustRegionBased.H.
Referenced by printUpdate(), and step().
double NOX::Solver::TrustRegionBased::oldF [protected] |
Value of at previous solution.
Definition at line 359 of file NOX_Solver_TrustRegionBased.H.
Referenced by step().
double NOX::Solver::TrustRegionBased::dx [protected] |
norm(xnew - xold)
Definition at line 362 of file NOX_Solver_TrustRegionBased.H.
Referenced by init(), printUpdate(), reset(), and step().
int NOX::Solver::TrustRegionBased::nIter [protected] |
Number of nonlinear iterations.
Definition at line 365 of file NOX_Solver_TrustRegionBased.H.
Referenced by getNumIterations(), init(), printUpdate(), reset(), solve(), and step().
Status of nonlinear solver.
Definition at line 368 of file NOX_Solver_TrustRegionBased.H.
Referenced by getStatus(), init(), printUpdate(), reset(), solve(), and step().
StepType NOX::Solver::TrustRegionBased::stepType [protected] |
Type of step to be taken.
Definition at line 382 of file NOX_Solver_TrustRegionBased.H.
Referenced by step().
Teuchos::RCP<NOX::MeritFunction::Generic> NOX::Solver::TrustRegionBased::meritFuncPtr [protected] |
Stores a user supplied merit function if supplied in the parameter list.
Definition at line 385 of file NOX_Solver_TrustRegionBased.H.
Referenced by step().
bool NOX::Solver::TrustRegionBased::useAredPredRatio [protected] |
If set to true, the minimum improvement ratio condition uses an Ared/Pred approach.
Definition at line 388 of file NOX_Solver_TrustRegionBased.H.
Pointer to a user defined NOX::Abstract::PrePostOperator object.
Definition at line 391 of file NOX_Solver_TrustRegionBased.H.