#include <NOX_Direction_SteepestDescent.H>
Public Types | |
enum | ScalingType { TwoNorm, QuadMin, FunctionTwoNorm, None } |
Scaling types. More... | |
Public Member Functions | |
SteepestDescent (const Teuchos::RCP< NOX::GlobalData > &gd, Teuchos::ParameterList ¶ms) | |
Constructor. | |
~SteepestDescent () | |
Destructor. | |
bool | reset (const Teuchos::RCP< NOX::GlobalData > &gd, Teuchos::ParameterList ¶ms) |
Reset direction based on possibly new parameters. | |
bool | compute (NOX::Abstract::Vector &dir, NOX::Abstract::Group &grp, const NOX::Solver::Generic &solver) |
Compute the direction vector, dir , for a specific method given the current group, grp . | |
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&). | |
Private Member Functions | |
void | throwError (const string &functionName, const string &errorMsg) |
Print error message and throw error. | |
Private Attributes | |
Teuchos::RCP< NOX::GlobalData > | globalDataPtr |
Global data pointer. Keep this so any stored parameter list remains valid. | |
Teuchos::RCP< NOX::Utils > | utils |
Printing Utils. | |
Teuchos::RCP < NOX::Abstract::Vector > | tmpVecPtr |
Temporary vector used in Cauchy scaling factor calculation. | |
ScalingType | scaleType |
Type of scaling of the Cauchy direction. | |
Teuchos::RCP < NOX::MeritFunction::Generic > | meritFuncPtr |
Pointer to a user defined merit function. |
Calculates the direction
This is the (scaled) gradient of the function . The valued of
depends on the choice of "Scaling Type" below.
Parameters
"Direction":
"Direction"/"Steepest Descent":
Definition at line 96 of file NOX_Direction_SteepestDescent.H.
Scaling types.
TwoNorm | Scale by the 2-norm of the gradient. |
QuadMin | Scale by the step that minimizes the 1-D quadratic. |
FunctionTwoNorm | Scale by the 2-norm of F. |
None | No scaling at all. |
Definition at line 101 of file NOX_Direction_SteepestDescent.H.
NOX::Direction::SteepestDescent::SteepestDescent | ( | const Teuchos::RCP< NOX::GlobalData > & | gd, | |
Teuchos::ParameterList & | params | |||
) |
NOX::Direction::SteepestDescent::~SteepestDescent | ( | ) |
bool NOX::Direction::SteepestDescent::reset | ( | const Teuchos::RCP< NOX::GlobalData > & | gd, | |
Teuchos::ParameterList & | params | |||
) | [virtual] |
Reset direction based on possibly new parameters.
Implements NOX::Direction::Generic.
Definition at line 64 of file NOX_Direction_SteepestDescent.C.
References FunctionTwoNorm, globalDataPtr, meritFuncPtr, None, QuadMin, scaleType, TwoNorm, and utils.
Referenced by SteepestDescent().
bool NOX::Direction::SteepestDescent::compute | ( | NOX::Abstract::Vector & | dir, | |
NOX::Abstract::Group & | grp, | |||
const NOX::Solver::Generic & | solver | |||
) | [virtual] |
Compute the direction vector, dir
, for a specific method given the current group, grp
.
The grp
is not const so that we can compute the F vector, the Jacobian matrix, the Newton vector, and so on.
Const access to the solver is used for getting additional information such as the past solution, the iteration number, and so on.
Implements NOX::Direction::Generic.
Definition at line 91 of file NOX_Direction_SteepestDescent.C.
References NOX::Abstract::Group::computeF(), NOX::Abstract::Group::computeJacobian(), FunctionTwoNorm, NOX::Abstract::Group::getNormF(), meritFuncPtr, None, NOX::Abstract::Vector::norm(), NOX::Abstract::Group::Ok, QuadMin, NOX::Abstract::Vector::scale(), scaleType, throwError(), and TwoNorm.
Referenced by compute().
bool NOX::Direction::SteepestDescent::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.
Definition at line 143 of file NOX_Direction_SteepestDescent.C.
References compute().
void NOX::Direction::SteepestDescent::throwError | ( | const string & | functionName, | |
const string & | errorMsg | |||
) | [private] |
Print error message and throw error.
Definition at line 150 of file NOX_Direction_SteepestDescent.C.
References NOX::Utils::Error, and utils.
Referenced by compute().
Teuchos::RCP<NOX::GlobalData> NOX::Direction::SteepestDescent::globalDataPtr [private] |
Global data pointer. Keep this so any stored parameter list remains valid.
Definition at line 139 of file NOX_Direction_SteepestDescent.H.
Referenced by reset().
Teuchos::RCP<NOX::Utils> NOX::Direction::SteepestDescent::utils [private] |
Printing Utils.
Definition at line 142 of file NOX_Direction_SteepestDescent.H.
Referenced by reset(), and throwError().
Teuchos::RCP<NOX::Abstract::Vector> NOX::Direction::SteepestDescent::tmpVecPtr [private] |
Temporary vector used in Cauchy scaling factor calculation.
Definition at line 145 of file NOX_Direction_SteepestDescent.H.
Type of scaling of the Cauchy direction.
Definition at line 148 of file NOX_Direction_SteepestDescent.H.
Teuchos::RCP<NOX::MeritFunction::Generic> NOX::Direction::SteepestDescent::meritFuncPtr [private] |
Pointer to a user defined merit function.
Definition at line 151 of file NOX_Direction_SteepestDescent.H.