NOX Development
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
NOX::Solver::InexactTrustRegionBased Class Reference

Newton-like solver using a trust region. More...

#include <NOX_Solver_InexactTrustRegionBased.H>

Inheritance diagram for NOX::Solver::InexactTrustRegionBased:
Inheritance graph
[legend]
Collaboration diagram for NOX::Solver::InexactTrustRegionBased:
Collaboration graph
[legend]

Public Member Functions

 InexactTrustRegionBased (const Teuchos::RCP< NOX::Abstract::Group > &grp, const Teuchos::RCP< NOX::StatusTest::Generic > &tests, const Teuchos::RCP< Teuchos::ParameterList > &params)
 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::GroupgetSolutionGroup () const
 Return a reference to the current solution group.
 
virtual const NOX::Abstract::GroupgetPreviousSolutionGroup () 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::GroupgetSolutionGroupPtr () const
 Return a RCP to the solution group.
 
virtual Teuchos::RCP< const NOX::Abstract::GroupgetPreviousSolutionGroupPtr () 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::SolverStatsgetSolverStatistics () 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)
 
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::GroupgetSolutionGroup () const =0
 Return a reference to the current solution group.
 
virtual const NOX::Abstract::GroupgetPreviousSolutionGroup () 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::GroupgetSolutionGroupPtr () const =0
 Return a RCP to the solution group.
 
virtual Teuchos::RCP< const NOX::Abstract::GroupgetPreviousSolutionGroupPtr () 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::SolverStatsgetSolverStatistics () const =0
 Return a RCP to the solver statistics.
 

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 &param, 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::GlobalDataglobalDataPtr
 Pointer to the global data object.
 
Teuchos::RCP< NOX::Utilsutils
 Utils.
 
InnerIterationReturnType innerIterationStatus
 Current status of the trust region inner iteration.
 
Teuchos::RCP< NOX::Abstract::GroupsolnPtr
 Current solution.
 
Teuchos::RCP< NOX::Abstract::GroupoldSolnPtr
 Previous solution pointer.
 
Teuchos::RCP< NOX::Abstract::VectornewtonVecPtr
 Current newton direction pointer.
 
Teuchos::RCP< NOX::Abstract::VectorcauchyVecPtr
 Current cauchy direction pointer.
 
Teuchos::RCP< NOX::Abstract::VectorrCauchyVecPtr
 Extra vector used in computations.
 
Teuchos::RCP< NOX::Abstract::VectorresidualVecPtr
 Extra vector used in computations.
 
Teuchos::RCP< NOX::Abstract::VectoraVecPtr
 Extra vector used in computations.
 
Teuchos::RCP< NOX::Abstract::VectorbVecPtr
 Extra vector used in computations.
 
Teuchos::RCP< NOX::StatusTest::GenerictestPtr
 Stopping test.
 
Teuchos::RCP< Teuchos::ParameterList > paramsPtr
 Input parameters.
 
NOX::Direction::Utils::InexactNewton inNewtonUtils
 Inexact Newton utitilities.
 
Teuchos::RCP< NOX::Direction::GenericnewtonPtr
 Newton Search Direction.
 
Teuchos::RCP< NOX::Direction::GenericcauchyPtr
 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 $ f $ at current solution.
 
double oldF
 Value of $ f $ at previous solution.
 
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::GenericmeritFuncPtr
 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::TrustRegionStatscounters
 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 $ \tau $ parameter is minimized over the dogleg line segments instead of being computed at the trust regioin radius.
 
Teuchos::RCP< NOX::Observerobserver
 Pointer to a user defined NOX::Observer object.
 

Detailed Description

Newton-like solver using a trust region.

Our goal is to solve: $ F(x) = 0, $ where $ F:\Re^n \rightarrow
\Re^n $. Alternatively, we might say that we wish to solve

   $
\min f(x) \equiv \frac{1}{2} \|F(x)\|^2_2.
$

The trust region subproblem (TRSP) at iteration $ k$ is given by

   $
\min \; m_k(s) \equiv f_k + g_k^T d + \frac{1}{2} d^T B_k d,
\mbox{ s.t. } \|d\| \leq \Delta_k
\quad \mbox{(TRSP)}
$

where

The "improvement ratio" for a given step $ s $ is defined as

   $
\rho = \displaystyle\frac{ f(x_k) - f(x_k + d) } { m_k(0) - m_k(d) }
$

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 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:

Member Enumeration Documentation

◆ InnerIterationReturnType

Return types for inner iteration status test.

Enumerator
Converged 

Converged.

Unconverged 

Unconverged.

Failed 

Failed by hitting minimum radius bound.

◆ StepType

Enumerated list for each direction that may be required in the Trust region computation.

Enumerator
Newton 

Use the Newton direction.

Cauchy 

Use the Cauchy direction.

Dogleg 

Use the doglog direction.

◆ TrustRegionType

Type of Trust Region algorithm to use.

Enumerator
Standard 

Basic trust region method for nonlinear systems (Nocedal and Wright?).

Inexact 

Inexact Trust region WITHOUT minimization of the local linear model over the line segments.

Constructor & Destructor Documentation

◆ InexactTrustRegionBased()

NOX::Solver::InexactTrustRegionBased::InexactTrustRegionBased ( const Teuchos::RCP< NOX::Abstract::Group > &  grp,
const Teuchos::RCP< NOX::StatusTest::Generic > &  tests,
const Teuchos::RCP< Teuchos::ParameterList > &  params 
)

Member Function Documentation

◆ computeNorm()

double NOX::Solver::InexactTrustRegionBased::computeNorm ( const NOX::Abstract::Vector v)
protectedvirtual

Computes the norm of a given vector.

Defaults to the L-2 norm but could use a user defined norm also.

References NOX::Abstract::Vector::norm().

◆ getList()

const Teuchos::ParameterList & NOX::Solver::InexactTrustRegionBased::getList ( ) const
virtual

Return a reference to the solver parameters.

Implements NOX::Solver::Generic.

◆ getListPtr()

virtual Teuchos::RCP< const Teuchos::ParameterList > NOX::Solver::InexactTrustRegionBased::getListPtr ( ) const
inlinevirtual

Return a RCP to the solver parameters.

Implements NOX::Solver::Generic.

References paramsPtr.

◆ getNumIterations()

int NOX::Solver::InexactTrustRegionBased::getNumIterations ( ) const
virtual

Get number of iterations.

Implements NOX::Solver::Generic.

◆ getPreviousSolutionGroup()

const Abstract::Group & NOX::Solver::InexactTrustRegionBased::getPreviousSolutionGroup ( ) const
virtual

Return a reference to the previous solution group.

Implements NOX::Solver::Generic.

◆ getPreviousSolutionGroupPtr()

virtual Teuchos::RCP< const NOX::Abstract::Group > NOX::Solver::InexactTrustRegionBased::getPreviousSolutionGroupPtr ( ) const
inlinevirtual

Return a RCP to the previous solution group.

Implements NOX::Solver::Generic.

References oldSolnPtr.

◆ getSolutionGroup()

const Abstract::Group & NOX::Solver::InexactTrustRegionBased::getSolutionGroup ( ) const
virtual

Return a reference to the current solution group.

Implements NOX::Solver::Generic.

◆ getSolutionGroupPtr()

virtual Teuchos::RCP< const NOX::Abstract::Group > NOX::Solver::InexactTrustRegionBased::getSolutionGroupPtr ( ) const
inlinevirtual

Return a RCP to the solution group.

Implements NOX::Solver::Generic.

References solnPtr.

◆ getSolverStatistics()

Teuchos::RCP< const NOX::SolverStats > NOX::Solver::InexactTrustRegionBased::getSolverStatistics ( ) const
virtual

Return a RCP to the solver statistics.

Implements NOX::Solver::Generic.

◆ getStatus()

NOX::StatusTest::StatusType NOX::Solver::InexactTrustRegionBased::getStatus ( ) const
virtual

Returns the current status of the solver.

Implements NOX::Solver::Generic.

◆ reset() [1/3]

void NOX::Solver::InexactTrustRegionBased::reset ( )
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::Utils::fill(), NOX::Utils::Parameters, and NOX::StatusTest::Unconverged.

◆ reset() [2/3]

void NOX::Solver::InexactTrustRegionBased::reset ( const NOX::Abstract::Vector initial_guess)
virtual

Resets the solver and sets a new initial guess.

Implements NOX::Solver::Generic.

References NOX::Utils::fill(), NOX::Utils::Parameters, and NOX::StatusTest::Unconverged.

◆ reset() [3/3]

void NOX::Solver::InexactTrustRegionBased::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.

References NOX::Utils::fill(), NOX::Utils::Parameters, and NOX::StatusTest::Unconverged.

◆ solve()

NOX::StatusTest::StatusType NOX::Solver::InexactTrustRegionBased::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 NOX::StatusTest::Unconverged.

◆ step()

NOX::StatusTest::StatusType NOX::Solver::InexactTrustRegionBased::step ( )
virtual

Do one nonlinear step in the iteration sequence and return status.

Implements NOX::Solver::Generic.

References NOX::StatusTest::Unconverged.

Member Data Documentation

◆ recoveryStep

double NOX::Solver::InexactTrustRegionBased::recoveryStep
protected

Take a step of this length in the Newton direction if the trust-region search fails


The documentation for this class was generated from the following files: