#include <agrid.hh>
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
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
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 > ¯oData, const std::string &gridName="AlbertaGrid") | |
create a grid from an ALBERTA macro data structure | |
AlbertaGrid (const std::string ¯oGridFileName, 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 DofManager, class RestrictProlongOperator> | |
bool | adapt (DofManager &, RestrictProlongOperator &, bool verbose=false) |
adapt method with DofManager | |
bool | preAdapt () |
returns true, if a least one element is marked for coarsening | |
void | postAdapt () |
clean up some markers | |
const CollectiveCommunication & | comm () 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::LevelIndexSet & | levelIndexSet (int level) const |
return level index set for given level | |
const Traits::LeafIndexSet & | leafIndexSet () const |
return leaf index set | |
const GlobalIdSet & | globalIdSet () const |
return global IdSet | |
const LocalIdSet & | localIdSet () 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 |
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 >.
anonymous enum [inherited] |
anonymous enum [inherited] |
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
[in] | macroData | macro data to create grid from |
[in] | gridName | name of the grid (defaults to "AlbertaGrid") |
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
[in] | macroGridFileName | name of the macro grid file |
[in] | gridName | name of the grid (defaults to "AlbertaGrid") |
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 >.
int Dune::AlbertaGrid< dim, dimworld >::getMark | ( | const typename Traits::template Codim< 0 >::Entity & | e | ) | const [inline] |
returns adaptation mark for given entity
[in] | e | Entity for which adaptation mark should be determined |
Reimplemented from Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >.
References Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >::getRealImplementation().
Referenced by Dune::AlbertaGrid< dim, dimworld >::mark().
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.
[in] | refCount | Number of subdivisions that should be applied. Negative value means coarsening. |
[in] | e | Entity that should be marked |
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().
bool Dune::AlbertaGrid< dim, dimworld >::adapt | ( | ) | [inline] |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
Reimplemented from Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >.
Referenced by Dune::AlbertaGrid< dim, dimworld >::adapt(), and Dune::AlbertaGrid< dim, dimworld >::globalRefine().
bool Dune::AlbertaGrid< dim, dimworld >::adapt | ( | DofManager & | dofManager, | |
RestrictProlongOperator & | rpOp, | |||
bool | verbose = false | |||
) | [inline] |
const Base :: template ReturnImplementationType< IntersectionInterfaceType >:: ImplementationType& Dune::AlbertaGrid< dim, dimworld >::getRealIntersectionIterator | ( | const IntersectionInterfaceType & | iterator | ) | const [inline] |
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::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::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 >.