dune-grid 2.9.0
Public Member Functions | Protected Attributes | List of all members
Dune::YGridComponent< Coordinates >::Iterator Class Reference

#include <dune/grid/yaspgrid/ygrid.hh>

Public Member Functions

 Iterator ()=default
 
 Iterator (const YGridComponent< Coordinates > &r)
 Make iterator pointing to first cell in a grid. More...
 
 Iterator (const YGridComponent< Coordinates > &r, const iTupel &coord)
 Make iterator pointing to given cell in a grid. More...
 
void reinit (const YGridComponent< Coordinates > &r, const iTupel &coord)
 reinitialize iterator to given position More...
 
bool operator== (const Iterator &i) const
 Return true when two iterators over the same grid are equal (!). More...
 
bool operator!= (const Iterator &i) const
 Return true when two iterators over the same grid are not equal (!). More...
 
int superindex () const
 Return consecutive index in enclosing grid. More...
 
int coord (int i) const
 Return coordinate of the cell in direction i. More...
 
const iTupelcoord () const
 Return coordinate of the cell as reference (do not modify). More...
 
void move (int i, int dist)
 move this iterator dist cells in direction i More...
 
void move (const iTupel &dist)
 move this iterator dist cells in direction i More...
 
Iteratoroperator++ ()
 Increment iterator to next cell with position. More...
 
ct lowerleft (int i) const
 Return ith component of lower left corner of the entity associated with the current coordinates and shift. More...
 
fTupel lowerleft () const
 Return lower left corner of the entity associated with the current coordinates and shift. More...
 
ct upperright (int i) const
 Return ith component of upper right corder of the entity associated with the current coordinates and shift. More...
 
fTupel upperright () const
 Return upper right corder of the entity associated with the current coordinates and shift. More...
 
ct meshsize (int i) const
 Return meshsize in direction i. More...
 
fTupel meshsize () const
 Return meshsize of current cell as reference. More...
 
bool shift (int i) const
 
std::bitset< dshift () const
 
Coordinates * coordCont () const
 

Protected Attributes

iTupel _coord
 current position in index set More...
 
int _superindex = 0
 consecutive index in enclosing grid More...
 
const YGridComponent< Coordinates > * _grid = nullptr
 

Detailed Description

template<class Coordinates>
class Dune::YGridComponent< Coordinates >::Iterator

Iterator class allows one to run over all cells of a grid. The cells of the grid to iterate over are numbered consecutively starting with zero. Via the index() method the iterator provides a mapping of the cells of the grid to a one-dimensional array. The number of entries in this array must be the size of the grid.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<class Coordinates >
Dune::YGridComponent< Coordinates >::Iterator::Iterator ( )
default

◆ Iterator() [2/3]

template<class Coordinates >
Dune::YGridComponent< Coordinates >::Iterator::Iterator ( const YGridComponent< Coordinates > &  r)
inline

Make iterator pointing to first cell in a grid.

◆ Iterator() [3/3]

template<class Coordinates >
Dune::YGridComponent< Coordinates >::Iterator::Iterator ( const YGridComponent< Coordinates > &  r,
const iTupel coord 
)
inline

Make iterator pointing to given cell in a grid.

Member Function Documentation

◆ coord() [1/2]

template<class Coordinates >
const iTupel & Dune::YGridComponent< Coordinates >::Iterator::coord ( ) const
inline

Return coordinate of the cell as reference (do not modify).

◆ coord() [2/2]

template<class Coordinates >
int Dune::YGridComponent< Coordinates >::Iterator::coord ( int  i) const
inline

Return coordinate of the cell in direction i.

◆ coordCont()

template<class Coordinates >
Coordinates * Dune::YGridComponent< Coordinates >::Iterator::coordCont ( ) const
inline

◆ lowerleft() [1/2]

template<class Coordinates >
fTupel Dune::YGridComponent< Coordinates >::Iterator::lowerleft ( ) const
inline

Return lower left corner of the entity associated with the current coordinates and shift.

◆ lowerleft() [2/2]

template<class Coordinates >
ct Dune::YGridComponent< Coordinates >::Iterator::lowerleft ( int  i) const
inline

Return ith component of lower left corner of the entity associated with the current coordinates and shift.

◆ meshsize() [1/2]

template<class Coordinates >
fTupel Dune::YGridComponent< Coordinates >::Iterator::meshsize ( ) const
inline

Return meshsize of current cell as reference.

◆ meshsize() [2/2]

template<class Coordinates >
ct Dune::YGridComponent< Coordinates >::Iterator::meshsize ( int  i) const
inline

Return meshsize in direction i.

◆ move() [1/2]

template<class Coordinates >
void Dune::YGridComponent< Coordinates >::Iterator::move ( const iTupel dist)
inline

move this iterator dist cells in direction i

◆ move() [2/2]

template<class Coordinates >
void Dune::YGridComponent< Coordinates >::Iterator::move ( int  i,
int  dist 
)
inline

move this iterator dist cells in direction i

◆ operator!=()

template<class Coordinates >
bool Dune::YGridComponent< Coordinates >::Iterator::operator!= ( const Iterator i) const
inline

Return true when two iterators over the same grid are not equal (!).

◆ operator++()

template<class Coordinates >
Iterator & Dune::YGridComponent< Coordinates >::Iterator::operator++ ( )
inline

Increment iterator to next cell with position.

◆ operator==()

template<class Coordinates >
bool Dune::YGridComponent< Coordinates >::Iterator::operator== ( const Iterator i) const
inline

Return true when two iterators over the same grid are equal (!).

◆ reinit()

template<class Coordinates >
void Dune::YGridComponent< Coordinates >::Iterator::reinit ( const YGridComponent< Coordinates > &  r,
const iTupel coord 
)
inline

reinitialize iterator to given position

◆ shift() [1/2]

template<class Coordinates >
std::bitset< d > Dune::YGridComponent< Coordinates >::Iterator::shift ( ) const
inline

◆ shift() [2/2]

template<class Coordinates >
bool Dune::YGridComponent< Coordinates >::Iterator::shift ( int  i) const
inline

◆ superindex()

template<class Coordinates >
int Dune::YGridComponent< Coordinates >::Iterator::superindex ( ) const
inline

Return consecutive index in enclosing grid.

◆ upperright() [1/2]

template<class Coordinates >
fTupel Dune::YGridComponent< Coordinates >::Iterator::upperright ( ) const
inline

Return upper right corder of the entity associated with the current coordinates and shift.

◆ upperright() [2/2]

template<class Coordinates >
ct Dune::YGridComponent< Coordinates >::Iterator::upperright ( int  i) const
inline

Return ith component of upper right corder of the entity associated with the current coordinates and shift.

Member Data Documentation

◆ _coord

template<class Coordinates >
iTupel Dune::YGridComponent< Coordinates >::Iterator::_coord
protected

current position in index set

◆ _grid

template<class Coordinates >
const YGridComponent<Coordinates>* Dune::YGridComponent< Coordinates >::Iterator::_grid = nullptr
protected

◆ _superindex

template<class Coordinates >
int Dune::YGridComponent< Coordinates >::Iterator::_superindex = 0
protected

consecutive index in enclosing grid


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