OPAL (Object Oriented Parallel Accelerator Library)
2024.1
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
Definition at line 40 of file Mesh-inl.icc.
|
inline |
Shallow copy in.mesh_m
Definition at line 43 of file Mesh-inl.icc.
|
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) |
Definition at line 47 of file Mesh-inl.icc.
|
inlinevirtual |
Destructor
Definition at line 51 of file Mesh-inl.icc.
|
inlinevirtual |
Add the internal state vector of it onto this
Definition at line 198 of file Mesh-inl.icc.
References state_m.
|
inline |
Return the mesh over which the iterator acts
Definition at line 70 of file Mesh-inl.icc.
Referenced by interpolation::PPSolveFactory::getDerivs(), and interpolation::PPSolveFactory::outOfBoundsPosition().
|
inlinevirtual |
Return the position referenced by the iterator;
Point should be initialised to the PositionDimension() of the mesh
Definition at line 80 of file Mesh-inl.icc.
Referenced by interpolation::VectorMap::function(), interpolation::PolynomialPatch::function(), interpolation::PPSolveFactory::getDerivs(), interpolation::operator<<(), 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()
Definition at line 84 of file Mesh-inl.icc.
|
inline |
Return the internal state of the iterator
Definition at line 58 of file Mesh-inl.icc.
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
Definition at line 184 of file Mesh-inl.icc.
|
inline |
Shallow copy rhs into this
Definition at line 74 of file Mesh-inl.icc.
|
inline |
Return the ith element of the iterator state vector
Definition at line 62 of file Mesh-inl.icc.
|
inline |
Return the ith element of the iterator state vector
Definition at line 66 of file Mesh-inl.icc.
|
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
Definition at line 54 of file Mesh-inl.icc.
Referenced by interpolation::NDGrid::addEquals(), interpolation::ThreeDGrid::addEquals(), interpolation::PolynomialPatch::function(), interpolation::PPSolveFactory::getDerivs(), interpolation::PolynomialPatch::getPolynomialVector(), interpolation::PPSolveFactory::getValues(), interpolation::operator<<(), interpolation::PolynomialPatch::PolynomialPatch(), 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
Definition at line 178 of file Mesh-inl.icc.
|
friend |
Addition operator - adds rhs to lhs and returns copy of lhs
Definition at line 130 of file Mesh-inl.icc.
|
friend |
Addition operator - adds offset of rhs of rhs relative to Begin() to lhs
Definition at line 124 of file Mesh-inl.icc.
|
friend |
Postfix increment operator it++ advances iterator by one
Definition at line 98 of file Mesh-inl.icc.
|
friend |
Prefix increment operator ++it
Definition at line 90 of file Mesh-inl.icc.
|
friend |
Addition operator - subtracts rhs from lhs and returns lhs
Definition at line 145 of file Mesh-inl.icc.
|
friend |
Addition operator - adds offset of rhs of rhs relative to Begin() to lhs and returns lhs
Definition at line 137 of file Mesh-inl.icc.
|
friend |
Subtraction operator - subtracts from lhs and returns copy of lhs
Definition at line 117 of file Mesh-inl.icc.
|
friend |
Subtraction operator - subtracts offset of rhs relative to Begin() from lhs
Definition at line 111 of file Mesh-inl.icc.
|
friend |
Postfix decrement operator it– retreats iterator by one
Definition at line 104 of file Mesh-inl.icc.
|
friend |
Prefix decrement operator –it retreats iterator by one
Definition at line 94 of file Mesh-inl.icc.
|
friend |
Subtraction operator - subtracts rhs from lhs and returns lhs
Definition at line 149 of file Mesh-inl.icc.
|
friend |
Subtraction operator - subtracts offset of rhs relative to Begin() from lhs and returns lhs
Definition at line 141 of file Mesh-inl.icc.
|
friend |
Return true if lhs indexes a position less than rhs i.e. successive operation of decrement operator would eventually reach lhs
Definition at line 168 of file Mesh-inl.icc.
|
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
Definition at line 159 of file Mesh-inl.icc.
|
friend |
Return true if lhs indexes the same position as rhs
Definition at line 172 of file Mesh-inl.icc.
|
friend |
Return true if lhs indexes a position greater than rhs i.e. successive operation of increment operator would eventually reach lhs
Definition at line 164 of file Mesh-inl.icc.
|
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
Definition at line 154 of file Mesh-inl.icc.
|
friend |
|
private |
Definition at line 269 of file Mesh.h.
Referenced by interpolation::operator!=(), interpolation::operator+(), interpolation::operator++(), interpolation::operator+=(), interpolation::operator-(), interpolation::operator--(), interpolation::operator-=(), interpolation::operator<=(), operator=(), and interpolation::operator>=().
|
private |
Definition at line 270 of file Mesh.h.
Referenced by interpolation::NDGrid::addEquals(), interpolation::ThreeDGrid::addEquals(), interpolation::ThreeDGrid::addOne(), addState(), interpolation::ThreeDGrid::getPosition(), interpolation::NDGrid::isGreater(), interpolation::ThreeDGrid::isGreater(), interpolation::operator!=(), operator=(), interpolation::operator==(), interpolation::NDGrid::subEquals(), interpolation::ThreeDGrid::subEquals(), interpolation::NDGrid::subOne(), interpolation::ThreeDGrid::subOne(), and interpolation::NDGrid::toInteger().