31#ifndef _CLASSIC_FIELDS_MESH_H_
32#define _CLASSIC_FIELDS_MESH_H_
138 friend bool operator==
140 friend bool operator!=
142 friend bool operator>=
144 friend bool operator<=
146 friend bool operator<
148 friend bool operator>
255 friend bool operator==
257 friend bool operator!=
259 friend bool operator>=
261 friend bool operator<=
263 friend bool operator<
265 friend bool operator>
350#include "Fields/Interpolation/Mesh-inl.icc"
Mesh::Iterator & operator--(Mesh::Iterator &lhs)
Prefix decrement operator –it retreats iterator by one
Mesh::Iterator operator+(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Addition operator - adds offset of rhs of rhs relative to Begin() to lhs.
Mesh::Iterator operator-(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Subtraction operator - subtracts offset of rhs relative to Begin() from lhs.
bool operator<(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Return true if lhs indexes a position less than rhs i.e.
bool operator==(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Return true if lhs indexes the same position as rhs.
bool operator>(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Return true if lhs indexes a position greater than rhs i.e.
bool operator>=(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Return true if lhs indexes a position greater than or equal to rhs i.e.
bool operator!=(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Return true if lhs does not index the same position as rhs.
Mesh::Iterator & operator+=(Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Addition operator - adds offset of rhs of rhs relative to Begin() to lhs and returns lhs.
bool operator<=(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Return true if lhs indexes a position less than or equal to rhs i.e.
std::ostream & operator<<(std::ostream &out, const Mesh::Iterator &it)
Output iterator to a std ostream object.
Mesh::Iterator & operator++(Mesh::Iterator &lhs)
Prefix increment operator ++it.
Mesh::Iterator & operator-=(Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Subtraction operator - subtracts offset of rhs relative to Begin() from lhs and returns lhs.
Base class for meshing routines.
virtual Mesh::Iterator & addOne(Mesh::Iterator &lhs) const =0
Increment position of lhs by one and then return lhs.
virtual void getPosition(const Mesh::Iterator &it, double *position) const =0
Return the position of a point in the mesh.
friend Mesh::Iterator & operator++(Mesh::Iterator &lhs)
Prefix increment operator ++it.
virtual ~Mesh()
Destructor - does nothing.
virtual Mesh::Iterator & subEquals(Mesh::Iterator &lhs, const Mesh::Iterator &rhs) const =0
Subtract difference from lhs and then return lhs.
virtual Mesh::Iterator & addEquals(Mesh::Iterator &lhs, int difference) const =0
Add difference to lhs and then return lhs.
virtual Mesh::Iterator & subOne(Mesh::Iterator &lhs) const =0
Decrement position of lhs by one and then return lhs.
virtual int getPositionDimension() const =0
Return the dimension of the mesh.
friend Mesh::Iterator & operator--(Mesh::Iterator &lhs)
Prefix decrement operator –it retreats iterator by one
virtual Mesh * dual() const =0
Return the "Dual" of the mesh or nullptr if not implemented.
virtual Mesh::Iterator & subEquals(Mesh::Iterator &lhs, int difference) const =0
Subtract difference from lhs and then return lhs.
friend Mesh::Iterator operator--(Mesh::Iterator &lhs, int)
Postfix decrement operator it– retreats iterator by one.
virtual bool isGreater(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs) const =0
Return true if rhs is greater than lhs.
virtual Mesh::Iterator getNearest(const double *position) const =0
Find the point on the mesh nearest to given point.
virtual Mesh::Iterator end() const =0
Return the last+1 point on the mesh.
virtual Mesh::Iterator & addEquals(Mesh::Iterator &lhs, const Mesh::Iterator &rhs) const =0
Add difference to lhs and then return lhs.
virtual Mesh::Iterator begin() const =0
Return the first point on the mesh.
virtual int toInteger(const Mesh::Iterator &lhs) const =0
Map from iterator to an integer used to index the iterator.
Mesh()
Constructor (does nothing)
virtual Mesh * clone()=0
Return a copy of child object.
friend Mesh::Iterator operator++(Mesh::Iterator &lhs, int)
Postfix increment operator it++ advances iterator by one.
Used to loop over some, or all, points in the mesh, as in stl Enables e.g.
std::vector< int > state_m
virtual ~Iterator()
Destructor.
friend Mesh::Iterator & operator++(Mesh::Iterator &lhs)
Prefix increment operator ++it.
virtual void addState(const Mesh::Iterator &it)
Add the internal state vector of it onto this.
virtual std::vector< double > getPosition() const
Return a vector corresponding to the position referenced by the iterator.
Iterator(const Mesh::Iterator &in)
Shallow copy in.mesh_m.
Iterator()
Default constructor does nothing.
int & operator[](int i)
Return the ith element of the iterator state vector.
virtual void getPosition(double *point) const
Return the position referenced by the iterator;.
virtual bool isOutOfBounds() const
Return true if the iterator is off the edge of the mesh.
friend Mesh::Iterator & operator--(Mesh::Iterator &lhs)
Prefix decrement operator –it retreats iterator by one
Iterator(std::vector< int > state, const Mesh *mesh)
Constructor initialising internal state and mesh.
const int & operator[](int i) const
Return the ith element of the iterator state vector.
friend Mesh::Iterator operator--(Mesh::Iterator &lhs, int)
Postfix decrement operator it– retreats iterator by one.
int toInteger() const
Return an integer representation of the iterator.
std::vector< int > getState() const
Return the internal state of the iterator.
const Mesh::Iterator & operator=(const Mesh::Iterator &rhs)
Shallow copy rhs into this.
const Mesh * getMesh() const
Return the mesh over which the iterator acts.
friend Mesh::Iterator operator++(Mesh::Iterator &lhs, int)
Postfix increment operator it++ advances iterator by one.
NDGrid holds grid information for a rectilinear grid in some arbitrary dimensional space.
ThreeDGrid holds grid information for a rectangular grid used in e.g.