Dune::OneDGrid Class Reference
[Grid Implementations]
#include <onedgrid.hh>
Inheritance diagram for Dune::OneDGrid:

Detailed Description
[ provides Dune::Grid ] Onedimensional adaptive gridThis implementation of the grid interface provides one-dimensional grids only. No matter what the values of dim and dimworld may be, you'll always get a 1D-grid in a 1D-world. Unlike SGrid, however, which can also be instantiated in 1D, the OneDGrid is nonuniform and provides local mesh refinement and coarsening.
Public Types | |
enum | RefinementType { LOCAL, COPY } |
The different forms of grid refinement supported by OneDGrid. More... | |
typedef double | ctype |
The type used to store coordinates. | |
typedef OneDGridFamily< dim, dimworld > | GridFamily |
GridFamily of OneDGrid. | |
typedef OneDGridFamily< dim, dimworld >::Traits | Traits |
Provides the standard grid 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... | |
Public Member Functions | |
OneDGrid (const std::vector< ctype > &coords) | |
Constructor with an explicit set of coordinates. | |
OneDGrid (int numElements, const ctype &leftBoundary, const ctype &rightBoundary) | |
Constructor for a uniform grid. | |
~OneDGrid () | |
Destructor. | |
int | maxLevel () const |
Return maximum level defined in this grid. | |
template<int codim> | |
Traits::template Codim< codim >::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level. | |
template<int codim> | |
Traits::template Codim< codim >::LevelIterator | lend (int level) const |
one past the end on this level | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level. | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator | lend (int level) const |
one past the end on this level | |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafbegin () const |
Iterator to first entity of given codim on leaf level. | |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafend () const |
one past the end on leaf level | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator | leafbegin () const |
Iterator to first entity of given codim on level. | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator | leafend () const |
one past the end on this level | |
int | size (int level, int codim) const |
Number of grid entities per level and codim. | |
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 | |
int | overlapSize (int codim) const |
The processor overlap for parallel computing. Always zero because this is a strictly sequential grid. | |
int | ghostSize (int codim) const |
The processor ghost overlap for parallel computing. Always zero because this is a strictly sequential grid. | |
int | overlapSize (int level, int codim) const |
The processor overlap for parallel computing. Always zero because this is a strictly sequential grid. | |
int | ghostSize (int level, int codim) const |
The processor ghost overlap for parallel computing. Always zero because this is a strictly sequential grid. | |
const Traits::GlobalIdSet & | globalIdSet () const |
Get the set of global ids. | |
const Traits::LocalIdSet & | localIdSet () const |
Get the set of local ids. | |
const Traits::LevelIndexSet & | levelIndexSet (int level) const |
Get an index set for the given level. | |
const Traits::LeafIndexSet & | leafIndexSet () const |
Get an index set for the leaf level. | |
bool | mark (int refCount, const Traits::Codim< 0 >::EntityPointer &e) |
Mark entity for refinement. | |
int | getMark (const Traits::Codim< 0 >::EntityPointer &e) const |
return current adaptation marker of given entity | |
bool | preAdapt () |
Does nothing except return true if some element has been marked for refinement. | |
bool | adapt () |
Triggers the grid refinement process. | |
void | postAdapt () |
Adaptation post-processing: Reset all adaptation state flags. | |
std::string | name () const |
grid identification | |
void | setRefinementType (RefinementType type) |
Sets the type of grid refinement. | |
void | globalRefine (int refCount) |
Does one uniform refinement step. | |
const CollectiveCommunication< OneDGrid > & | comm () const |
return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication. | |
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. | |
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 | |
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 Typedef Documentation
typedef double Dune::OneDGrid::ctype |
The type used to store coordinates.
If you ever want OneDGrid to use a different type for coordinates, you need to change this type and the third template argument of the base class.
Reimplemented from Dune::Grid< dim, dimworld, ct, GridFamily >.
Member Enumeration Documentation
The different forms of grid refinement supported by OneDGrid.
anonymous enum [inherited] |
anonymous enum [inherited] |
Member Function Documentation
int Dune::OneDGrid::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 >.
bool Dune::OneDGrid::mark | ( | int | refCount, | |
const Traits::Codim< 0 >::EntityPointer & | e | |||
) |
Mark entity for refinement.
- Parameters:
-
refCount if >0 mark for refinement, if <0 mark for coarsening e EntityPointer to the entity you want to mark
- Returns:
- True, if marking was successfull
int Dune::OneDGrid::getMark | ( | const Traits::Codim< 0 >::EntityPointer & | e | ) | const |
return current adaptation marker of given entity
- Parameters:
-
e Entity to the entity you want to mark
- Returns:
- int current adaptation marker of entity pointer e
void Dune::OneDGrid::globalRefine | ( | int | refCount | ) |
Does one uniform refinement step.
- Parameters:
-
refCount I don't know what this is good for. It doesn't actually do anything.
Reimplemented from Dune::Grid< dim, dimworld, ct, GridFamily >.
bool Dune::GridDefaultImplementation< dim, dimworld, double , OneDGridFamily< 1, 1 > >::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, double , OneDGridFamily< 1, 1 > >::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, double , OneDGridFamily< 1, 1 > >::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, double , OneDGridFamily< 1, 1 > >::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: