#include <NOX_LineSearch_Utils_Slope.H>
Public Member Functions | |
Slope (const Teuchos::RCP< NOX::GlobalData > &gd) | |
Default constructor. | |
virtual | ~Slope () |
Destructor. | |
void | reset (const Teuchos::RCP< NOX::GlobalData > &gd) |
Reset method. | |
double | computeSlope (const NOX::Abstract::Vector &dir, const NOX::Abstract::Group &grp) |
Compute the inner product of the given direction and the gradient associated with the given group. | |
double | computeSlopeWithOutJac (const NOX::Abstract::Vector &dir, const NOX::Abstract::Group &grp) |
This is a variant of the computeSlope() method above optimized to work with out having to compute an explicit Jacobian. | |
Private Member Functions | |
Slope () | |
Disallow default constructor. | |
Private Attributes | |
NOX::Utils | utils |
Printing object. | |
Teuchos::RCP < NOX::Abstract::Vector > | vecPtr |
A vector that *may* be used in computeSlope(). | |
Teuchos::RCP < NOX::Abstract::Group > | grpPtr |
An extra group that will only be allocated if computeSlopeWithOutJac() is called. |
This class provides routines for computing the slope of a give function. There are two methods, one that uses a Jacobian and the other that estimates the action of the Jacobian by directional derivatives.
Definition at line 69 of file NOX_LineSearch_Utils_Slope.H.
NOX::LineSearch::Utils::Slope::Slope | ( | const Teuchos::RCP< NOX::GlobalData > & | gd | ) |
NOX::LineSearch::Utils::Slope::~Slope | ( | ) | [virtual] |
NOX::LineSearch::Utils::Slope::Slope | ( | ) | [inline, private] |
void NOX::LineSearch::Utils::Slope::reset | ( | const Teuchos::RCP< NOX::GlobalData > & | gd | ) |
Reset method.
Definition at line 60 of file NOX_LineSearch_Utils_Slope.C.
References utils.
Referenced by NOX::Solver::TensorBased::reset().
double NOX::LineSearch::Utils::Slope::computeSlope | ( | const NOX::Abstract::Vector & | dir, | |
const NOX::Abstract::Group & | grp | |||
) |
Compute the inner product of the given direction and the gradient associated with the given group.
Calculates and returns
Here represents the input parameter
dir
and is the gradient associated with the given group.
Definition at line 66 of file NOX_LineSearch_Utils_Slope.C.
References NOX::Abstract::Group::applyJacobian(), NOX::Abstract::Vector::clone(), NOX::Abstract::Group::getF(), NOX::Abstract::Group::getGradient(), NOX::Abstract::Vector::innerProduct(), NOX::Abstract::Group::isF(), NOX::Abstract::Group::isGradient(), NOX::Abstract::Group::Ok, NOX::Utils::out(), NOX::ShapeCopy, utils, and vecPtr.
Referenced by NOX::LineSearch::MoreThuente::cvsrch(), NOX::Solver::TensorBased::implementGlobalStrategy(), and NOX::Solver::TensorBased::performLinesearch().
double NOX::LineSearch::Utils::Slope::computeSlopeWithOutJac | ( | const NOX::Abstract::Vector & | dir, | |
const NOX::Abstract::Group & | grp | |||
) |
This is a variant of the computeSlope() method above optimized to work with out having to compute an explicit Jacobian.
Calculates and returns
Here represents the input parameter
dir
is the gradient associated with the given group (for nonlinear solves this equates to
where
is the Jacobian and
is the original nonlinear function).
We can rewrite this equation as:
which allows us to use directional derivatives to estimate :
This may allow for faster computations of the slope if the Jacobian is expensive to evaluate.
where is a scalar perturbation calculated by:
is a constant fixed at 1.0e-6.
Definition at line 96 of file NOX_LineSearch_Utils_Slope.C.
References NOX::Abstract::Group::clone(), NOX::Abstract::Vector::clone(), NOX::Abstract::Group::getF(), NOX::Abstract::Group::getX(), grpPtr, NOX::Abstract::Group::isF(), NOX::Abstract::Vector::norm(), NOX::Utils::out(), NOX::ShapeCopy, utils, and vecPtr.
Referenced by NOX::LineSearch::MoreThuente::cvsrch().
Printing object.
Definition at line 127 of file NOX_LineSearch_Utils_Slope.H.
Referenced by computeSlope(), computeSlopeWithOutJac(), and reset().
Teuchos::RCP<NOX::Abstract::Vector> NOX::LineSearch::Utils::Slope::vecPtr [private] |
A vector that *may* be used in computeSlope().
Definition at line 135 of file NOX_LineSearch_Utils_Slope.H.
Referenced by computeSlope(), and computeSlopeWithOutJac().
Teuchos::RCP<NOX::Abstract::Group> NOX::LineSearch::Utils::Slope::grpPtr [private] |
An extra group that will only be allocated if computeSlopeWithOutJac() is called.
Definition at line 138 of file NOX_LineSearch_Utils_Slope.H.
Referenced by computeSlopeWithOutJac().