OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <Mesh.h>
Public Member Functions | |
Iterator () | |
Iterator (const Mesh::Iterator &in) | |
Iterator (std::vector< int > state, const Mesh *mesh) | |
virtual | ~Iterator () |
const Mesh::Iterator & | operator= (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 Mesh * | getMesh () const |
virtual bool | isOutOfBounds () const |
virtual void | addState (const Mesh::Iterator &it) |
Private Attributes | |
const Mesh * | mesh_m |
std::vector< int > | state_m |
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.
|
inline |
Default constructor does nothing
|
inline |
Shallow copy in.mesh_m
|
inline |
Constructor initialising internal state and mesh
state | integer corresponding to internal state |
mesh | mesh over which the iterator acts - Iterator borrows reference to mesh (is only valid while mesh pointer is valid) |
|
inlinevirtual |
Destructor
|
inlinevirtual |
Add the internal state vector of it onto this
|
inline |
Return the mesh over which the iterator acts
Referenced by interpolation::PPSolveFactory::getDerivs(), and interpolation::PPSolveFactory::outOfBoundsPosition().
|
inlinevirtual |
Return a vector corresponding to the position referenced by the iterator
vector will be of length corresponding to mesh PointDimension()
|
inlinevirtual |
Return the position referenced by the iterator;
Point should be initialised to the PositionDimension() of the mesh
Referenced by interpolation::PolynomialPatch::function(), interpolation::VectorMap::function(), interpolation::PPSolveFactory::getDerivs(), interpolation::operator<<(), and interpolation::PPSolveFactory::outOfBoundsPosition().
|
inline |
Return the internal state of the iterator
Referenced by interpolation::PPSolveFactory::getDerivs(), interpolation::NDGrid::getPosition(), interpolation::PPSolveFactory::getValues(), interpolation::operator<<(), interpolation::PPSolveFactory::outOfBoundsPosition(), and interpolation::ThreeDGrid::toInteger().
|
inlinevirtual |
Return true if the iterator is off the edge of the mesh
|
inline |
Shallow copy rhs into this
|
inline |
Return the ith element of the iterator state vector
|
inline |
Return the ith element of the iterator state vector
|
inline |
Return an integer representation of the iterator
mesh->Begin() should return an iterator whose integer representation is 0. Iterator++ should return an iterator whose integer representation is one higher - i.e. integer representation and iterator should behave in the same way
Referenced by interpolation::NDGrid::addEquals(), interpolation::ThreeDGrid::addEquals(), interpolation::PolynomialPatch::function(), interpolation::PPSolveFactory::getDerivs(), interpolation::PolynomialPatch::getPolynomialVector(), interpolation::PPSolveFactory::getValues(), interpolation::operator<<(), interpolation::PPSolveFactory::PPSolveFactory(), interpolation::PPSolveFactory::solve(), interpolation::NDGrid::subEquals(), interpolation::ThreeDGrid::subEquals(), DumpFields::writeFieldThis(), and DumpEMFields::writeHeader().
|
friend |
Return true if lhs does not index the same position as rhs
|
friend |
Addition operator - adds rhs to lhs and returns copy of lhs
|
friend |
Addition operator - adds offset of rhs of rhs relative to Begin() to lhs
|
friend |
Prefix increment operator ++it
|
friend |
Postfix increment operator it++ advances iterator by one
|
friend |
Addition operator - subtracts rhs from lhs and returns lhs
|
friend |
Addition operator - adds offset of rhs of rhs relative to Begin() to lhs and returns lhs
|
friend |
Subtraction operator - subtracts from lhs and returns copy of lhs
|
friend |
Subtraction operator - subtracts offset of rhs relative to Begin() from lhs
|
friend |
Prefix decrement operator –it retreats iterator by one
|
friend |
Postfix decrement operator it– retreats iterator by one
|
friend |
Subtraction operator - subtracts rhs from lhs and returns lhs
|
friend |
Subtraction operator - subtracts offset of rhs relative to Begin() from lhs and returns lhs
|
friend |
Return true if lhs indexes a position less than rhs i.e. successive operation of decrement operator would eventually reach lhs
|
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
|
friend |
Return true if lhs indexes the same position as rhs
|
friend |
Return true if lhs indexes a position greater than rhs i.e. successive operation of increment operator would eventually reach lhs
|
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 |
|
private |
Definition at line 270 of file Mesh.h.
Referenced by interpolation::NDGrid::addEquals(), interpolation::ThreeDGrid::addEquals(), interpolation::ThreeDGrid::addOne(), interpolation::ThreeDGrid::getPosition(), interpolation::NDGrid::isGreater(), interpolation::ThreeDGrid::isGreater(), interpolation::NDGrid::subEquals(), interpolation::ThreeDGrid::subEquals(), interpolation::NDGrid::subOne(), interpolation::ThreeDGrid::subOne(), and interpolation::NDGrid::toInteger().