NOX Development
Loading...
Searching...
No Matches
NOX::Direction::NonlinearCG Class Reference

Calculates a search direction using the Nonlinear Conjugate Gradient method. More...

#include <NOX_Direction_NonlinearCG.H>

Inheritance diagram for NOX::Direction::NonlinearCG:
Collaboration diagram for NOX::Direction::NonlinearCG:

Public Member Functions

 NonlinearCG (const Teuchos::RCP< NOX::GlobalData > &gd, Teuchos::ParameterList &params)
 Constructor.
virtual ~NonlinearCG ()
 Destructor.
virtual bool reset (const Teuchos::RCP< NOX::GlobalData > &gd, Teuchos::ParameterList &p)
 derived
virtual bool compute (Abstract::Vector &dir, Abstract::Group &grp, const Solver::Generic &solver)
 derived
virtual bool compute (NOX::Abstract::Vector &dir, NOX::Abstract::Group &grp, const NOX::Solver::LineSearchBased &solver)
 Same as compute(NOX::Abstract::Vector&, NOX::Abstract::Group&, const NOX::Solver::Generic&).
Public Member Functions inherited from NOX::Direction::Generic
 Generic ()
 Constructor.
virtual ~Generic ()
 Destructor.

Detailed Description

Calculates a search direction using the Nonlinear Conjugate Gradient method.

Calculates the direction

\‍[d = - M^{-1}(x) F(x) + \beta d_{prev}
\‍]

where $ M $ is a preconditioner and $ \beta $ is an orthogonalization parameter which can be computed in various ways (see below), and $ d_{prev} $ is the search direction from the previous nonlinear iteration.

This method provides a generalization of Linear CG to nonlinear problems. It does this by computing a search direction using an expression analogous to that of Linear CG. The negative of the current residual vector, $ F(x) $ is taken, allowed to be preconditioned, and then orthogonalized against the previous search direction. This direction can sometimes be used successfully with the various choices provided in NOX::Linesearch but is intended to be used with NOX::Linesearch::NonlinearCG. In fact, the expected convergence behavior of linear problems can only be achieved in this way.

To use this direction, specify that the "Method" is "NonlinearCG" in the "Direction" sublist of the parameters that are passed to the solver (see NOX::Direction::Manager for more information on choosing the search direction).

The following options may be specified in the "Nonlinear CG" sublist of the "Direction" sublist of the solver parameters.

  • "Orthogonalize" can be either of:

    • "Fletcher-Reeves" [default] - $ \beta =  \frac{F(x)^T M^{-1}(x)
    F(x)}{F(x_{prev})^T M^{-1}(x_{prev}) F(x_{prev})}$

    • "Polak-Ribiere" - $ \beta =  max \left\{ \beta^{PR}, 0 \right\} $ ,

      where $ \beta^{PR} = \frac{F(x)^T \left[M^{-1}(x) F(x)
    - M^{-1}(x_{prev}) F(x_{prev})\right]}{F(x_{prev})^T M^{-1}(x_{prev})
    F(x_{prev})}$

    These comprise the two most popular choices for orthogonalization. Both reduce to the linear result for linear problems. "Polak-Ribiere" provides an implied restart capability by setting $ \beta = 0 $ anytime the computed value is less than zero.

  • "Precondition" can be either "On" or "Off" [default]: determines whether or not to compute and apply preconditioner $ M $. If "Off" is selected, no preconditioner is computed and the behavior is equivalent to $ M = I $ where $ I $ is the identity matrix. If "On", $ M $ is computed and applied as determined by the underlying implementation of the "applyRightPreconditioning" method in the Group.

  • "Restart Frequency" - An integer specification of the number of nonlinear iterations between restarts [default = 10]. Restart corresponds to setting $\beta = 0$. A good heuristic is to limit this value to the number of problem degrees of freedom. Setting this value to 1 forces $ \beta = 0 $ for every nonlinear iteration which corresponds to suppressing orthogonalization against the previous search direction.

References

information about both linear and nonlinear conjugate gradient methods can be found in Chapter 5 of:

Nocedal & Wright, "Numerical Optimization", Springer-Verlag, New York, 1999. Though presented within the context of nonlinear optimization, the connection to nonlinear systems of equations is made by the correspondence $ \nabla f(x) \leftrightarrow F(x) $ (cf Algorithm 5.4).

Another useful useful reference is:

Jonathan Richard Shewchuk, "An Introduction to the Conjugate Gradient Method Without the Agonizing Pain</A>," 1994. Chapter 14 provides a summary of issues in generalizing linear CG to the nonlinear case. Correspondence to NOX notation is made by the equivalence $ r \leftrightarrow f' \leftrightarrow F(x) $ (cd Section 14.1).

Member Function Documentation

◆ compute() [1/2]

◆ compute() [2/2]

bool NonlinearCG::compute ( NOX::Abstract::Vector & dir,
NOX::Abstract::Group & grp,
const NOX::Solver::LineSearchBased & solver )
virtual

Same as compute(NOX::Abstract::Vector&, NOX::Abstract::Group&, const NOX::Solver::Generic&).

Enables direct support for line search based solvers for the purpose of efficiency since the LineSearchBased object has a getStep() function that some directions require.

If it is not redefined in the derived class, it will just call the compute with the NOX::Solver::Generic argument.

Reimplemented from NOX::Direction::Generic.

References NOX::Direction::Generic::compute().

◆ reset()

bool NonlinearCG::reset ( const Teuchos::RCP< NOX::GlobalData > & gd,
Teuchos::ParameterList & p )
virtual

derived

Implements NOX::Direction::Generic.

Referenced by NonlinearCG().


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