Dune::AlbertaGrid< dim, dimworld > Class Template Reference
[Grid ImplementationsAlbertaGrid]

#include <agrid.hh>

Inheritance diagram for Dune::AlbertaGrid< dim, dimworld >:

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

List of all members.


Detailed Description

template<int dim, int dimworld = Alberta::dimWorld>
class Dune::AlbertaGrid< dim, dimworld >

[ provides Dune::Grid ]

simplicial grid imlementation from the ALBERTA finite element toolbox

AlbertaGrid provides access to the grid from the ALBERTA finite element toolbox through the Dune interface. ALBERTA is a finite element toolbox written by Alfred Schmidt and Kunibert G. Siebert (see http://www.alberta-fem.de). It contains a simplicial mesh in 1, 2 and 3 space dimensions that can be dynamically adapted by a bisection algorithm.

Supported ALBERTA versions include 1.2 and 2.0. Both versions can be downloaded from the ALBERTA website (www.alberta-fem.de). After installing ALBERTA, just configure DUNE with the --with-alberta option and provide the path to ALBERTA. You also have to specify which dimensions of grid and world to use. For example, your Dune configure options could contain the following settings

  --with-alberta=ALBERTAPATH
  --with-alberta-dim=DIMGRID
  --with-alberta-world-dim=DIMWORLD
The default values are DIMGRID=2 and DIMWORLD=DIMGRID. If the --with-grid-dim (see DGF Parser's gridtype.hh) is provided, DIMGRID will default to this value. You can then use AlbertaGrid< DIMGRID, DIMWORLD >. Using other template parameters might result in unpredictable behavior.

Further installation instructions can be found here: http://www.dune-project.org/external_libraries/install_alberta.html

Note:
Although ALBERTA supports different combinations of DIMGRID<=DIMWORLD, so far only the case DIMGRID=DIMWORLD is supported.

Public Types

typedef Alberta::Real ctype
 Define type used for coordinates in grid module.
typedef AlbertaGridFamily< dim,
dimworld > 
GridFamily
 the grid family of AlbertaGrid
typedef AlbertaGridFamily< dim,
dimworld >::Traits 
Traits
 The traits of this class.
typedef Traits::HierarchicIndexSet HierarchicIndexSet
 type of hierarchic index set
typedef
Traits::CollectiveCommunication 
CollectiveCommunication
 type of collective communication
typedef ALBERTA
AlbertHelp::AlbertLeafData
< dimworld, dim+1 > 
LeafDataType
 type of leaf data
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

 AlbertaGrid ()
 create an empty grid
 AlbertaGrid (const Alberta::MacroData< dimension > &macroData, const std::string &gridName="AlbertaGrid")
 create a grid from an ALBERTA macro data structure
 AlbertaGrid (const std::string &macroGridFileName, const std::string &gridName="AlbertaGrid")
 create a grid from an ALBERTA macro grid file
 ~AlbertaGrid ()
 desctructor
int maxLevel () const
template<int cd, PartitionIteratorType pitype>
Traits::template Codim< cd >
::template Partition< pitype >
::LevelIterator 
lbegin (int level) const
 Iterator to first entity of given codim on level.
template<int cd, PartitionIteratorType pitype>
Traits::template Codim< cd >
::template Partition< pitype >
::LevelIterator 
lend (int level) const
 one past the end on this level
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 >
::LeafIterator 
leafbegin () const
 return LeafIterator which points to first leaf entity
template<int codim, PartitionIteratorType pitype>
Traits::template Codim< codim >
::template Partition< pitype >
::LeafIterator 
leafend () const
 return LeafIterator which points behind last leaf entity
template<int codim>
Traits::template Codim< codim >
::LeafIterator 
leafbegin () const
 return LeafIterator which points to first leaf entity
template<int codim>
Traits::template Codim< codim >
::LeafIterator 
leafend () const
 return LeafIterator which points behind last leaf entity
int size (int level, int codim) const
 Number of grid entities per level and codim because lbegin and lend are none const, and we need this methods counting the entities on each level, you know.
int size (int level, GeometryType type) const
 number of entities per level and geometry type in this process
int size (int codim) const
 number of leaf entities per codim in this process
int size (GeometryType type) const
 number of leaf entities per geometry type in this process
int getMark (const typename Traits::template Codim< 0 >::Entity &e) const
bool mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e)
bool globalRefine (int refCount)
 uses the interface, mark on entity and refineLocal
bool adapt ()
template<class DataHandle>
bool adapt (AdaptDataHandleInterface< This, DataHandle > &handle)
template<class DofManager, class RestrictProlongOperator>
bool adapt (DofManager &, RestrictProlongOperator &, bool verbose=false)
bool preAdapt ()
 returns true, if a least one element is marked for coarsening
void postAdapt ()
 clean up some markers
const CollectiveCommunicationcomm () const
 return reference to collective communication, if MPI found this is specialisation for MPI
std::string name () const
 return name of the grid
template<GrapeIOFileFormatType ftype>
bool writeGrid (const std::string &filename, ctype time) const
 write Grid to file in specified GrapeIOFileFormatType
template<GrapeIOFileFormatType ftype>
bool readGrid (const std::string &filename, ctype &time)
 read Grid from file filename and store time of mesh in time
const Traits::LevelIndexSetlevelIndexSet (int level) const
 return level index set for given level
const Traits::LeafIndexSetleafIndexSet () const
 return leaf index set
const GlobalIdSetglobalIdSet () const
 return global IdSet
const LocalIdSetlocalIdSet () const
 return local IdSet
template<class IntersectionInterfaceType>
const Base::template
ReturnImplementationType
< IntersectionInterfaceType >
::ImplementationType & 
getRealIntersectionIterator (const IntersectionInterfaceType &iterator) const
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).
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 ghostSize (int level, int codim) const
 ghostSize is zero by default
int ghostSize (int codim) const
 ghostSize is zero by default
int overlapSize (int level, int codim) const
 overlapSize is zero by default
int overlapSize (int codim) const
 overlapSize is zero by default
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

Static Public Attributes

static const int dimension = dim
 The dimension of the grid.
static const int dimensionworld = dimworld
 The dimension of the world the grid lives in.

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

template<int dim, int dimworld = Alberta::dimWorld>
typedef AlbertaGridFamily< dim, dimworld >::Traits Dune::AlbertaGrid< dim, dimworld >::Traits

The traits of this class.

Presents the typedefs as described in GridTraits.

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


Member Enumeration Documentation

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.


Constructor & Destructor Documentation

template<int dim, int dimworld>
Dune::AlbertaGrid< dim, dimworld >::AlbertaGrid ( const Alberta::MacroData< dimension > &  macroData,
const std::string &  gridName = "AlbertaGrid< dim, dimworld >" 
) [inline]

create a grid from an ALBERTA macro data structure

Parameters:
[in] macroData macro data to create grid from
[in] gridName name of the grid (defaults to "AlbertaGrid")

template<int dim, int dimworld>
Dune::AlbertaGrid< dim, dimworld >::AlbertaGrid ( const std::string &  macroGridFileName,
const std::string &  gridName = "AlbertaGrid< dim, dimworld >" 
) [inline]

create a grid from an ALBERTA macro grid file

Parameters:
[in] macroGridFileName name of the macro grid file
[in] gridName name of the grid (defaults to "AlbertaGrid")


Member Function Documentation

template<int dim, int dimworld>
int Dune::AlbertaGrid< 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 >.

template<int dim, int dimworld>
int Dune::AlbertaGrid< dim, dimworld >::getMark ( const typename Traits::template Codim< 0 >::Entity e  )  const [inline]

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

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

References Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::getRealImplementation().

Referenced by Dune::AlbertaGrid< dim, dimworld >::mark().

template<int dim, int dimworld>
bool Dune::AlbertaGrid< dim, dimworld >::mark ( int  refCount,
const typename Traits::template Codim< 0 >::Entity e 
) [inline]

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.

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

References Dune::AlbertaGrid< dim, dimworld >::getMark(), and Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::getRealImplementation().

Referenced by Dune::AlbertaGrid< dim, dimworld >::globalRefine().

template<int dim, int dimworld>
bool Dune::AlbertaGrid< dim, dimworld >::adapt (  )  [inline]

Refine all positive marked leaf entities, coarsen all negative marked entities if possible.

Returns:
true if a least one entity was refined
The complete adaptation process works as follows:

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

Referenced by Dune::AlbertaGrid< dim, dimworld >::adapt(), and Dune::AlbertaGrid< dim, dimworld >::globalRefine().

template<int dim, int dimworld>
template<class DataHandle>
bool Dune::AlbertaGrid< dim, dimworld >::adapt ( AdaptDataHandleInterface< This, DataHandle > &  handle  )  [inline]

Refine all positive marked leaf entities, coarsen all negative marked entities if possible.

Returns:
true if a least one entity was refined
The complete adaptation process works as follows:

Parameters:
handle handler for restriction and prolongation operations which is a model of the AdaptDataHandleInterface class

References Dune::AlbertaGrid< dim, dimworld >::adapt(), Dune::AlbertaGrid< dim, dimworld >::postAdapt(), and Dune::AlbertaGrid< dim, dimworld >::preAdapt().

template<int dim, int dimworld>
template<class DofManager, class RestrictProlongOperator>
bool Dune::AlbertaGrid< dim, dimworld >::adapt ( DofManager &  dofManager,
RestrictProlongOperator &  rpOp,
bool  verbose = false 
) [inline]

template<int dim, int dimworld = Alberta::dimWorld>
template<class IntersectionInterfaceType>
const Base :: template ReturnImplementationType< IntersectionInterfaceType >:: ImplementationType& Dune::AlbertaGrid< dim, dimworld >::getRealIntersectionIterator ( const IntersectionInterfaceType &  iterator  )  const [inline]

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

Generated on Tue Jul 28 22:28:29 2009 for dune-grid by  doxygen 1.5.6