NOX Development
Loading...
Searching...
No Matches
LOCA::Stepper Class Reference

Implementation of LOCA::Abstract::Iterator for computing points along a continuation curve. More...

#include <LOCA_Stepper.H>

Inheritance diagram for LOCA::Stepper:
Collaboration diagram for LOCA::Stepper:

Public Member Functions

 Stepper (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > &initialGuess, const Teuchos::RCP< LOCA::StatusTest::Abstract > &lt, const Teuchos::RCP< NOX::StatusTest::Generic > &nt, const Teuchos::RCP< Teuchos::ParameterList > &p)
 Constructor with LOCA::StatusTest.
 Stepper (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > &initialGuess, const Teuchos::RCP< NOX::StatusTest::Generic > &nt, const Teuchos::RCP< Teuchos::ParameterList > &p)
virtual ~Stepper ()
 Destructor.
virtual bool reset (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > &initialGuess, const Teuchos::RCP< LOCA::StatusTest::Abstract > &lt, const Teuchos::RCP< NOX::StatusTest::Generic > &nt, const Teuchos::RCP< Teuchos::ParameterList > &p)
virtual bool reset (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > &initialGuess, const Teuchos::RCP< NOX::StatusTest::Generic > &nt, const Teuchos::RCP< Teuchos::ParameterList > &p)
bool eigensolverReset (Teuchos::RCP< Teuchos::ParameterList > &newEigensolverList)
 Replaces the eigensolver parameter list.
virtual Teuchos::RCP< const LOCA::MultiContinuation::AbstractGroupgetSolutionGroup () const
 Return the current solution group.
virtual Teuchos::RCP< const LOCA::MultiContinuation::AbstractGroupgetBifurcationGroup () const
 Return the current bifurcation group.
virtual Teuchos::RCP< const Teuchos::ParameterList > getList () const
 Return the output parameters from the stepper algorithm.
virtual Teuchos::RCP< NOX::Solver::GenericgetSolver ()
 Return the current nonlinear solver pointer.
virtual double getContinuationParameter () const
 Return the current continuation parameter from the underlying LOCA::MultiContinuation::AbstractStrategy.
Teuchos::ParameterList & getParams ()
 Get parameter list.
Teuchos::ParameterList & getStepSizeParams ()
 Get step size parameter list.
Public Member Functions inherited from LOCA::Abstract::Iterator
 Iterator (Teuchos::ParameterList &p)
 Constructor.
 Iterator (const Iterator &it)
 Copy Constructor.
virtual ~Iterator ()
 Destructor.
virtual bool resetIterator (Teuchos::ParameterList &p)
 Reset the iterator to start a new iteration.
virtual IteratorStatus getIteratorStatus () const
 Return the status of the iterator.
virtual int getStepNumber () const
 Returns the number of accepted steps.
virtual int getNumFailedSteps () const
 Returns the number of failed steps.
virtual int getNumTotalSteps () const
 Returns the total number of steps attempted.
virtual IteratorStatus run ()
 Run the iterator.

Protected Member Functions

virtual LOCA::Abstract::Iterator::IteratorStatus start ()
 Initialize iterator.
virtual LOCA::Abstract::Iterator::IteratorStatus finish (LOCA::Abstract::Iterator::IteratorStatus iteratorStatus)
 Finalize iterator.
virtual LOCA::Abstract::Iterator::StepStatus preprocess (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Preprocess step.
virtual LOCA::Abstract::Iterator::StepStatus compute (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Compute step.
virtual LOCA::Abstract::Iterator::StepStatus postprocess (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Postprocess step.
virtual LOCA::Abstract::Iterator::IteratorStatus stop (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Wrapper method for stopping criteria checks.
LOCA::Abstract::Iterator::IteratorStatus stopLocaStatus (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Check stopping criteria using LOCA::StatusTest.
LOCA::Abstract::Iterator::IteratorStatus stopDeprecated (LOCA::Abstract::Iterator::StepStatus stepStatus)
Teuchos::RCP< LOCA::MultiContinuation::AbstractGroupbuildConstrainedGroup (const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > &grp)
 Builds a constrained group is specified through parameter lists.
LOCA::Abstract::Iterator::StepStatus computeStepSize (LOCA::Abstract::Iterator::StepStatus stepStatus, double &stepSize)
 Compute a new step size based on results from the previous step.
virtual void printInitializationInfo ()
 Print to the screen the initialization information.
virtual void printStartStep ()
 Print to the screen information for the beginning of a new continuation step.
virtual void printEndStep (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Print to the screen information for the end of a successful continuation step.
virtual void printEndInfo ()
 Print to the screen the concluding information.
virtual bool withinThreshold ()
 Checks to see if continuation parameter is within threshold of bound.
Protected Member Functions inherited from LOCA::Abstract::Iterator
 Iterator ()
 Constructor.
virtual IteratorStatus iterate ()
 Perform iteration.
virtual void setLastIteration ()
 Set iterator status as LastIteration.
virtual bool isLastIteration ()
 Returns true of the iteratorStatus is LastIteration.
virtual StepStatus computeStepStatus (StepStatus preStatus, StepStatus compStatus, StepStatus postStatus)
 Compute step, iterator status from status of each component of step.

Protected Attributes

Teuchos::RCP< LOCA::GlobalDataglobalData
 Global data.
Teuchos::RCP< LOCA::Parameter::SublistParserparsedParams
 Parsed parameter list.
Teuchos::RCP< LOCA::MultiPredictor::AbstractStrategypredictor
 Predictor strategy.
Teuchos::RCP< LOCA::MultiContinuation::AbstractStrategycurGroupPtr
 Current continuation group.
Teuchos::RCP< LOCA::MultiContinuation::AbstractStrategyprevGroupPtr
 Continuation group from previous step.
Teuchos::RCP< LOCA::Eigensolver::AbstractStrategyeigensolver
 Eigensolver for computing eigenvalues after each continuation step.
Teuchos::RCP< LOCA::SaveEigenData::AbstractStrategysaveEigenData
 Strategy for saving eigenvectors/values.
Teuchos::RCP< LOCA::MultiContinuation::AbstractGroupbifGroupPtr
 Pointer to bifurcation group.
Teuchos::RCP< NOX::StatusTest::GenericnoxStatusTestPtr
 Pointer to the NOX status test.
Teuchos::RCP< LOCA::StatusTest::AbstractlocaStatusTestPtr
 Pointer to the LOCA status test.
Teuchos::RCP< Teuchos::ParameterList > paramListPtr
 Pointer to parameter list passed in constructor/reset method.
Teuchos::RCP< Teuchos::ParameterList > stepperList
 Pointer to stepper parameters.
Teuchos::RCP< NOX::Solver::GenericsolverPtr
 Solver (a.k.a corrector).
Teuchos::RCP< LOCA::MultiContinuation::ExtendedVectorcurPredictorPtr
 Current predictor direction.
Teuchos::RCP< LOCA::MultiContinuation::ExtendedVectorprevPredictorPtr
 previous predictor direction
Teuchos::RCP< LOCA::StepSize::AbstractStrategystepSizeStrategyPtr
 Step size control strategy.
std::string conParamName
 Name of continuation parameter.
std::vector< int > conParamIDs
 Index of continuation parameter.
double startValue
 Starting value of continuation parameter, $\lambda_b $.
double maxValue
 Largest allowable value of continuation parameter.
double minValue
 Smallest allowable value of continuation parameter.
double stepSize
 Current step size (change in the continuation parameter), $\Delta \lambda_i $.
int maxNonlinearSteps
 Maximum number of Newton iterations per continuation step, $ N_{max} $. Defaults to 15.
double targetValue
 Target parameter value for last step (either maxValue or minValue).
bool isTargetStep
 Flag indicating if this is an extra step to hit target value.
bool doTangentFactorScaling
 Flag indicating whether to do tangent factor step size scaling.
double tangentFactor
 Tangent factor.
double minTangentFactor
 Minimum tangent factor.
double tangentFactorExponent
 Tangent factor exponent.
bool calcEigenvalues
 Flag indicating whether to compute eigenvalues after each step.
bool calcEigenvaluesTargetStep
 Flag indicating whether to compute eigenvalues on last (target) step.
bool return_failed_on_max_steps
 Flag indicating whether to return failed upon reaching max steps.
bool printOnlyConvergedSol
 Flag indicating whether to print only converged solution (default true).
Protected Attributes inherited from LOCA::Abstract::Iterator
int stepNumber
 Current step number of continuation algorithm (does not include failed steps).
int numFailedSteps
 Number of continuation steps that have failed.
int numTotalSteps
 Total number of steps attempeted (includes failed and successful steps).
int maxSteps
 Maximum number of continuation steps to take. Defaults to 100.
IteratorStatus iteratorStatus
 Current status of the iterator.

Additional Inherited Members

Public Types inherited from LOCA::Abstract::Iterator
enum  IteratorStatus { LastIteration = 2 , Finished = 1 , Failed = 0 , NotFinished = -1 }
 Enumerated type for status of the iterator. More...
enum  StepStatus { Successful = 1 , Unsuccessful = 0 , Provisional = -1 }
 Enumerated type for status of each step of iterator. More...

Detailed Description

Implementation of LOCA::Abstract::Iterator for computing points along a continuation curve.

The Stepper class implements the pure virtual methods of the LOCA::Abstract::Iterator for iteratively computing points along a continuation curve.

Constructor & Destructor Documentation

◆ Stepper() [1/2]

◆ Stepper() [2/2]

Member Function Documentation

◆ buildConstrainedGroup()

Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > LOCA::Stepper::buildConstrainedGroup ( const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > & grp)
protected

Builds a constrained group is specified through parameter lists.

References LOCA::ParameterVector::getIndex(), globalData, and parsedParams.

◆ compute()

◆ computeStepSize()

◆ eigensolverReset()

bool LOCA::Stepper::eigensolverReset ( Teuchos::RCP< Teuchos::ParameterList > & newEigensolverList)

Replaces the eigensolver parameter list.

References eigensolver, globalData, and parsedParams.

◆ finish()

◆ getBifurcationGroup()

Teuchos::RCP< const LOCA::MultiContinuation::AbstractGroup > LOCA::Stepper::getBifurcationGroup ( ) const
virtual

Return the current bifurcation group.

If the current bifurcation method is "None", then the returned group is the same as getSolutionGroup(), otherwise this method returns the current bifurcation group (e.g., a turning point group).

References curGroupPtr.

◆ getContinuationParameter()

double LOCA::Stepper::getContinuationParameter ( ) const
virtual

Return the current continuation parameter from the underlying LOCA::MultiContinuation::AbstractStrategy.

References curGroupPtr.

◆ getList()

Teuchos::RCP< const Teuchos::ParameterList > LOCA::Stepper::getList ( ) const
virtual

Return the output parameters from the stepper algorithm.

References paramListPtr.

◆ getParams()

Teuchos::ParameterList & LOCA::Stepper::getParams ( )

Get parameter list.

References stepperList.

◆ getSolutionGroup()

Teuchos::RCP< const LOCA::MultiContinuation::AbstractGroup > LOCA::Stepper::getSolutionGroup ( ) const
virtual

Return the current solution group.

References curGroupPtr.

◆ getSolver()

Teuchos::RCP< NOX::Solver::Generic > LOCA::Stepper::getSolver ( )
virtual

Return the current nonlinear solver pointer.

Will throw an error if the solver does not exist yet.

References globalData, and solverPtr.

◆ getStepSizeParams()

Teuchos::ParameterList & LOCA::Stepper::getStepSizeParams ( )

Get step size parameter list.

References parsedParams.

◆ postprocess()

◆ preprocess()

◆ printEndStep()

void LOCA::Stepper::printEndStep ( LOCA::Abstract::Iterator::StepStatus stepStatus)
protectedvirtual

Print to the screen information for the end of a successful continuation step.

References conParamName, curGroupPtr, globalData, prevGroupPtr, solverPtr, LOCA::Abstract::Iterator::stepNumber, NOX::Utils::StepperIteration, and LOCA::Abstract::Iterator::Successful.

Referenced by compute(), finish(), and start().

◆ printInitializationInfo()

void LOCA::Stepper::printInitializationInfo ( )
protectedvirtual

Print to the screen the initialization information.

References globalData, LOCA::Abstract::Iterator::maxSteps, maxValue, minValue, startValue, NOX::Utils::StepperIteration, and stepperList.

◆ printStartStep()

void LOCA::Stepper::printStartStep ( )
protectedvirtual

Print to the screen information for the beginning of a new continuation step.

References conParamName, curGroupPtr, globalData, isTargetStep, prevGroupPtr, LOCA::Abstract::Iterator::stepNumber, NOX::Utils::StepperIteration, stepperList, stepSize, stepSizeStrategyPtr, and targetValue.

Referenced by compute(), finish(), and start().

◆ reset() [1/2]

bool LOCA::Stepper::reset ( const Teuchos::RCP< LOCA::GlobalData > & global_data,
const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > & initialGuess,
const Teuchos::RCP< LOCA::StatusTest::Abstract > & lt,
const Teuchos::RCP< NOX::StatusTest::Generic > & nt,
const Teuchos::RCP< Teuchos::ParameterList > & p )
virtual

Reset the Stepper to start a new continuation run. Version with LOCA::StatusTest

References locaStatusTestPtr.

Referenced by Stepper(), and Stepper().

◆ reset() [2/2]

bool LOCA::Stepper::reset ( const Teuchos::RCP< LOCA::GlobalData > & global_data,
const Teuchos::RCP< LOCA::MultiContinuation::AbstractGroup > & initialGuess,
const Teuchos::RCP< NOX::StatusTest::Generic > & nt,
const Teuchos::RCP< Teuchos::ParameterList > & p )
virtual

Reset the Stepper to start a new continuation run. Obsolete version without LOCA::StatusTest.

Deprecated
Use reset() with LOCA::StatusTest instead.

◆ start()

◆ stop()

LOCA::Abstract::Iterator::IteratorStatus LOCA::Stepper::stop ( LOCA::Abstract::Iterator::StepStatus stepStatus)
protectedvirtual

Wrapper method for stopping criteria checks.

Reimplemented from LOCA::Abstract::Iterator.

References locaStatusTestPtr, stopDeprecated(), and stopLocaStatus().

◆ stopDeprecated()

◆ stopLocaStatus()

◆ withinThreshold()

bool LOCA::Stepper::withinThreshold ( )
protectedvirtual

Checks to see if continuation parameter is within threshold of bound.

References curGroupPtr, parsedParams, stepperList, and targetValue.

Referenced by stopDeprecated().

Member Data Documentation

◆ bifGroupPtr

Teuchos::RCP<LOCA::MultiContinuation::AbstractGroup> LOCA::Stepper::bifGroupPtr
protected

Pointer to bifurcation group.

Referenced by Stepper(), and Stepper().

◆ calcEigenvalues

bool LOCA::Stepper::calcEigenvalues
protected

Flag indicating whether to compute eigenvalues after each step.

Referenced by postprocess(), start(), Stepper(), and Stepper().

◆ calcEigenvaluesTargetStep

bool LOCA::Stepper::calcEigenvaluesTargetStep
protected

Flag indicating whether to compute eigenvalues on last (target) step.

Referenced by finish(), Stepper(), and Stepper().

◆ conParamIDs

std::vector<int> LOCA::Stepper::conParamIDs
protected

Index of continuation parameter.

Referenced by finish(), start(), Stepper(), and Stepper().

◆ conParamName

std::string LOCA::Stepper::conParamName
protected

Name of continuation parameter.

Referenced by printEndStep(), printStartStep(), Stepper(), and Stepper().

◆ curGroupPtr

◆ curPredictorPtr

Teuchos::RCP<LOCA::MultiContinuation::ExtendedVector> LOCA::Stepper::curPredictorPtr
protected

Current predictor direction.

Referenced by computeStepSize(), finish(), postprocess(), preprocess(), start(), Stepper(), and Stepper().

◆ doTangentFactorScaling

bool LOCA::Stepper::doTangentFactorScaling
protected

Flag indicating whether to do tangent factor step size scaling.

Referenced by computeStepSize(), postprocess(), Stepper(), and Stepper().

◆ eigensolver

Teuchos::RCP<LOCA::Eigensolver::AbstractStrategy> LOCA::Stepper::eigensolver
protected

Eigensolver for computing eigenvalues after each continuation step.

Referenced by eigensolverReset(), Stepper(), and Stepper().

◆ globalData

◆ isTargetStep

bool LOCA::Stepper::isTargetStep
protected

Flag indicating if this is an extra step to hit target value.

Referenced by finish(), printStartStep(), Stepper(), and Stepper().

◆ locaStatusTestPtr

Teuchos::RCP<LOCA::StatusTest::Abstract> LOCA::Stepper::locaStatusTestPtr
protected

Pointer to the LOCA status test.

Referenced by reset(), Stepper(), Stepper(), stop(), and stopLocaStatus().

◆ maxNonlinearSteps

int LOCA::Stepper::maxNonlinearSteps
protected

Maximum number of Newton iterations per continuation step, $ N_{max} $. Defaults to 15.

Referenced by Stepper(), and Stepper().

◆ maxValue

double LOCA::Stepper::maxValue
protected

Largest allowable value of continuation parameter.

Referenced by computeStepSize(), printInitializationInfo(), Stepper(), Stepper(), and stopDeprecated().

◆ minTangentFactor

double LOCA::Stepper::minTangentFactor
protected

Minimum tangent factor.

Referenced by postprocess(), Stepper(), and Stepper().

◆ minValue

double LOCA::Stepper::minValue
protected

Smallest allowable value of continuation parameter.

Referenced by computeStepSize(), printInitializationInfo(), Stepper(), Stepper(), and stopDeprecated().

◆ noxStatusTestPtr

Teuchos::RCP<NOX::StatusTest::Generic> LOCA::Stepper::noxStatusTestPtr
protected

Pointer to the NOX status test.

Referenced by finish(), preprocess(), start(), Stepper(), and Stepper().

◆ paramListPtr

Teuchos::RCP<Teuchos::ParameterList> LOCA::Stepper::paramListPtr
protected

Pointer to parameter list passed in constructor/reset method.

Referenced by getList(), Stepper(), and Stepper().

◆ parsedParams

Teuchos::RCP<LOCA::Parameter::SublistParser> LOCA::Stepper::parsedParams
protected

◆ predictor

Teuchos::RCP<LOCA::MultiPredictor::AbstractStrategy> LOCA::Stepper::predictor
protected

Predictor strategy.

Referenced by finish(), start(), Stepper(), and Stepper().

◆ prevGroupPtr

Teuchos::RCP<LOCA::MultiContinuation::AbstractStrategy> LOCA::Stepper::prevGroupPtr
protected

Continuation group from previous step.

Referenced by finish(), preprocess(), printEndStep(), printStartStep(), start(), Stepper(), Stepper(), and stopDeprecated().

◆ prevPredictorPtr

Teuchos::RCP<LOCA::MultiContinuation::ExtendedVector> LOCA::Stepper::prevPredictorPtr
protected

previous predictor direction

Referenced by postprocess(), start(), Stepper(), and Stepper().

◆ printOnlyConvergedSol

bool LOCA::Stepper::printOnlyConvergedSol
protected

Flag indicating whether to print only converged solution (default true).

Referenced by postprocess(), Stepper(), and Stepper().

◆ return_failed_on_max_steps

bool LOCA::Stepper::return_failed_on_max_steps
protected

Flag indicating whether to return failed upon reaching max steps.

Referenced by Stepper(), Stepper(), and stopDeprecated().

◆ saveEigenData

Teuchos::RCP<LOCA::SaveEigenData::AbstractStrategy> LOCA::Stepper::saveEigenData
protected

Strategy for saving eigenvectors/values.

Referenced by Stepper(), and Stepper().

◆ solverPtr

Teuchos::RCP<NOX::Solver::Generic> LOCA::Stepper::solverPtr
protected

◆ startValue

double LOCA::Stepper::startValue
protected

Starting value of continuation parameter, $\lambda_b $.

Referenced by printInitializationInfo(), Stepper(), and Stepper().

◆ stepperList

Teuchos::RCP<Teuchos::ParameterList> LOCA::Stepper::stepperList
protected

◆ stepSize

double LOCA::Stepper::stepSize
protected

Current step size (change in the continuation parameter), $\Delta \lambda_i $.

Referenced by finish(), preprocess(), printStartStep(), start(), Stepper(), and Stepper().

◆ stepSizeStrategyPtr

Teuchos::RCP<LOCA::StepSize::AbstractStrategy> LOCA::Stepper::stepSizeStrategyPtr
protected

Step size control strategy.

Referenced by computeStepSize(), printStartStep(), Stepper(), and Stepper().

◆ tangentFactor

double LOCA::Stepper::tangentFactor
protected

Tangent factor.

Referenced by computeStepSize(), postprocess(), Stepper(), and Stepper().

◆ tangentFactorExponent

double LOCA::Stepper::tangentFactorExponent
protected

Tangent factor exponent.

Referenced by computeStepSize(), Stepper(), and Stepper().

◆ targetValue

double LOCA::Stepper::targetValue
protected

Target parameter value for last step (either maxValue or minValue).

Referenced by computeStepSize(), finish(), printStartStep(), Stepper(), Stepper(), stopDeprecated(), and withinThreshold().


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