OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Attributes | Friends | List of all members
interpolation::Mesh::Iterator Class Reference

#include <Mesh.h>

Collaboration diagram for interpolation::Mesh::Iterator:
Collaboration graph
[legend]

Public Member Functions

 Iterator ()
 
 Iterator (const Mesh::Iterator &in)
 
 Iterator (std::vector< int > state, const Mesh *mesh)
 
virtual ~Iterator ()
 
const Mesh::Iteratoroperator= (const Mesh::Iterator &rhs)
 
virtual void getPosition (double *point) const
 
virtual std::vector< double > getPosition () const
 
int toInteger () const
 
std::vector< int > getState () const
 
int & operator[] (int i)
 
const int & operator[] (int i) const
 
const MeshgetMesh () const
 

Private Attributes

const Meshmesh_m
 
std::vector< int > state_m
 

Friends

class Mesh
 
class TwoDGrid
 
class ThreeDGrid
 
class NDGrid
 
class TriangularMesh
 
Mesh::Iterator operator++ (Mesh::Iterator &lhs, int)
 
Mesh::Iterator operator-- (Mesh::Iterator &lhs, int)
 
Mesh::Iteratoroperator++ (Mesh::Iterator &lhs)
 
Mesh::Iteratoroperator-- (Mesh::Iterator &lhs)
 
Mesh::Iterator operator- (const Mesh::Iterator &lhs, const int &difference)
 
Mesh::Iterator operator+ (const Mesh::Iterator &lhs, const int &difference)
 
Mesh::Iteratoroperator-= (Mesh::Iterator &lhs, const int &difference)
 
Mesh::Iteratoroperator+= (Mesh::Iterator &lhs, const int &difference)
 
Mesh::Iterator operator- (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
Mesh::Iterator operator+ (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
Mesh::Iteratoroperator-= (Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
Mesh::Iteratoroperator+= (Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
bool operator== (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
bool operator!= (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
bool operator>= (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
bool operator<= (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
bool operator< (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 
bool operator> (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 

Detailed Description

Used to loop over some, or all, points in the mesh, as in stl Enables e.g. generic file I/O operations on a field map without knowing the details of what is in the mesh or what shape it has.

Define standard operators (increment, decrement, booleans, etc) and conversion to integer.

Iterator generalises internal state to a stl vector of integers and a pointer to the mesh over which we iterate. Meaning of integers is mesh- dependent, but prefer convention that left-most index state[0] is most significant index and right-most index state[n] is least significant index i.e. it+1 increments state[n] by 1 first. Convention is chosen to reflect arabic numerals where right-most index is least significant.

Definition at line 169 of file Mesh.h.

Constructor & Destructor Documentation

interpolation::Mesh::Iterator::Iterator ( )
inline

Default constructor does nothing

interpolation::Mesh::Iterator::Iterator ( const Mesh::Iterator in)
inline

Shallow copy in.mesh_m

interpolation::Mesh::Iterator::Iterator ( std::vector< int >  state,
const Mesh mesh 
)
inline

Constructor initialising internal state and mesh

Parameters
stateinteger corresponding to internal state
meshmesh over which the iterator acts - Iterator borrows reference to mesh (is only valid while mesh pointer is valid)
virtual interpolation::Mesh::Iterator::~Iterator ( )
inlinevirtual

Destructor

Member Function Documentation

const Mesh* interpolation::Mesh::Iterator::getMesh ( ) const
inline

Return the mesh over which the iterator acts

Referenced by interpolation::PPSolveFactory::getDerivs(), and interpolation::PPSolveFactory::outOfBoundsPosition().

virtual void interpolation::Mesh::Iterator::getPosition ( double *  point) const
inlinevirtual

Return the position referenced by the iterator;

Point should be initialised to the PositionDimension() of the mesh

Referenced by interpolation::VectorMap::function(), interpolation::PolynomialPatch::function(), interpolation::PPSolveFactory::getDerivs(), interpolation::operator<<(), and interpolation::PPSolveFactory::outOfBoundsPosition().

virtual std::vector<double> interpolation::Mesh::Iterator::getPosition ( ) const
inlinevirtual

Return a vector corresponding to the position referenced by the iterator

vector will be of length corresponding to mesh PointDimension()

std::vector<int> interpolation::Mesh::Iterator::getState ( ) const
inline
const Mesh::Iterator& interpolation::Mesh::Iterator::operator= ( const Mesh::Iterator rhs)
inline

Shallow copy rhs into this

int& interpolation::Mesh::Iterator::operator[] ( int  i)
inline

Return the ith element of the iterator state vector

const int& interpolation::Mesh::Iterator::operator[] ( int  i) const
inline

Return the ith element of the iterator state vector

int interpolation::Mesh::Iterator::toInteger ( ) const
inline

Friends And Related Function Documentation

friend class Mesh
friend

Definition at line 224 of file Mesh.h.

friend class NDGrid
friend

Definition at line 227 of file Mesh.h.

bool operator!= ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs does not index the same position as rhs

Mesh::Iterator operator+ ( const Mesh::Iterator lhs,
const int &  difference 
)
friend

Addition operator - adds rhs to lhs and returns copy of lhs

Mesh::Iterator operator+ ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Addition operator - adds offset of rhs of rhs relative to Begin() to lhs

Mesh::Iterator operator++ ( Mesh::Iterator lhs,
int   
)
friend

Postfix increment operator it++ advances iterator by one

Mesh::Iterator& operator++ ( Mesh::Iterator lhs)
friend

Prefix increment operator ++it

Mesh::Iterator& operator+= ( Mesh::Iterator lhs,
const int &  difference 
)
friend

Addition operator - subtracts rhs from lhs and returns lhs

Mesh::Iterator& operator+= ( Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Addition operator - adds offset of rhs of rhs relative to Begin() to lhs and returns lhs

Mesh::Iterator operator- ( const Mesh::Iterator lhs,
const int &  difference 
)
friend

Subtraction operator - subtracts from lhs and returns copy of lhs

Mesh::Iterator operator- ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Subtraction operator - subtracts offset of rhs relative to Begin() from lhs

Mesh::Iterator operator-- ( Mesh::Iterator lhs,
int   
)
friend

Postfix decrement operator it– retreats iterator by one

Mesh::Iterator& operator-- ( Mesh::Iterator lhs)
friend

Prefix decrement operator –it retreats iterator by one

Mesh::Iterator& operator-= ( Mesh::Iterator lhs,
const int &  difference 
)
friend

Subtraction operator - subtracts rhs from lhs and returns lhs

Mesh::Iterator& operator-= ( Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Subtraction operator - subtracts offset of rhs relative to Begin() from lhs and returns lhs

bool operator< ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position less than rhs i.e. successive operation of decrement operator would eventually reach lhs

bool operator<= ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position less than or equal to rhs i.e. successive operation of decrement operator would eventually reach lhs

bool operator== ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes the same position as rhs

bool operator> ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position greater than rhs i.e. successive operation of increment operator would eventually reach lhs

bool operator>= ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position greater than or equal to rhs i.e. successive operation of increment operator would eventually reach lhs

friend class ThreeDGrid
friend

Definition at line 226 of file Mesh.h.

friend class TriangularMesh
friend

Definition at line 228 of file Mesh.h.

friend class TwoDGrid
friend

Definition at line 225 of file Mesh.h.

Member Data Documentation

const Mesh* interpolation::Mesh::Iterator::mesh_m
private

Definition at line 265 of file Mesh.h.

std::vector<int> interpolation::Mesh::Iterator::state_m
private

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