#include <onedgrid.hh>
This 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 |
The traits of this class. | |
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 | |
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. | |
bool | mark (int refCount, const Traits::Codim< 0 >::Entity &e) |
Mark entity for refinement. | |
int | getMark (const Traits::Codim< 0 >::EntityPointer &e) const |
return current adaptation marker of given entity | |
int | getMark (const Traits::Codim< 0 >::Entity &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. | |
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. | |
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 |
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 >.
typedef OneDGridFamily<dim,dimworld>::Traits Dune::OneDGrid::Traits |
The traits of this class.
Presents the typedefs as described in GridTraits.
Reimplemented from Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >.
The different forms of grid refinement supported by OneDGrid.
anonymous enum [inherited] |
anonymous enum [inherited] |
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.
refCount | if >0 mark for refinement, if <0 mark for coarsening | |
e | EntityPointer to the entity you want to mark |
bool Dune::OneDGrid::mark | ( | int | refCount, | |
const Traits::Codim< 0 >::Entity & | e | |||
) |
Mark entity for refinement.
refCount | if >0 mark for refinement, if <0 mark for coarsening | |
e | Entity to the entity you want to mark |
int Dune::OneDGrid::getMark | ( | const Traits::Codim< 0 >::EntityPointer & | e | ) | const |
return current adaptation marker of given entity
e | Entity to the entity you want to mark |
int Dune::OneDGrid::getMark | ( | const Traits::Codim< 0 >::Entity & | e | ) | const |
return current adaptation marker of given entity
e | Entity to the entity you want to mark |
void Dune::OneDGrid::globalRefine | ( | int | refCount | ) |
Does one uniform refinement step.
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, 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).
[in] | refCount | Number of subdivisions that should be applied. Negative value means coarsening. |
[in] | e | EntityPointer to Entity that should be refined |
bool mark( int refCount, typename Traits::template Codim<0>::EntityPointer & e ).
Reimplemented in Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.
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.
[in] | refCount | Number of subdivisions that should be applied. Negative value means coarsening. |
[in] | e | Entity to Entity that should be refined |
bool mark( int refCount, typename Traits::template Codim<0>::Entity & e ).
Reimplemented in Dune::AlbertaGrid< dim, dimworld >, Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.
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).
[in] | refCount | Number of subdivisions that should be applied. Negative value means coarsening. |
[in] | e | EntityPointer to Entity that should be refined |
bool Dune::Grid< dim, dimworld, ct, GridFamily >::mark | ( | int | refCount, | |
const typename Codim< 0 >::Entity & | e | |||
) | [inline, inherited] |
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.
[in] | e | EntityPointer for which adaptation mark should be determined |
Reimplemented in Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.
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.
[in] | e | Entity for which adaptation mark should be determined |
Reimplemented in Dune::AlbertaGrid< dim, dimworld >, Dune::UGGrid< dim >, and Dune::UGGrid< dimworld >.
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)
[in] | e | EntityPointer for which adaptation mark should be determined |
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark | ( | const typename Codim< 0 >::Entity & | e | ) | const [inline, inherited] |
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 >.
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 >.