Dune::YaspGrid< dim, deprecated_dimworld > Class Template Reference
[Grid Implementations]

#include <yaspgrid.hh>

Inheritance diagram for Dune::YaspGrid< dim, deprecated_dimworld >:

Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily > Dune::Grid< dim, dimworld, ct, GridFamily >

List of all members.


Detailed Description

template<int dim, int deprecated_dimworld = dim>
class Dune::YaspGrid< dim, deprecated_dimworld >

[ provides Dune::Grid ]

Provides a distributed structured cube mesh.

YaspGrid stands for yet another structured parallel grid. It implements the dune grid interface for structured grids with codim 0 and dim, with arbitrary overlap (including zero), periodic boundaries and fast implementation allowing on-the-fly computations.

Deprecated:
The second template parameter is deprecated.
History:
  • started on July 31, 2004 by PB based on abstractions developed in summer 2003

Public Types

enum  
 maximum number of levels allowed
typedef yaspgrid_ctype ctype
 define type used for coordinates in grid module
typedef YaspGridFamily< dim, dim > GridFamily
 the GridFamily of this grid
typedef YaspGridFamily< dim,
dim >::Traits 
Traits
 The traits of this class.
typedef MultiYGrid< dim, ctypeYMG
 shorthand for base class data types
Exported constants
enum  { dimension = dim }
 A constant that exports the template parameter dim. More...
enum  { dimensionworld = dimworld }
 A constant that exports the template parameter dimworld. More...
Exported types
typedef Partition
< All_Partition >
::LevelGridView 
LevelGridView
 View types for All_Partition.
typedef Partition
< All_Partition >
::LeafGridView 
LeafGridView

Public Member Functions

std::string name () const
 return the name of this Grid
 YaspGrid (MPI_Comm comm, Dune::FieldVector< ctype, dim > L, Dune::FieldVector< int, dim > s, Dune::FieldVector< bool, dim > periodic, int overlap)
 YaspGrid (Dune::FieldVector< ctype, dim > L, Dune::FieldVector< int, dim > s, Dune::FieldVector< bool, dim > periodic, int overlap)
int maxLevel () const
void globalRefine (int refCount)
 refine the grid refCount times. What about overlap?
void refine (bool b)
 refine the grid refCount times. What about overlap?
bool adapt ()
 map adapt to global refine
template<int cd, PartitionIteratorType pitype>
Traits::template Codim< cd >
::template Partition< pitype >
::LevelIterator 
lbegin (int level) const
 one past the end on this level
template<int cd, PartitionIteratorType pitype>
Traits::template Codim< cd >
::template Partition< pitype >
::LevelIterator 
lend (int level) const
 Iterator to one past the last entity of given codim on level for partition type.
template<int cd>
Traits::template Codim< cd >
::template Partition
< All_Partition >
::LevelIterator 
lbegin (int level) const
 version without second template parameter for convenience
template<int cd>
Traits::template Codim< cd >
::template Partition
< All_Partition >
::LevelIterator 
lend (int level) const
 version without second template parameter for convenience
template<int cd, PartitionIteratorType pitype>
Traits::template Codim< cd >
::template Partition< pitype >
::LeafIterator 
leafbegin () const
 return LeafIterator which points to the first entity in maxLevel
template<int cd, PartitionIteratorType pitype>
Traits::template Codim< cd >
::template Partition< pitype >
::LeafIterator 
leafend () const
 return LeafIterator which points behind the last entity in maxLevel
template<int cd>
Traits::template Codim< cd >
::template Partition
< All_Partition >
::LeafIterator 
leafbegin () const
 return LeafIterator which points to the first entity in maxLevel
template<int cd>
Traits::template Codim< cd >
::template Partition
< All_Partition >
::LeafIterator 
leafend () const
 return LeafIterator which points behind the last entity in maxLevel
int overlapSize (int level, int codim) const
 return size (= distance in graph) of overlap region
int overlapSize (int codim) const
 return size (= distance in graph) of overlap region
int ghostSize (int level, int codim) const
 return size (= distance in graph) of ghost region
int ghostSize (int codim) const
 return size (= distance in graph) of ghost region
int size (int level, int codim) const
 number of entities per level and codim in this process
int size (int codim) const
 number of leaf entities per codim in this process
int size (int level, GeometryType type) const
 number of entities per level and geometry type in this process
int size (GeometryType type) const
 number of leaf entities per geometry type in this process
template<class DataHandleImp, class DataType>
void communicate (CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
template<class DataHandleImp, class DataType>
void communicate (CommDataHandleIF< DataHandleImp, DataType > &data, InterfaceType iftype, CommunicationDirection dir) const
template<class DataHandle, int codim>
void communicateCodim (DataHandle &data, InterfaceType iftype, CommunicationDirection dir, int level) const
const Traits::GlobalIdSetglobalIdSet () const
 return const reference to the grids global id set
const Traits::LocalIdSetlocalIdSet () const
 return const reference to the grids local id set
const Traits::LevelIndexSetlevelIndexSet (int level) const
 return const reference to the grids level index set for level level
const Traits::LeafIndexSetleafIndexSet () const
 return const reference to the grids leaf index set
const CollectiveCommunication
< MPI_Comm > & 
comm () const
 return a collective communication object
template<PartitionIteratorType pitype>
Traits::template Partition
< pitype >::LevelGridView 
levelView (int level) const
 View for a grid level.
Traits::template Partition
< All_Partition >
::LevelGridView 
levelView (int level) const
 View for a grid level for All_Partition.
template<PartitionIteratorType pitype>
Traits::template Partition
< pitype >::LeafGridView 
leafView () const
 View for the leaf grid.
Traits::template Partition
< All_Partition >
::LeafGridView 
leafView () const
 View for the leaf grid for All_Partition.
bool mark (int refCount, const typename Traits::template Codim< 0 >::EntityPointer &e)
 Marks an entity to be refined/coarsened in a subsequent adapt (deprecated).
bool mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt.
int getMark (const typename Traits::template Codim< 0 >::EntityPointer &e) const
 returns adaptation mark for given entity, i.e. here the default implementation returns 0.
int getMark (const typename Traits::template Codim< 0 >::Entity &) const
 returns adaptation mark for given entity, i.e. here the default implementation returns 0.
bool preAdapt ()
 returns true, if at least one entity is marked for adaption
void postAdapt ()
 clean up some markers
template<class DataHandleImp, class DataTypeImp>
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
template<class DataHandleImp, class DataTypeImp>
void communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
bool loadBalance ()
 default implementation of load balance does nothing and returns false
template<class DataHandle>
bool loadBalance (DataHandle &data)
 default implementation of load balance does nothing and returns false
Adaptivity and grid refinement
bool mark (int refCount, const typename Codim< 0 >::EntityPointer &e)
 Marks an entity to be refined/coarsened in a subsequent adapt. (deprecated).
bool mark (int refCount, const typename Codim< 0 >::Entity &e)
 Marks an entity to be refined/coarsened in a subsequent adapt.
int getMark (const typename Codim< 0 >::EntityPointer &e) const
 returns adaptation mark for given entity pointer (deprecated)
int getMark (const typename Codim< 0 >::Entity &e) const
 returns adaptation mark for given entity

Protected Member Functions

GridImp & asImp ()
 Barton-Nackman trick.
const GridImp & asImp () const
 Barton-Nackman trick.

Static Protected Member Functions

template<class InterfaceType>
static
ReturnImplementationType
< InterfaceType >
::ImplementationType & 
getRealImplementation (InterfaceType &i)
 return real implementation of interface class

Member Typedef Documentation

template<int dim, int deprecated_dimworld = dim>
typedef YaspGridFamily<dim,dim>::Traits Dune::YaspGrid< dim, deprecated_dimworld >::Traits

The traits of this class.

Presents the typedefs as described in GridTraits.

Reimplemented from Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >.


Member Enumeration Documentation

template<int dim, int dimworld, class ct, class GridFamily>
anonymous enum [inherited]

A constant that exports the template parameter dim.

Enumerator:
dimension  The dimension of the grid.

template<int dim, int dimworld, class ct, class GridFamily>
anonymous enum [inherited]

A constant that exports the template parameter dimworld.

Enumerator:
dimensionworld  The dimension of the world the grid lives in.


Constructor & Destructor Documentation

template<int dim, int deprecated_dimworld = dim>
Dune::YaspGrid< dim, deprecated_dimworld >::YaspGrid ( MPI_Comm  comm,
Dune::FieldVector< ctype, dim >  L,
Dune::FieldVector< int, dim >  s,
Dune::FieldVector< bool, dim >  periodic,
int  overlap 
) [inline]

Constructor for a YaspGrid, they are all forwarded to the base class

Parameters:
comm MPI communicator where this mesh is distributed to
L extension of the domain
s number of cells on coarse mesh in each direction
periodic tells if direction is periodic or not
size of overlap on coarsest grid (same in all directions)

template<int dim, int deprecated_dimworld = dim>
Dune::YaspGrid< dim, deprecated_dimworld >::YaspGrid ( Dune::FieldVector< ctype, dim >  L,
Dune::FieldVector< int, dim >  s,
Dune::FieldVector< bool, dim >  periodic,
int  overlap 
) [inline]

Constructor for a sequential YaspGrid, they are all forwarded to the base class.

Sequential here means that the whole grid is living on one process even if your program is running in parallel.

See also:
YaspGrid(MPI_Comm comm, Dune::FieldVector<ctype, dim>, Dune::FieldVector<int, dim> s, Dune::FieldVector<bool, dim> periodic, int overlap) for constructing one parallel grid decomposed between the processors.
Parameters:
L extension of the domain
s number of cells on coarse mesh in each direction
periodic tells if direction is periodic or not
size of overlap on coarsest grid (same in all directions)


Member Function Documentation

template<int dim, int deprecated_dimworld = dim>
int Dune::YaspGrid< dim, deprecated_dimworld >::maxLevel (  )  const [inline]

Return maximum level defined in this grid. Levels are numbered 0 ... maxlevel with 0 the coarsest level.

Reimplemented from Dune::Grid< dim, dimworld, ct, GridFamily >.

template<int dim, int deprecated_dimworld = dim>
template<class DataHandleImp, class DataType>
void Dune::YaspGrid< dim, deprecated_dimworld >::communicate ( CommDataHandleIF< DataHandleImp, DataType > &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const [inline]

The new communication interface

communicate objects for all codims on a given level

template<int dim, int deprecated_dimworld = dim>
template<class DataHandleImp, class DataType>
void Dune::YaspGrid< dim, deprecated_dimworld >::communicate ( CommDataHandleIF< DataHandleImp, DataType > &  data,
InterfaceType  iftype,
CommunicationDirection  dir 
) const [inline]

The new communication interface

communicate objects for all codims on the leaf grid

template<int dim, int deprecated_dimworld = dim>
template<class DataHandle, int codim>
void Dune::YaspGrid< dim, deprecated_dimworld >::communicateCodim ( DataHandle &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const [inline]

The new communication interface

communicate objects for one codim

template<int dim, int dimworld, class ct, class GridFamily>
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
const typename Traits::template Codim< 0 >::EntityPointer e 
) [inline, inherited]

Marks an entity to be refined/coarsened in a subsequent adapt (deprecated).

Parameters:
[in] refCount Number of subdivisions that should be applied. Negative value means coarsening.
[in] e EntityPointer to Entity that should be refined
Returns:
true if Entity was marked, false otherwise.
Note:
  • default implementation is: return false; for grids with no adaptation.
  • for the grid programmer: this method is implemented as a template method, because the Entity type is not defined when the class is instantiated You won't need this trick in the implementation. In your implementation you should use it as
               bool mark( int refCount,
                          typename Traits::template Codim<0>::EntityPointer & e ).
    
    This template method will vanish due to the inheritance rules.
Deprecated:

Reimplemented in Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.

template<int dim, int dimworld, class ct, class GridFamily>
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
const typename Traits::template Codim< 0 >::Entity e 
) [inline, inherited]

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters:
[in] refCount Number of subdivisions that should be applied. Negative value means coarsening.
[in] e Entity to Entity that should be refined
Returns:
true if Entity was marked, false otherwise.
Note:
  • default implementation is: return false; for grids with no adaptation.
  • for the grid programmer: this method is implemented as a template method, because the Entity type is not defined when the class is instantiated You won't need this trick in the implementation. In your implementation you should use it as
               bool mark( int refCount,
                          typename Traits::template Codim<0>::Entity & e ).
    
    This template method will vanish due to the inheritance rules.

Reimplemented in Dune::AlbertaGrid< dim, dimworld >, Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.

template<int dim, int dimworld, class ct, class GridFamily>
bool Dune::Grid< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
const typename Codim< 0 >::EntityPointer e 
) [inline, inherited]

Marks an entity to be refined/coarsened in a subsequent adapt. (deprecated).

Parameters:
[in] refCount Number of subdivisions that should be applied. Negative value means coarsening.
[in] e EntityPointer to Entity that should be refined
Returns:
true if Entity was marked, false otherwise.
Deprecated:

template<int dim, int dimworld, class ct, class GridFamily>
bool Dune::Grid< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
const typename Codim< 0 >::Entity e 
) [inline, inherited]

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters:
[in] refCount Number of subdivisions that should be applied. Negative value means coarsening.
[in] e Entity that should be marked
Returns:
true if Entity was marked, false otherwise.

template<int dim, int dimworld, class ct, class GridFamily>
int Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::getMark ( const typename Traits::template Codim< 0 >::EntityPointer e  )  const [inline, inherited]

returns adaptation mark for given entity, i.e. here the default implementation returns 0.

Parameters:
[in] e EntityPointer for which adaptation mark should be determined
Returns:
int adaptation mark, here the default value 0 is returned
Deprecated:

Reimplemented in Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.

template<int dim, int dimworld, class ct, class GridFamily>
int Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::getMark ( const typename Traits::template Codim< 0 >::Entity  )  const [inline, inherited]

returns adaptation mark for given entity, i.e. here the default implementation returns 0.

Parameters:
[in] e Entity for which adaptation mark should be determined
Returns:
int adaptation mark, here the default value 0 is returned

Reimplemented in Dune::AlbertaGrid< dim, dimworld >, Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.

template<int dim, int dimworld, class ct, class GridFamily>
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark ( const typename Codim< 0 >::EntityPointer e  )  const [inline, inherited]

returns adaptation mark for given entity pointer (deprecated)

Parameters:
[in] e EntityPointer for which adaptation mark should be determined
Returns:
int adaptation mark currently set for given EntityPointer e
Deprecated:

template<int dim, int dimworld, class ct, class GridFamily>
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark ( const typename Codim< 0 >::Entity e  )  const [inline, inherited]

returns adaptation mark for given entity

Parameters:
[in] e Entity for which adaptation mark should be determined
Returns:
int adaptation mark currently set for given Entity e

template<int dim, int dimworld, class ct, class GridFamily>
template<class DataHandleImp, class DataTypeImp>
void Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const [inline, inherited]

dummy communicate, doing nothing

Reimplemented from Dune::Grid< dim, dimworld, ct, GridFamily >.

template<int dim, int dimworld, class ct, class GridFamily>
template<class DataHandleImp, class DataTypeImp>
void Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::communicate ( CommDataHandleIF< DataHandleImp, DataTypeImp > &  data,
InterfaceType  iftype,
CommunicationDirection  dir 
) const [inline, inherited]

dummy communicate, doing nothing

Reimplemented from Dune::Grid< dim, dimworld, ct, GridFamily >.


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

Generated on Tue Jul 28 22:28:48 2009 for dune-grid by  doxygen 1.5.6