Dune::OneDGrid Class Reference
[Grid Implementations]

#include <onedgrid.hh>

Inheritance diagram for Dune::OneDGrid:

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

List of all members.


Detailed Description

[ provides Dune::Grid ] Onedimensional adaptive grid

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::GlobalIdSetglobalIdSet () const
 Get the set of global ids.
const Traits::LocalIdSetlocalIdSet () const
 Get the set of local ids.
const Traits::LevelIndexSetlevelIndexSet (int level) const
 Get an index set for the given level.
const Traits::LeafIndexSetleafIndexSet () 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


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 >.

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 >.


Member Enumeration Documentation

The different forms of grid refinement supported by OneDGrid.

Enumerator:
LOCAL  New level consists only of the refined elements.
COPY  New level consists of the refined elements and the unrefined ones, too.

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.


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
Deprecated:

bool Dune::OneDGrid::mark ( int  refCount,
const Traits::Codim< 0 >::Entity e 
)

Mark entity for refinement.

Parameters:
refCount if >0 mark for refinement, if <0 mark for coarsening
e Entity 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
Deprecated:

int Dune::OneDGrid::getMark ( const Traits::Codim< 0 >::Entity 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 >.

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 Sun Nov 15 22:29:02 2009 for dune-grid by  doxygen 1.5.6