dune-grid 2.9.0
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
Dune::YGridComponent< Coordinates > Class Template Reference

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

Classes

class  Iterator
 

Public Types

typedef Coordinates::ctype ct
 
typedef std::array< int, diTupel
 
typedef FieldVector< ct, dfTupel
 

Public Member Functions

 YGridComponent ()
 make uninitialized ygrid More...
 
 YGridComponent (iTupel origin, iTupel size)
 make ygrid without coordinate information More...
 
 YGridComponent (iTupel origin, iTupel size, const YGridComponent< Coordinates > &enclosing)
 make a subgrid by taking coordinates from a larger grid More...
 
 YGridComponent (iTupel origin, std::bitset< d > shift, Coordinates *coords, iTupel size, iTupel offset, iTupel supersize)
 Make YGridComponent by giving all parameters. More...
 
int origin (int i) const
 Return origin in direction i. More...
 
const iTupelorigin () const
 return reference to origin More...
 
bool shift (int i) const
 Return shift in direction i. More...
 
const std::bitset< d > & shift () const
 Return shift tupel. More...
 
Coordinates * getCoords () const
 
int offset (int i) const
 Return offset to origin of enclosing grid. More...
 
const iTupeloffset () const
 Return offset to origin of enclosing grid. More...
 
int supersize (int i) const
 return size of enclosing grid More...
 
const iTupelsupersize () const
 return size of enclosing grid More...
 
int size (int i) const
 return size in direction i More...
 
iTupel size () const
 retrun size More...
 
int totalsize () const
 Return total size of index set which is the product of all size per direction. More...
 
int min (int i) const
 Return minimum index in direction i. More...
 
int max (int i) const
 Return maximum index in direction i. More...
 
bool empty () const
 Return true if YGrid is empty, i.e. has size 0 in all directions. More...
 
bool inside (const iTupel &coord) const
 given a coordinate, return true if it is in the grid More...
 
int index (const iTupel &coord) const
 given a tupel compute its index in the lexicographic numbering More...
 
YGridComponent< Coordinates > move (iTupel v) const
 return grid moved by the vector v More...
 
YGridComponent< Coordinates > intersection (const YGridComponent< Coordinates > &r) const
 Return YGridComponent of supergrid of self which is the intersection of self and another YGridComponent. More...
 
int superindex (iTupel coord) const
 
int superincrement (int i) const
 
Iterator begin () const
 return iterator to first element of index set More...
 
Iterator begin (const iTupel &co) const
 return iterator to given element of index set More...
 
Iterator end () const
 return subiterator to last element of index set More...
 

Static Public Attributes

static const int d = Coordinates::dimension
 

Detailed Description

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

The YGrid considered here describes a finite set $d$-tupels of the form

\[ G = \{ (k_0,\ldots,k_{d-1}) | o_i \leq k_i < o_i+s_i \}  \]

together with an affine mapping.

A YGrid is characterized by the following quantities:

The shift can be used to interpret the points of a grid as midpoints of cells, faces, edges, etc.

Here is a graphical illustration of a grid:

A YGrid.

A YGrid allows to iterate over all its cells with an Iterator class.

A YGrid is always considered as being embedded in a larger grid. This embedding is characterized by an offset and an enclosing grid as shown in the following picture:

The SubYGrid is shown in red, blue is the enclosing grid.

The iterator provides also a mapping to the consecutive index in the enclosing grid.

Note: as of november 2013 there are only YGrid and YGrid::Iterator. These represent the functionality of former SubYGrid and SubYGrid::TransformingSubIterator. All other classes in the hierarchy have not been used.

Member Typedef Documentation

◆ ct

template<class Coordinates >
typedef Coordinates::ctype Dune::YGridComponent< Coordinates >::ct

◆ fTupel

template<class Coordinates >
typedef FieldVector<ct,d> Dune::YGridComponent< Coordinates >::fTupel

◆ iTupel

template<class Coordinates >
typedef std::array<int, d> Dune::YGridComponent< Coordinates >::iTupel

Constructor & Destructor Documentation

◆ YGridComponent() [1/4]

template<class Coordinates >
Dune::YGridComponent< Coordinates >::YGridComponent ( )
inline

make uninitialized ygrid

◆ YGridComponent() [2/4]

template<class Coordinates >
Dune::YGridComponent< Coordinates >::YGridComponent ( iTupel  origin,
iTupel  size 
)
inline

make ygrid without coordinate information

Parameters
originorigin of the grid in global coordinates
sizesize of the grid Such grid has no coordinate information stored but can be used to determine an intersection with a grid with coordinate information. This avoids sending coordinates in the parallel case.

◆ YGridComponent() [3/4]

template<class Coordinates >
Dune::YGridComponent< Coordinates >::YGridComponent ( iTupel  origin,
iTupel  size,
const YGridComponent< Coordinates > &  enclosing 
)
inline

make a subgrid by taking coordinates from a larger grid

Parameters
originorigin of the grid to be constructed
sizesize of the grid to be constructed
enclosingthe grid to take coordinates and shift vector from

◆ YGridComponent() [4/4]

template<class Coordinates >
Dune::YGridComponent< Coordinates >::YGridComponent ( iTupel  origin,
std::bitset< d shift,
Coordinates *  coords,
iTupel  size,
iTupel  offset,
iTupel  supersize 
)
inline

Make YGridComponent by giving all parameters.

Parameters
originthe origin of the grid in global coordinates
shiftthe shift vector
coordsthe coordinate vectors to be used
sizethe size vector
offsetthe offset in the enclosing grid
supersizesize of the enclosing grid

Member Function Documentation

◆ begin() [1/2]

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

return iterator to first element of index set

◆ begin() [2/2]

template<class Coordinates >
Iterator Dune::YGridComponent< Coordinates >::begin ( const iTupel co) const
inline

return iterator to given element of index set

◆ empty()

template<class Coordinates >
bool Dune::YGridComponent< Coordinates >::empty ( ) const
inline

Return true if YGrid is empty, i.e. has size 0 in all directions.

◆ end()

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

return subiterator to last element of index set

◆ getCoords()

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

◆ index()

template<class Coordinates >
int Dune::YGridComponent< Coordinates >::index ( const iTupel coord) const
inline

given a tupel compute its index in the lexicographic numbering

◆ inside()

template<class Coordinates >
bool Dune::YGridComponent< Coordinates >::inside ( const iTupel coord) const
inline

given a coordinate, return true if it is in the grid

◆ intersection()

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

Return YGridComponent of supergrid of self which is the intersection of self and another YGridComponent.

◆ max()

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

Return maximum index in direction i.

◆ min()

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

Return minimum index in direction i.

◆ move()

template<class Coordinates >
YGridComponent< Coordinates > Dune::YGridComponent< Coordinates >::move ( iTupel  v) const
inline

return grid moved by the vector v

◆ offset() [1/2]

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

Return offset to origin of enclosing grid.

◆ offset() [2/2]

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

Return offset to origin of enclosing grid.

◆ origin() [1/2]

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

return reference to origin

◆ origin() [2/2]

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

Return origin in direction i.

◆ shift() [1/2]

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

Return shift tupel.

◆ shift() [2/2]

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

Return shift in direction i.

◆ size() [1/2]

template<class Coordinates >
iTupel Dune::YGridComponent< Coordinates >::size ( ) const
inline

retrun size

◆ size() [2/2]

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

return size in direction i

◆ superincrement()

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

◆ superindex()

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

◆ supersize() [1/2]

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

return size of enclosing grid

◆ supersize() [2/2]

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

return size of enclosing grid

◆ totalsize()

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

Return total size of index set which is the product of all size per direction.

Member Data Documentation

◆ d

template<class Coordinates >
const int Dune::YGridComponent< Coordinates >::d = Coordinates::dimension
static

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