NOX Development
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
LOCA::Abstract::Iterator Class Reference

An abstract interface for implementing iteration. More...

#include <LOCA_Abstract_Iterator.H>

Inheritance diagram for LOCA::Abstract::Iterator:
Inheritance graph

List of all members.

Public Types

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...

Public Member Functions

 Iterator (Teuchos::ParameterList &p)
 Iterator (const Iterator &it)
 Copy Constructor.
virtual ~Iterator ()
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

 Iterator ()
virtual IteratorStatus iterate ()
 Perform iteration.
virtual IteratorStatus stop (StepStatus)
 Check stopping criteria.
virtual IteratorStatus start ()=0
 Intialize iterator.
virtual IteratorStatus finish (IteratorStatus)=0
 Finalize iterator.
virtual StepStatus preprocess (StepStatus)=0
 Preprocess step.
virtual StepStatus compute (StepStatus)=0
 Compute step.
virtual StepStatus postprocess (StepStatus)=0
 Postprocess step.
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

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.

Detailed Description

An abstract interface for implementing iteration.

The LOCA::Abstract::Iterator defines an interface for implementing many kinds of iterative processes. In LOCA, this is used to implement the Stepper which computes points along a continuation curve.

Many iterative processes can be abstracted in the following manner:

The run method of the iterator implements this iterative process with start, finish, preprocess, compute and postprocess left as pure virtual methods to be implemented for the specific iterative process.

The iterator has one parameter, "Max Steps" (default 100) giving the maximum number of steps the iterator should take. The default implementation of stop only stops the iterator when this maximum number of steps has been reached.

Member Enumeration Documentation

Enumerated type for status of the iterator.


This is the last iteration.


The iterator is finished.


The iterator has failed.


The iterator is not finished.

Enumerated type for status of each step of iterator.


The last step was successful.


The last step was unsuccessful.


One more unsuccessful step means failure.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends