Dune::Grid< dim, dimworld, ct, GridFamily > Class Template Reference
[Grid Abstract Base Class]
#include <grid.hh>

Detailed Description
template<int dim, int dimworld, class ct, class GridFamily>
class Dune::Grid< dim, dimworld, ct, GridFamily >
Grid abstract base classThis class is the base class for all grid implementations. Although no virtual functions are used we call it abstract since its methods do not contain an implementation but forward to the methods of the derived class via the Barton-Nackman trick.
Template parameters:
dim
specifies the dimension of the grid.dimworld
specifies the dimension of the surrounding space, this can be different from dim, if the grid is defined on a manifold .ct
field type of the world vector space.GridFamily
traits class providing all types associated with the grid implementation.
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. | |
Grid id | |
std::string | name () const |
Return the id of the grid. | |
Size methods | |
int | maxLevel () const |
Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest level. | |
int | size (int level, int codim) const |
Return number of grid entities of a given codim on a given level in this process. | |
int | size (int codim) const |
Return number of leaf entities of a given codim in this process. | |
int | size (int level, GeometryType type) const |
Return number of entities per level and geometry type in this process. | |
int | size (GeometryType type) const |
Return number of leaf entities per geometry type in this process. | |
Iterators | |
template<int cd, PartitionIteratorType pitype> | |
Codim< cd >::template Partition< pitype > ::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level. | |
template<int cd, PartitionIteratorType pitype> | |
Codim< cd >::template Partition< pitype > ::LevelIterator | lend (int level) const |
one past the end on this level | |
template<int cd> | |
Codim< cd >::template Partition< All_Partition > ::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level for PartitionType All_Partition. | |
template<int cd> | |
Codim< cd >::template Partition< All_Partition > ::LevelIterator | lend (int level) const |
one past the end on this level for PartitionType All_Partition | |
template<int cd, PartitionIteratorType pitype> | |
Codim< cd >::template Partition< pitype > ::LeafIterator | leafbegin () const |
Iterator to first entity of given codim on leaf grid. | |
template<int cd, PartitionIteratorType pitype> | |
Codim< cd >::template Partition< pitype > ::LeafIterator | leafend () const |
one past the end on the leaf level grid | |
template<int cd> | |
Codim< cd >::template Partition< All_Partition > ::LeafIterator | leafbegin () const |
Iterator to first entity of given codim on leaf grid for PartitionType All_Partition. | |
template<int cd> | |
Codim< cd >::template Partition< All_Partition > ::LeafIterator | leafend () const |
one past the end on the leaf grid for PartitionType All_Partition | |
Access to index and id sets | |
const Codim< 0 >::GlobalIdSet & | globalIdSet () const |
return const reference to the grids global id set | |
const Codim< 0 >::LocalIdSet & | localIdSet () const |
return const reference to the grids local id set | |
const Codim< 0 >::LevelIndexSet & | levelIndexSet (int level) const |
return const reference to the grids level index set for level level | |
const Codim< 0 >::LeafIndexSet & | leafIndexSet () const |
return const reference to the grids leaf index set | |
Adaptivity and grid refinement | |
void | globalRefine (int refCount) |
Refine the grid refCount times using the default refinement rule. | |
bool | mark (int refCount, const typename Codim< 0 >::EntityPointer &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 | |
bool | preAdapt () |
To be called after entities have been marked and before adapt() is called. | |
bool | adapt () |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible. | |
void | postAdapt () |
To be called after grid has been adapted and information left over by the adaptation has been processed. | |
Parallel data distribution and communication | |
int | overlapSize (int level, int codim) const |
Return size of overlap for a given codim on a given level. | |
int | overlapSize (int codim) const |
Return size of overlap region for a given codim on the leaf grid. | |
int | ghostSize (int level, int codim) const |
Return size of ghost region for a given codim on a given level. | |
int | ghostSize (int codim) const |
Return size of ghost region for a given codim on the leaf grid. | |
template<class DataHandleImp, class DataTypeImp> | |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const |
Communicate information on distributed entities on a given level Template parameter is a model of Dune::CommDataHandleIF. | |
template<class DataHandleImp, class DataTypeImp> | |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const |
Communicate information on distributed entities on the leaf grid Template parameter is a model of Dune::CommDataHandleIF. | |
const Codim < 0 >::CollectiveCommunication & | comm () const |
return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication. | |
Public Member Functions | |
bool | loadBalance () |
Re-balances the load each process has to handle for a parallel grid, if grid has changed , true is returned. | |
template<class DataHandle> | |
bool | loadBalance (DataHandle &data) |
Re-balances the load each process has to handle for a parallel grid, the DataHandle data works like the data handle for the communicate methods. If grid has changed , true is returned. | |
Classes | |
struct | Codim |
A Traits struct that collects all associated types of one implementation. More... |
Member Enumeration Documentation
anonymous enum |
anonymous enum |
Member Function Documentation
bool Dune::Grid< dim, dimworld, ct, GridFamily >::mark | ( | int | refCount, | |
const typename Codim< 0 >::EntityPointer & | 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 EntityPointer to Entity that should be refined
- Returns:
- true if Entity was marked, false otherwise.
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark | ( | const typename Codim< 0 >::EntityPointer & | e | ) | const [inline] |
returns adaptation mark for given entity pointer
- Parameters:
-
[in] e EntityPointer for which adaptation mark should be determined
- Returns:
- int adaptation mark currently set for given EntityPointer e
bool Dune::Grid< dim, dimworld, ct, GridFamily >::preAdapt | ( | ) | [inline] |
To be called after entities have been marked and before adapt() is called.
- Returns:
- true if an entity may be coarsened during a subsequent adapt(), false otherwise.
Reimplemented in Dune::AlbertaGrid< dim, dimworld >, Dune::ALU2dGrid< dim, dimworld >, Dune::ALU3dGrid< dim, dimworld, elType >, Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >, Dune::OneDGrid, Dune::UGGrid< dim >, Dune::ALU2dGrid< 2, 2 >, Dune::ALU3dGrid< 3, 3, Dune::hexa >, Dune::ALU3dGrid< 3, 3, Dune::tetra >, Dune::GridDefaultImplementation< dim, dimworld, double, Dune::SGridFamily< dim, dimworld > >, Dune::GridDefaultImplementation< 1, 1, double, Dune::OneDGridFamily< 1, 1 > >, Dune::GridDefaultImplementation< dim, dimworld, ALBERTA REAL, Dune::AlbertaGridFamily< dim, dimworld > >, Dune::GridDefaultImplementation< dim, dimworld, double, Dune::YaspGridFamily< dim, dimworld > >, Dune::GridDefaultImplementation< dim, dimworld, double, Dune::ALU3dGridFamily< dim, dimworld, elType > >, Dune::GridDefaultImplementation< dim, dim, double, Dune::UGGridFamily< dim, dim > >, and Dune::GridDefaultImplementation< dim, dimworld, double, Dune::ALU2dGridFamily< dim, dimworld > >.
bool Dune::Grid< dim, dimworld, ct, GridFamily >::adapt | ( | ) | [inline] |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
- Returns:
- true if a least one entity was refined
- mark entities with the mark() method
- call preAdapt()
- if preAdapt() returned true: possibly save current solution
- call adapt()
- if adapt() returned true: possibly interpolate the (saved) solution
- call postAdapt()
Reimplemented in Dune::AlbertaGrid< dim, dimworld >, Dune::ALU2dGrid< dim, dimworld >, Dune::ALU3dGrid< dim, dimworld, elType >, Dune::GridDefaultImplementation< dim, dimworld, ct, GridFamily >, Dune::OneDGrid, Dune::SGrid< dim, dimworld >, Dune::UGGrid< dim >, Dune::YaspGrid< dim, dimworld >, Dune::ALU2dGrid< 2, 2 >, Dune::ALU3dGrid< 3, 3, Dune::hexa >, Dune::ALU3dGrid< 3, 3, Dune::tetra >, Dune::GridDefaultImplementation< dim, dimworld, double, Dune::SGridFamily< dim, dimworld > >, Dune::GridDefaultImplementation< 1, 1, double, Dune::OneDGridFamily< 1, 1 > >, Dune::GridDefaultImplementation< dim, dimworld, ALBERTA REAL, Dune::AlbertaGridFamily< dim, dimworld > >, Dune::GridDefaultImplementation< dim, dimworld, double, Dune::YaspGridFamily< dim, dimworld > >, Dune::GridDefaultImplementation< dim, dimworld, double, Dune::ALU3dGridFamily< dim, dimworld, elType > >, Dune::GridDefaultImplementation< dim, dim, double, Dune::UGGridFamily< dim, dim > >, Dune::GridDefaultImplementation< dim, dimworld, double, Dune::ALU2dGridFamily< dim, dimworld > >, Dune::SGrid< dimension, dimension >, and Dune::YaspGrid< dimworld, dimworld >.
The documentation for this class was generated from the following file: