Dune::YaspGrid< dim, dimworld > Class Template Reference
[Grid Implementations]
#include <yaspgrid.hh>
Inheritance diagram for Dune::YaspGrid< dim, dimworld >:

Detailed Description
template<int dim, int dimworld>
class Dune::YaspGrid< dim, 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.
- 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, dimworld > | GridFamily |
the GridFamily of this grid | |
typedef YaspGridFamily< dim, dimworld >::Traits | Traits |
the Traits | |
typedef MultiYGrid< dim, ctype > | YMG |
shorthand for base class data types | |
typedef FieldVector< int, d > | iTupel |
define types used for arguments | |
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... | |
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) | |
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::GlobalIdSet & | globalIdSet () const |
return const reference to the grids global id set | |
const Traits::LocalIdSet & | localIdSet () const |
return const reference to the grids local id set | |
const Traits::LevelIndexSet & | levelIndexSet (int level) const |
return const reference to the grids level index set for level level | |
const Traits::LeafIndexSet & | leafIndexSet () const |
return const reference to the grids leaf index set | |
const CollectiveCommunication< MPI_Comm > & | comm () const |
return a collective communication object | |
bool | mark (int refCount, const typename Traits::template Codim< 0 >::EntityPointer &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. | |
int | getMark (const typename Traits::template Codim< 0 >::EntityPointer &) 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 | |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const |
bool | loadBalance () |
default implementation of load balance does nothing and returns false | |
bool | loadBalance (DataHandle &data) |
default implementation of load balance does nothing and returns false | |
const Torus< d > & | torus () const |
return reference to torus | |
int | maxlevel () const |
return the maximum level index (number of levels is maxlevel()+1) | |
bool | periodic (int i) const |
return true if grid is periodic in given direction | |
YGridLevelIterator | begin () const |
return iterator pointing to coarsest level | |
YGridLevelIterator | begin (int i) const |
return iterator pointing to given level | |
YGridLevelIterator | end () const |
return iterator pointing to one past the finest level | |
YGridLevelIterator | rbegin () const |
return iterator pointing to the finest level | |
YGridLevelIterator | rend () const |
return iterator pointing to one before the coarsest level | |
void | print (std::ostream &s) const |
print function for multigrids | |
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. | |
int | getMark (const typename Codim< 0 >::EntityPointer &e) const |
returns adaptation mark for given entity pointer | |
Protected Member Functions | |
ReturnImplementationType< InterfaceType >::ImplementationType & | getRealImplementation (InterfaceType &i) const |
return real implementation of interface class | |
GridImp & | asImp () |
Barton-Nackman trick. | |
const GridImp & | asImp () const |
Barton-Nackman trick. |
Member Enumeration Documentation
anonymous enum [inherited] |
anonymous enum [inherited] |
Constructor & Destructor Documentation
Dune::YaspGrid< dim, 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)
Member Function Documentation
int Dune::YaspGrid< dim, 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 >.
void Dune::YaspGrid< dim, 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
void Dune::YaspGrid< dim, 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
void Dune::YaspGrid< dim, dimworld >::communicateCodim | ( | DataHandle & | data, | |
InterfaceType | iftype, | |||
CommunicationDirection | dir, | |||
int | level | |||
) | const [inline] |
The new communication interface
communicate objects for one codim
bool Dune::GridDefaultImplementation< dim, dimworld, yaspgrid_ctype , YaspGridFamily< dim, dimworld > >::mark | ( | int | refCount, | |
const typename Traits::template Codim< 0 >::EntityPointer & | 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 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 This template method will vanish due to the inheritance rules.
bool mark( int refCount, typename Traits::template Codim<0>::EntityPointer & e ).
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.
- 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.
int Dune::GridDefaultImplementation< dim, dimworld, yaspgrid_ctype , YaspGridFamily< dim, dimworld > >::getMark | ( | const typename Traits::template Codim< 0 >::EntityPointer & | ) | 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
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark | ( | const typename Codim< 0 >::EntityPointer & | e | ) | const [inline, inherited] |
returns adaptation mark for given entity pointer
- Parameters:
-
[in] e EntityPointer for which adaptation mark should be determined
- Returns:
- int adaptation mark currently set for given EntityPointer e
void Dune::GridDefaultImplementation< dim, dimworld, yaspgrid_ctype , YaspGridFamily< dim, dimworld > >::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 >.
void Dune::GridDefaultImplementation< dim, dimworld, yaspgrid_ctype , YaspGridFamily< dim, dimworld > >::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: