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 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...
Exported types
typedef ct ctype
 Define type used for coordinates in grid module.

Public Member Functions

 OneDGrid (const std::vector< OneDCType > &coords)
 Constructor with an explicit set of coordinates.
 OneDGrid (int numElements, double leftBoundary, double 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.
template<class T>
bool mark (int refCount, T &e)
 Marks an entity to be refined/coarsened in a subsequent adapt.
template<class T>
int getMark (T &) 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

Protected Member Functions

template<class InterfaceType>
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

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

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

template<int dim, int dimworld, class ct, class GridFamily>
template<class T>
bool Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
T &  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
               bool mark( int refCount,
                          typename Traits::template Codim<0>::EntityPointer & e ).
    
    This template method will vanish due to the inheritance rules.

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

template<int dim, int dimworld, class ct, class GridFamily>
template<class T>
int Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::getMark ( T &   )  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 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,
int  level 
) const [inline, inherited]

dummy communicate, doing nothing

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

Reimplemented in Dune::ALU3dGrid< 3, 3, Dune::hexa >, and Dune::ALU3dGrid< 3, 3, Dune::tetra >.

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

Reimplemented in Dune::ALU3dGrid< 3, 3, Dune::hexa >, and Dune::ALU3dGrid< 3, 3, Dune::tetra >.


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

Generated on 12 Dec 2007 with Doxygen (ver 1.5.1)