NOX  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LOCA::Abstract::Iterator Class Referenceabstract

An abstract interface for implementing iteration. More...

#include <LOCA_Abstract_Iterator.H>

Inheritance diagram for LOCA::Abstract::Iterator:
Inheritance graph
[legend]

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

 Iterator ()
 Constructor.
 
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.

Enumerator
LastIteration 

This is the last iteration.

Finished 

The iterator is finished.

Failed 

The iterator has failed.

NotFinished 

The iterator is not finished.

Enumerated type for status of each step of iterator.

Enumerator
Successful 

The last step was successful.

Unsuccessful 

The last step was unsuccessful.

Provisional 

One more unsuccessful step means failure.


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