DUNE PDELab (2.8)

Dune::YGridComponent< Coordinates > Class Template Reference

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

Classes

class  Iterator
 

Public Member Functions

 YGridComponent ()
 make uninitialized ygrid
 
 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.
 
const iTupel & origin () const
 return reference to origin
 
bool shift (int i) const
 Return shift in direction i.
 
const std::bitset< d > & shift () const
 Return shift tupel.
 
int offset (int i) const
 Return offset to origin of enclosing grid.
 
const iTupel & offset () const
 Return offset to origin of enclosing grid.
 
int supersize (int i) const
 return size of enclosing grid
 
const iTupel & supersize () const
 return size of enclosing grid
 
int size (int i) const
 return size in direction i
 
iTupel size () const
 retrun size
 
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.
 
int max (int i) const
 Return maximum index in direction i.
 
bool empty () const
 Return true if YGrid is empty, i.e. has size 0 in all directions.
 
bool inside (const iTupel &coord) const
 given a coordinate, return true if it is in the grid
 
int index (const iTupel &coord) const
 given a tupel compute its index in the lexicographic numbering
 
YGridComponent< Coordinates > move (iTupel v) const
 return grid moved by the vector v
 
YGridComponent< Coordinates > intersection (const YGridComponent< Coordinates > &r) const
 Return YGridComponent of supergrid of self which is the intersection of self and another YGridComponent.
 
Iterator begin () const
 return iterator to first element of index set
 
Iterator begin (const iTupel &co) const
 return iterator to given element of index set
 
Iterator end () const
 return subiterator to last element of index set
 

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 origin \( o=(o_0,\ldots,o_{d-1}) \in Z^d\),
  • the size \( s=(s_0,\ldots,s_{d-1}) \in Z^d\),
  • The shift \( r=(r_0,\ldots,r_{d-1}) \in R^d\).
  • a coordinate container, that gives the mapping of the index to global coordinates (see coordinates.hh)

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.

Constructor & Destructor Documentation

◆ YGridComponent() [1/3]

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() [2/3]

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

References Dune::YGridComponent< Coordinates >::offset(), and Dune::YGridComponent< Coordinates >::origin().

◆ YGridComponent() [3/3]

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

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)