Dune::YGrid< d, ct > Class Template Reference

#include <grids.hh>

Inheritance diagram for Dune::YGrid< d, ct >:

Dune::SubYGrid< d, ct >

List of all members.


Detailed Description

template<int d, typename ct>
class Dune::YGrid< d, ct >

This is the basis of a parallel implementation of the dune grid interface supporting codim 0 and dim.

You can also use the structured interface and write really fast code.

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 \} \]

togehter with an affine mapping

\[ t : G \to R^d, \ \ \ t(k)_i = k_i h_i + r_i \]

.

Therefore a YGrid is characterized by the following four quantities:

  • The origin $ o=(o_0,\ldots,o_{d-1}) \in Z^d$,
  • the size $ s=(s_0,\ldots,s_{d-1}) \in Z^d$,
  • the mesh width $ h=(h_0,\ldots,h_{d-1}) \in R^d$,
  • The shift $ r=(r_0,\ldots,r_{d-1}) \in R^d$. The shift can be used to interpret the points of a grid as midpoints of cells, faces, edges, etc.

The YGrid can be parametrized by the dimension d and the type to be used for the coordinates.

Here is a graphical illustration of a grid:

grid.png

A YGrid.

A grid can be manipulated either in the origin/size representation or in the min index / max index representation.

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


Public Types

typedef FieldVector< int, d > iTupel
 define types used for arguments

Public Member Functions

virtual ~YGrid ()
 Destructor.
 YGrid ()
 Make an empty YGrid with origin 0.
 YGrid (iTupel o, iTupel s, fTupel h, fTupel r)
 Make YGrid from origin and size arrays.
int origin (int i) const
 Return origin in direction i.
void origin (int i, int oi) const
 Set origin in direction i.
const iTupelorigin () const
 return reference to origin
int size (int i) const
 Return size in direction i.
void size (int i, int si) const
 Set size in direction i.
const iTupelsize () const
 Return reference to size tupel.
int totalsize () const
 Return total size of index set which is the product of all size per direction.
int min (int i) const
 Return minimum index in direction i.
void min (int i, int mi) const
 Set minimum index in direction i.
int max (int i) const
 Return maximum index in direction i.
void max (int i, int mi) const
 Set maximum index in direction i.
const fTupel & meshsize () const
 Return reference to mesh size tupel for read write access.
ct meshsize (int i) const
 Return mesh size in direction i.
void meshsize (int i, int hi) const
 Set mesh size in direction i.
const fTupel & shift () const
 Return shift tupel.
ct shift (int i) const
 Return shift in direction i.
void shift (int i, int ri) const
 Set shift in direction i.
bool empty () const
 Return true if YGrid is empty, i.e. has size 0 in all directions.
int index (const iTupel &coord) const
 given a tupel compute its index in the lexicographic numbering
bool inside (const iTupel &coord) const
 given a coordinate, return true if it is in the grid
virtual SubYGrid< d, ct > intersection (YGrid< d, ct > &r) const
 Return new SubYGrid of self which is the intersection of self and another YGrid.
YGrid< d, ct > move (iTupel v) const
 return grid moved by the vector v
Iterator begin () const
 return iterator to first element of index set
Iterator end () const
 return iterator to one past the last element of index set
TransformingIterator tbegin () const
 return iterator to first element of index set
TransformingIterator tend () const
 return iterator to one past the last element of the grid

Protected Attributes

iTupel _origin
 internal representation uses origin/size
fTupel _h
 mesh size per direction
fTupel _r
 shift per direction

Classes

class  Iterator
class  TransformingIterator

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

Generated on 6 Nov 2008 with Doxygen (ver 1.5.6) [logfile].