NOX Development
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LOCA::PhaseTransition::ExtendedGroup Class Reference
Inheritance diagram for LOCA::PhaseTransition::ExtendedGroup:
Inheritance graph
[legend]
Collaboration diagram for LOCA::PhaseTransition::ExtendedGroup:
Collaboration graph
[legend]

Public Member Functions

 ExtendedGroup (const Teuchos::RCP< LOCA::GlobalData > gD, const Teuchos::RCP< Teuchos::ParameterList > &bifurcationparams_, const Teuchos::RCP< LOCA::PhaseTransition::AbstractGroup > &grp_)
 Constructor.
 
 ExtendedGroup (const LOCA::PhaseTransition::ExtendedGroup &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 
 ~ExtendedGroup ()
 Destructor.
 
NOX::Abstract::Groupoperator= (const NOX::Abstract::Group &source)
 Copies the source group into this group.
 
NOX::Abstract::Groupoperator= (const LOCA::PhaseTransition::ExtendedGroup &source)
 See above.
 
"Compute" functions.
void setX (const NOX::Abstract::Vector &y)
 Set the solution vector x to y.
 
void setX (const LOCA::PhaseTransition::ExtendedVector &y)
 See above.
 
void computeX (const NOX::Abstract::Group &grp, const NOX::Abstract::Vector &d, double step)
 Compute x = grp.x + step * d.
 
void computeX (const LOCA::PhaseTransition::ExtendedGroup &grp, const LOCA::PhaseTransition::ExtendedVector &d, double step)
 See above.
 
NOX::Abstract::Group::ReturnType computeF ()
 Compute and store F(x).
 
NOX::Abstract::Group::ReturnType computeJacobian ()
 Compute and store Jacobian.
 
NOX::Abstract::Group::ReturnType computeNewton (Teuchos::ParameterList &params)
 Compute the Newton direction, using parameters for the linear solve.
 
Jacobian operations.

Operations using the Jacobian matrix. These may not be defined in matrix-free scenarios.

NOX::Abstract::Group::ReturnType applyJacobian (const LOCA::PhaseTransition::ExtendedVector &input, LOCA::PhaseTransition::ExtendedVector &result) const
 
NOX::Abstract::Group::ReturnType applyJacobian (const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const
 See above.
 
NOX::Abstract::Group::ReturnType applyJacobianInverse (Teuchos::ParameterList &params, const LOCA::PhaseTransition::ExtendedVector &input, LOCA::PhaseTransition::ExtendedVector &result) const
 
NOX::Abstract::Group::ReturnType applyJacobianInverse (Teuchos::ParameterList &params, const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const
 Applies the inverse of the Jacobian matrix to the given input vector and puts the answer in result.
 
"Is" functions

Checks to see if various objects have been computed. Returns true if the corresponding "compute" function has been called since the last update to the solution vector (via instantiation or computeX).

bool isF () const
 Return true if F is valid.
 
bool isJacobian () const
 Return true if the Jacobian is valid.
 
bool isNewton () const
 Return true if the Newton direction is valid.
 
- Public Member Functions inherited from LOCA::Extended::MultiAbstractGroup
 MultiAbstractGroup ()
 Default constructor.
 
virtual ~MultiAbstractGroup ()
 Destructor.
 
virtual Teuchos::RCP< const LOCA::MultiContinuation::AbstractGroupgetBaseLevelUnderlyingGroup () const
 Return base-level underlying group.
 
virtual Teuchos::RCP< LOCA::MultiContinuation::AbstractGroupgetBaseLevelUnderlyingGroup ()
 Return base-level underlying group.
 
- Public Member Functions inherited from NOX::Abstract::Group
 Group ()
 Constructor.
 
virtual ~Group ()
 Destructor.
 
virtual NOX::Abstract::Group::ReturnType computeGradient ()
 Compute and store gradient.
 
virtual NOX::Abstract::Group::ReturnType applyJacobianTranspose (const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const
 Applies Jacobian-Transpose to the given input vector and puts the answer in the result.
 
virtual NOX::Abstract::Group::ReturnType applyRightPreconditioning (bool useTranspose, Teuchos::ParameterList &params, const NOX::Abstract::Vector &input, NOX::Abstract::Vector &result) const
 Apply right preconditiong to the given input vector.
 
virtual NOX::Abstract::Group::ReturnType applyJacobianMultiVector (const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const
 applyJacobian for multiple right-hand sides
 
virtual NOX::Abstract::Group::ReturnType applyJacobianTransposeMultiVector (const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const
 applyJacobianTranspose for multiple right-hand sides
 
virtual NOX::Abstract::Group::ReturnType applyJacobianInverseMultiVector (Teuchos::ParameterList &params, const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const
 applyJacobianInverse for multiple right-hand sides
 
virtual NOX::Abstract::Group::ReturnType applyRightPreconditioningMultiVector (bool useTranspose, Teuchos::ParameterList &params, const NOX::Abstract::MultiVector &input, NOX::Abstract::MultiVector &result) const
 applyRightPreconditioning for multiple right-hand sides
 
virtual bool isGradient () const
 Return true if the gradient is valid.
 
virtual const NOX::Abstract::VectorgetScaledX () const
 
virtual void logLastLinearSolveStats (NOX::SolverStats &stats) const
 Adds statistics from last linear solve to the SovlerStats object.
 
virtual NOX::Abstract::Group::ReturnType getNormLastLinearSolveResidual (double &residual) const
 Return the norm of the last linear solve residual as the result of either a call to computeNewton() or applyJacobianInverse().
 
- Public Member Functions inherited from LOCA::MultiContinuation::AbstractGroup
 AbstractGroup ()
 Default constructor.
 
virtual ~AbstractGroup ()
 Destructor.
 
virtual void preProcessContinuationStep (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Perform any preprocessing before a continuation step starts.
 
virtual void postProcessContinuationStep (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Perform any postprocessing after a continuation step finishes.
 
virtual void projectToDraw (const NOX::Abstract::Vector &x, double *px) const
 Projects solution to a few scalars for multiparameter continuation.
 
virtual int projectToDrawDimension () const
 Returns the dimension of the project to draw array.
 
virtual double computeScaledDotProduct (const NOX::Abstract::Vector &a, const NOX::Abstract::Vector &b) const
 Compute a scaled dot product.
 
virtual void scaleVector (NOX::Abstract::Vector &x) const
 Scales a vector using scaling vector.
 

Protected Attributes

Vectors
Teuchos::RCP< LOCA::PhaseTransition::ExtendedVectorxVector
 Solution vector.
 
Teuchos::RCP< LOCA::PhaseTransition::ExtendedVectorfVector
 Right-hand-side vector (function evaluation).
 
Teuchos::RCP< LOCA::PhaseTransition::ExtendedVectornewtonVector
 Newton direction vector.
 
IsValid flags

True if the current solution is up-to-date with respect to the currect xVector.

bool isValidF
 
bool isValidJacobian
 
bool isValidNewton
 
double normF
 
const Teuchos::RCP< LOCA::GlobalDataglobalData
 
int bifParamID
 

"Get" functions

Note that these function do not check whether or not the vectors are valid. Must use the "Is" functions for that purpose.

Teuchos::RCP< LOCA::PhaseTransition::AbstractGroupgrp
 Solution vector.
 
const NOX::Abstract::VectorgetX () const
 Return solution vector.
 
const NOX::Abstract::VectorgetF () const
 Return F(x)
 
double getNormF () const
 Return 2-norm of F(x).
 
const NOX::Abstract::VectorgetNewton () const
 Return Newton direction.
 
const NOX::Abstract::VectorgetGradient () const
 Return gradient.
 
Teuchos::RCP< const NOX::Abstract::VectorgetXPtr () const
 Return RCP to solution vector.
 
Teuchos::RCP< const NOX::Abstract::VectorgetFPtr () const
 Return RCP to F(x)
 
Teuchos::RCP< const NOX::Abstract::VectorgetNewtonPtr () const
 Return RCP to Newton direction.
 
Teuchos::RCP< const NOX::Abstract::VectorgetGradientPtr () const
 Return RCP to gradient.
 
virtual Teuchos::RCP< NOX::Abstract::Groupclone (NOX::CopyType type=NOX::DeepCopy) const
 Create a new Group of the same derived type as this one by cloning this one, and return a ref count pointer to the new group.
 
void print () const
 Print out the group.
 
void copy (const NOX::Abstract::Group &source)
 Start methods for LOCA::Abstract::Group.
 
void setParams (const LOCA::ParameterVector &p)
 Set the parameter vector in the group to p (pVector = p).
 
void setParam (int paramID, double val)
 Set parameter indexed by (integer) paramID.
 
void setParam (std::string paramID, double val)
 Set parameter indexed by (std::string) paramID.
 
const LOCA::ParameterVectorgetParams () const
 Return a const reference to the ParameterVector owned by the group.
 
double getParam (int paramID) const
 Return copy of parameter indexed by (integer) paramID.
 
double getParam (std::string paramID) const
 Return copy of parameter indexed by (std::string) paramID.
 
void printSolution (const NOX::Abstract::Vector &solution, const double param) const
 Set parameter indexed by (std::string) paramID.
 
void printSolution (const double param) const
 Function to print out solution and parameter after successful step.
 
virtual Teuchos::RCP< const LOCA::MultiContinuation::AbstractGroupgetUnderlyingGroup () const
 Return underlying group.
 
virtual Teuchos::RCP< LOCA::MultiContinuation::AbstractGroupgetUnderlyingGroup ()
 Return underlying group.
 
virtual void setParamsMulti (const std::vector< int > &paramIDs, const NOX::Abstract::MultiVector::DenseMatrix &vals)
 Set parameters indexed by (integer) paramIDs.
 
virtual NOX::Abstract::Group::ReturnType computeDfDpMulti (const std::vector< int > &paramIDs, NOX::Abstract::MultiVector &dfdp, bool isValid_F)
 
void resetIsValid ()
 resets the isValid flags to false
 

Additional Inherited Members

- Public Types inherited from NOX::Abstract::Group
enum  ReturnType {
  Ok , NotDefined , BadDependency , NotConverged ,
  Failed
}
 The computation of, say, the Newton direction in computeNewton() may fail in many different ways, so we have included a variety of return codes to describe the failures. Of course, we also have a code for success. More...
 

Member Function Documentation

◆ applyJacobian()

NOX::Abstract::Group::ReturnType LOCA::PhaseTransition::ExtendedGroup::applyJacobian ( const NOX::Abstract::Vector & input,
NOX::Abstract::Vector & result ) const
virtual

See above.

Reimplemented from NOX::Abstract::Group.

◆ applyJacobianInverse()

NOX::Abstract::Group::ReturnType LOCA::PhaseTransition::ExtendedGroup::applyJacobianInverse ( Teuchos::ParameterList & params,
const NOX::Abstract::Vector & input,
NOX::Abstract::Vector & result ) const
virtual

Applies the inverse of the Jacobian matrix to the given input vector and puts the answer in result.

Computes

\[ v = J^{-1} u, \]

where $ J$ is the Jacobian, $ u$ is the input vector, and $ v$ is the result vector.

The "Tolerance" parameter specifies that the solution should be such that

\[
\frac{\| J v - u \|_2}{\max \{ 1, \|u\|_2\} } < \mbox{Tolerance}
\]

Returns

The parameter "Tolerance" may be added/modified in the list of parameters - this is the ideal solution tolerance for an iterative linear solve.

Reimplemented from NOX::Abstract::Group.

◆ clone()

Teuchos::RCP< NOX::Abstract::Group > LOCA::PhaseTransition::ExtendedGroup::clone ( NOX::CopyType type = NOX::DeepCopy) const
virtual

Create a new Group of the same derived type as this one by cloning this one, and return a ref count pointer to the new group.

If type is NOX::DeepCopy, then we need to create an exact replica of "this". Otherwise, if type is NOX::ShapeCopy, we need only replicate the shape of "this" (only the memory is allocated, the values are not copied into the vectors and Jacobian). Returns NULL if clone is not supported.

Note
Any shared data should have its ownership transfered to this group from the source for a NOX::DeepCopy.

Implements NOX::Abstract::Group.

◆ computeDfDpMulti()

NOX::Abstract::Group::ReturnType LOCA::PhaseTransition::ExtendedGroup::computeDfDpMulti ( const std::vector< int > & paramIDs,
NOX::Abstract::MultiVector & dfdp,
bool isValidF )
virtual

Compute $\partial F/\partial p$ for each parameter $ p$ indexed by paramIDs. The first column of dfdp holds F, which is valid if isValidF is true. Otherwise F must be computed.

Implements LOCA::MultiContinuation::AbstractGroup.

References NOX::Abstract::Group::BadDependency.

◆ computeF()

NOX::Abstract::Group::ReturnType LOCA::PhaseTransition::ExtendedGroup::computeF ( )
virtual

Compute and store F(x).

Note
It's generally useful to also compute and store the 2-norm of F(x) at this point for later access by the getNormF() function.
Returns

Implements NOX::Abstract::Group.

References NOX::Abstract::Group::Ok.

◆ computeJacobian()

NOX::Abstract::Group::ReturnType LOCA::PhaseTransition::ExtendedGroup::computeJacobian ( )
virtual

Compute and store Jacobian.

Recall that

\[
F(x) = \left[ \begin{array}{c} F_1(x) \\ F_2(x) \\ \vdots \\ F_n(x) \\ \end{array} \right].
\]

The Jacobian is denoted by $ J$ and defined by

\[
J_{ij} = \frac{\partial F_i}{\partial x_j} (x).
\]

Note
If this is a shared object, this group should take ownership of the Jacobian before it computes it.
Returns

Reimplemented from NOX::Abstract::Group.

References NOX::Abstract::Group::Ok.

◆ computeNewton()

NOX::Abstract::Group::ReturnType LOCA::PhaseTransition::ExtendedGroup::computeNewton ( Teuchos::ParameterList & params)
virtual

Compute the Newton direction, using parameters for the linear solve.

The Newton direction is the solution, s, of

\[
J s = -F.
\]

The parameters are from the "Linear %Solver" sublist of the "Direction" sublist that is passed to solver during construction.

The "Tolerance" parameter may be added/modified in the sublist of "Linear Solver" parameters that is passed into this function. The solution should be such that

\[
\frac{\| J s - (-F) \|_2}{\max \{ 1, \|F\|_2\} } < \mbox{Tolerance}
\]

Returns

Reimplemented from NOX::Abstract::Group.

References NOX::Abstract::Group::Ok.

◆ computeX()

void LOCA::PhaseTransition::ExtendedGroup::computeX ( const NOX::Abstract::Group & grp,
const NOX::Abstract::Vector & d,
double step )
virtual

Compute x = grp.x + step * d.

Let $ x$ denote this group's solution vector. Let $\hat x$ denote the result of grp.getX(). Then set

\[
x = \hat x + \mbox{step} \; d.
\]

Note
This should invalidate the function value, Jacobian, gradient, and Newton direction.
Throw an error if the copy fails.
Returns
Reference to this object

Implements NOX::Abstract::Group.

◆ copy()

void LOCA::PhaseTransition::ExtendedGroup::copy ( const NOX::Abstract::Group & source)
inlinevirtual

◆ getF()

const NOX::Abstract::Vector & LOCA::PhaseTransition::ExtendedGroup::getF ( ) const
virtual

Return F(x)

Implements NOX::Abstract::Group.

◆ getFPtr()

Teuchos::RCP< const NOX::Abstract::Vector > LOCA::PhaseTransition::ExtendedGroup::getFPtr ( ) const
virtual

Return RCP to F(x)

Implements NOX::Abstract::Group.

◆ getGradient()

const NOX::Abstract::Vector & LOCA::PhaseTransition::ExtendedGroup::getGradient ( ) const
virtual

Return gradient.

Implements NOX::Abstract::Group.

◆ getGradientPtr()

Teuchos::RCP< const NOX::Abstract::Vector > LOCA::PhaseTransition::ExtendedGroup::getGradientPtr ( ) const
virtual

Return RCP to gradient.

Implements NOX::Abstract::Group.

◆ getNewton()

const NOX::Abstract::Vector & LOCA::PhaseTransition::ExtendedGroup::getNewton ( ) const
virtual

Return Newton direction.

Implements NOX::Abstract::Group.

◆ getNewtonPtr()

Teuchos::RCP< const NOX::Abstract::Vector > LOCA::PhaseTransition::ExtendedGroup::getNewtonPtr ( ) const
virtual

Return RCP to Newton direction.

Implements NOX::Abstract::Group.

◆ getNormF()

double LOCA::PhaseTransition::ExtendedGroup::getNormF ( ) const
virtual

Return 2-norm of F(x).

In other words,

\[ \sqrt{\sum_{i=1}^n F_i^2} \]

Implements NOX::Abstract::Group.

◆ getParam() [1/2]

double LOCA::PhaseTransition::ExtendedGroup::getParam ( int paramID) const
virtual

Return copy of parameter indexed by (integer) paramID.

Implements LOCA::MultiContinuation::AbstractGroup.

◆ getParam() [2/2]

double LOCA::PhaseTransition::ExtendedGroup::getParam ( std::string paramID) const
virtual

Return copy of parameter indexed by (std::string) paramID.

Implements LOCA::MultiContinuation::AbstractGroup.

◆ getParams()

const LOCA::ParameterVector & LOCA::PhaseTransition::ExtendedGroup::getParams ( ) const
virtual

Return a const reference to the ParameterVector owned by the group.

Implements LOCA::MultiContinuation::AbstractGroup.

◆ getUnderlyingGroup() [1/2]

virtual Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > LOCA::PhaseTransition::ExtendedGroup::getUnderlyingGroup ( )
inlinevirtual

Return underlying group.

Implements LOCA::Extended::MultiAbstractGroup.

References grp.

◆ getUnderlyingGroup() [2/2]

virtual Teuchos::RCP< const LOCA::MultiContinuation::AbstractGroup > LOCA::PhaseTransition::ExtendedGroup::getUnderlyingGroup ( ) const
inlinevirtual

Return underlying group.

Implements LOCA::Extended::MultiAbstractGroup.

References grp.

◆ getX()

const NOX::Abstract::Vector & LOCA::PhaseTransition::ExtendedGroup::getX ( ) const
virtual

Return solution vector.

Implements NOX::Abstract::Group.

◆ getXPtr()

Teuchos::RCP< const NOX::Abstract::Vector > LOCA::PhaseTransition::ExtendedGroup::getXPtr ( ) const
virtual

Return RCP to solution vector.

Implements NOX::Abstract::Group.

◆ isF()

bool LOCA::PhaseTransition::ExtendedGroup::isF ( ) const
virtual

Return true if F is valid.

Implements NOX::Abstract::Group.

◆ isJacobian()

bool LOCA::PhaseTransition::ExtendedGroup::isJacobian ( ) const
virtual

Return true if the Jacobian is valid.

Note
Default implementation in NOX::Abstract::Group returns false.

Reimplemented from NOX::Abstract::Group.

◆ isNewton()

bool LOCA::PhaseTransition::ExtendedGroup::isNewton ( ) const
virtual

Return true if the Newton direction is valid.

Note
Default implementation in NOX::Abstract::Group returns false.

Reimplemented from NOX::Abstract::Group.

◆ operator=()

NOX::Abstract::Group & LOCA::PhaseTransition::ExtendedGroup::operator= ( const NOX::Abstract::Group & source)
virtual

Copies the source group into this group.

Note
Any shared data owned by the source should have its ownership transfered to this group. This may result in a secret modification to the source object.

Implements NOX::Abstract::Group.

◆ printSolution() [1/2]

void LOCA::PhaseTransition::ExtendedGroup::printSolution ( const double ) const
virtual

Function to print out solution and parameter after successful step.

Empty default definition.

Reimplemented from LOCA::MultiContinuation::AbstractGroup.

◆ printSolution() [2/2]

void LOCA::PhaseTransition::ExtendedGroup::printSolution ( const NOX::Abstract::Vector & solution,
const double param ) const
virtual

Set parameter indexed by (std::string) paramID.

Reimplemented from LOCA::MultiContinuation::AbstractGroup.

◆ setParam() [1/2]

void LOCA::PhaseTransition::ExtendedGroup::setParam ( int paramID,
double val )
virtual

Set parameter indexed by (integer) paramID.

Implements LOCA::MultiContinuation::AbstractGroup.

◆ setParam() [2/2]

void LOCA::PhaseTransition::ExtendedGroup::setParam ( std::string paramID,
double val )
virtual

Set parameter indexed by (std::string) paramID.

Implements LOCA::MultiContinuation::AbstractGroup.

◆ setParams()

void LOCA::PhaseTransition::ExtendedGroup::setParams ( const LOCA::ParameterVector & p)
virtual

Set the parameter vector in the group to p (pVector = p).

Implements LOCA::MultiContinuation::AbstractGroup.

◆ setParamsMulti()

void LOCA::PhaseTransition::ExtendedGroup::setParamsMulti ( const std::vector< int > & paramIDs,
const NOX::Abstract::MultiVector::DenseMatrix & vals )
virtual

Set parameters indexed by (integer) paramIDs.

Implements LOCA::MultiContinuation::AbstractGroup.

◆ setX()

void LOCA::PhaseTransition::ExtendedGroup::setX ( const NOX::Abstract::Vector & y)
virtual

Set the solution vector x to y.

Note
This should invalidate the function value, Jacobian, gradient, and Newton direction.
Throw an error if the copy fails.
Returns
Reference to this object

Implements NOX::Abstract::Group.


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