Dune::SubYGrid< d, ct >::SubIterator Class Reference

#include <grids.hh>

Inheritance diagram for Dune::SubYGrid< d, ct >::SubIterator:

Dune::YGrid< d, ct >::Iterator Dune::SubYGrid< d, ct >::TransformingSubIterator List of all members.

Detailed Description

template<int d, typename ct>
class Dune::SubYGrid< d, ct >::SubIterator

SubIterator is an Iterator that provides in addition the consecutive index in the enclosing grid.


Public Member Functions

 SubIterator (const SubYGrid< d, ct > &r)
 Make iterator pointing to first cell in subgrid.
 SubIterator (const SubYGrid< d, ct > &r, const iTupel &coord)
 Make iterator pointing to given cell in subgrid.
 SubIterator (const typename YGrid< d, ct >::Iterator &i)
 Make transforming iterator from iterator (used for automatic conversion of end).
void reinit (const SubYGrid< d, ct > &r, const iTupel &coord)
 Make iterator pointing to given cell in subgrid.
int superindex () const
 Return consecutive index in enclosing grid.
int superneighbor (int i, int dist) const
 Get index of cell which is dist cells away in direction i in enclosing grid.
int superdown (int i) const
 Get index of neighboring cell which is -1 away in direction i in enclosing grid.
int superup (int i) const
 Get index of neighboring cell which is +1 away in direction i in enclosing grid.
void move (int i, int dist)
 move this iterator dist cells in direction i
SubIteratoroperator++ ()
 Increment iterator to next cell in subgrid.
void print (std::ostream &s) const
 Print position of iterator.
void reinit (const YGrid< d, ct > &r, const iTupel &coord)
 reinitialize iterator to given position
bool operator== (const Iterator &i) const
 Return true when two iterators over the same grid are equal (!).
bool operator!= (const Iterator &i) const
 Return true when two iterators over the same grid are not equal (!).
int index () const
 Return index of the current cell in the consecutive numbering.
int coord (int i) const
 Return coordinate of the cell in direction i.
const iTupelcoord () const
 Return coordinate of the cell as reference (do not modify).
int neighbor (int i, int dist) const
 Get index of cell which is dist cells away in direction i.
int down (int i) const
 Get index of neighboring cell which is -1 away in direction i.
int up (int i) const
 Get index of neighboring cell which is +1 away in direction i.

Protected Attributes

int _superindex
 consecutive index in enclosing grid
iTupel _superincrement
 moves consecutive index by one in this direction in supergrid
iTupel _size
 size of subgrid

Constructor & Destructor Documentation

template<int d, typename ct>
Dune::SubYGrid< d, ct >::SubIterator::SubIterator ( const SubYGrid< d, ct > &  r  )  [inline]

Make iterator pointing to first cell in subgrid.

store some grid information

template<int d, typename ct>
Dune::SubYGrid< d, ct >::SubIterator::SubIterator ( const SubYGrid< d, ct > &  r,
const iTupel coord 
) [inline]

Make iterator pointing to given cell in subgrid.

store some grid information


Member Function Documentation

template<int d, typename ct>
void Dune::SubYGrid< d, ct >::SubIterator::reinit ( const SubYGrid< d, ct > &  r,
const iTupel coord 
) [inline]

Make iterator pointing to given cell in subgrid.

store some grid information

Reimplemented in Dune::SubYGrid< d, ct >::TransformingSubIterator.


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

Generated on 12 Dec 2007 with Doxygen (ver 1.5.1)