PSCF v1.1
Public Member Functions | List of all members
Pscf::MeshIterator< D > Class Template Reference

Iterator over points in a Mesh<D>. More...

#include <MeshIterator.h>

Public Member Functions

 MeshIterator ()
 Default constructor. More...
 
 MeshIterator (const IntVec< D > &dimensions)
 Constructor. More...
 
void setDimensions (const IntVec< D > &dimensions)
 Set the grid dimensions in all directions. More...
 
void begin ()
 Set iterator to the first point in the mesh. More...
 
void operator++ ()
 Increment iterator to next mesh point. More...
 
bool atEnd () const
 Is this the end (i.e., one past the last point)? More...
 
IntVec< D > position () const
 Get current position in the grid, as integer vector. More...
 
int position (int i) const
 Get component i of the current position vector. More...
 
int rank () const
 Get the rank of current element. More...
 

Detailed Description

template<int D>
class Pscf::MeshIterator< D >

Iterator over points in a Mesh<D>.

A mesh iterator iterates over the points of a mesh, keeping track of both the IntVec<D> position and integer rank of the current point as it goes.

Definition at line 28 of file MeshIterator.h.

Constructor & Destructor Documentation

◆ MeshIterator() [1/2]

template<int D>
Pscf::MeshIterator< D >::MeshIterator

Default constructor.

Definition at line 20 of file MeshIterator.tpp.

◆ MeshIterator() [2/2]

template<int D>
Pscf::MeshIterator< D >::MeshIterator ( const IntVec< D > &  dimensions)

Constructor.

Parameters
dimensionsIntVec<D> of grid dimensions

Definition at line 31 of file MeshIterator.tpp.

References Pscf::MeshIterator< D >::setDimensions().

Member Function Documentation

◆ setDimensions()

template<int D>
void Pscf::MeshIterator< D >::setDimensions ( const IntVec< D > &  dimensions)

Set the grid dimensions in all directions.

Parameters
dimensionsIntVec<D> of grid dimensions.

Definition at line 42 of file MeshIterator.tpp.

References UTIL_THROW.

Referenced by Pscf::MeshIterator< D >::MeshIterator().

◆ begin()

template<int D>
void Pscf::MeshIterator< D >::begin

◆ operator++()

template<int D>
void Pscf::MeshIterator< D >::operator++
inline

Increment iterator to next mesh point.

Definition at line 76 of file MeshIterator.tpp.

◆ atEnd()

template<int D>
bool Pscf::MeshIterator< D >::atEnd
inline

◆ position() [1/2]

template<int D>
IntVec< D > Pscf::MeshIterator< D >::position
inline

Get current position in the grid, as integer vector.

Definition at line 122 of file MeshIterator.h.

Referenced by Pscf::Pspg::WaveList< D >::computeMinimumImages(), and Pscf::Basis< D >::isValid().

◆ position() [2/2]

template<int D>
int Pscf::MeshIterator< D >::position ( int  i) const
inline

Get component i of the current position vector.

Parameters
iindex of Cartesian direction 0 <=i < D.

Definition at line 127 of file MeshIterator.h.

◆ rank()

template<int D>
int Pscf::MeshIterator< D >::rank
inline

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