dune-grid 2.9.0
|
grid wrapper replacing the geometries More...
#include <dune/grid/geometrygrid/grid.hh>
Classes | |
struct | Codim |
traits structure containing types for a codimension More... | |
Public Member Functions | |
const GlobalIdSet & | globalIdSet () const |
const LocalIdSet & | localIdSet () const |
const LevelIndexSet & | levelIndexSet (int level) const |
const LeafIndexSet & | leafIndexSet () const |
void | globalRefine (int refCount) |
bool | mark (int refCount, const typename Codim< 0 >::Entity &entity_) |
int | getMark (const typename Codim< 0 >::Entity &entity_) const |
bool | preAdapt () |
bool | adapt () |
void | postAdapt () |
Protected Member Functions | |
void * | allocateStorage (std::size_t size) const |
void | deallocateStorage (void *p, std::size_t size) const |
Static Protected Member Functions | |
template<int codim> | |
static const HostGrid::template Codim< codim >::Entity & | getHostEntity (const typename Codim< codim >::Entity &entity) |
Traits | |
typedef GridFamily::Traits | Traits |
type of the grid traits More... | |
Iterator Types | |
typedef Traits::HierarchicIterator | HierarchicIterator |
iterator over the grid hierarchy More... | |
typedef Traits::LeafIntersectionIterator | LeafIntersectionIterator |
iterator over intersections with other entities on the leaf level More... | |
typedef Traits::LevelIntersectionIterator | LevelIntersectionIterator |
iterator over intersections with other entities on the same level More... | |
Grid View Types | |
typedef GridFamily::Traits::LeafGridView | LeafGridView |
type of view for leaf grid More... | |
typedef GridFamily::Traits::LevelGridView | LevelGridView |
type of view for level grid More... | |
Index and Id Set Types | |
typedef Traits::LeafIndexSet | LeafIndexSet |
type of leaf index set More... | |
typedef Traits::LevelIndexSet | LevelIndexSet |
type of level index set More... | |
typedef Traits::GlobalIdSet | GlobalIdSet |
type of global id set More... | |
typedef Traits::LocalIdSet | LocalIdSet |
type of local id set More... | |
Miscellaneous Types | |
typedef Traits::ctype | ctype |
type of vector coordinates (e.g., double) More... | |
typedef Traits::Communication | Communication |
communicator with all other processes having some part of the grid More... | |
typedef Communication | CollectiveCommunication |
Construction and Destruction | |
GeometryGrid (HostGrid &hostGrid, CoordFunction &coordFunction, const Allocator &allocator=Allocator()) | |
constructor More... | |
GeometryGrid (std::shared_ptr< HostGrid > hostGrid, std::shared_ptr< CoordFunction > coordFunction, const Allocator &allocator=Allocator()) | |
constructor More... | |
GeometryGrid (std::shared_ptr< HostGrid > hostGrid, const Allocator &allocator=Allocator()) | |
constructor More... | |
Size Methods | |
int | maxLevel () const |
obtain maximal grid level More... | |
int | size (int level, int codim) const |
obtain number of entites on a level More... | |
int | size (int codim) const |
obtain number of leaf entities More... | |
int | size (int level, GeometryType type) const |
obtain number of entites on a level More... | |
int | size (GeometryType type) const |
obtain number of leaf entities More... | |
size_t | numBoundarySegments () const |
returns the number of boundary segments within the macro grid More... | |
Parallel Data Distribution and Communication Methods | |
const Communication & | comm () const |
obtain Communication object More... | |
template<class EntitySeed > | |
Traits::template Codim< EntitySeed::codimension >::Entity | entity (const EntitySeed &seed) const |
obtain Entity from EntitySeed More... | |
Grid Views | |
LevelGridView | levelGridView (int level) const |
View for a grid level. More... | |
LeafGridView | leafGridView () const |
View for the leaf grid. More... | |
Miscellaneous Methods | |
const HostGrid & | hostGrid () const |
obtain constant reference to the host grid More... | |
HostGrid & | hostGrid () |
obtain mutable reference to the host grid More... | |
void | update () |
update grid caches More... | |
const CoordFunction & | coordFunction () const |
obtain constant reference to the coordinate function More... | |
CoordFunction & | coordFunction () |
obtain mutable reference to the coordinate function. More... | |
grid wrapper replacing the geometries
GeometryGrid wraps another DUNE grid and replaces its geometry by the generic geometries from dune-grid. These are linear (respectively n-linear) DUNE geometries interpolating some given corners. These corners are obtained by mapping the corners of the host grid's geometry (also called host geometry) by a coordinate function.
An example of a coordinate function is given by the following code:
HostGrid | DUNE grid to be wrapped (called host grid) |
CoordFunction | coordinate function |
typedef Communication Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::CollectiveCommunication |
typedef Traits::Communication Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::Communication |
communicator with all other processes having some part of the grid
typedef Traits::ctype Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::ctype |
type of vector coordinates (e.g., double)
typedef Traits::GlobalIdSet Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::GlobalIdSet |
type of global id set
The id set assigns a unique identifier to each entity within the grid. This identifier is unique over all processes sharing this grid.
The global id set is a model of Dune::IdSet.
typedef Traits::HierarchicIterator Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::HierarchicIterator |
iterator over the grid hierarchy
typedef GridFamily::Traits::LeafGridView Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::LeafGridView |
type of view for leaf grid
typedef Traits::LeafIndexSet Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::LeafIndexSet |
type of leaf index set
The index set assigns consecutive indices to the entities of the leaf grid. The indices are of integral type and can be used to access arrays.
The leaf index set is a model of Dune::IndexSet.
typedef Traits::LeafIntersectionIterator Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::LeafIntersectionIterator |
iterator over intersections with other entities on the leaf level
typedef GridFamily::Traits::LevelGridView Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::LevelGridView |
type of view for level grid
typedef Traits::LevelIndexSet Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::LevelIndexSet |
type of level index set
The index set assigns consecutive indices to the entities of a grid level. The indices are of integral type and can be used to access arrays.
The level index set is a model of Dune::IndexSet.
typedef Traits::LevelIntersectionIterator Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::LevelIntersectionIterator |
iterator over intersections with other entities on the same level
typedef Traits::LocalIdSet Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::LocalIdSet |
type of local id set
The id set assigns a unique identifier to each entity within the grid. This identifier needs only to be unique over this process.
Though the local id set may be identical to the global id set, it is often implemented more efficiently.
The global id set is a model of Dune::IdSet.
typedef GridFamily::Traits Dune::GeometryGrid< HostGrid, CoordFunction, Allocator >::Traits |
type of the grid traits
|
inline |
constructor
The references to host grid and coordinate function are stored in the grid. Therefore, they must remain valid until the grid is destroyed.
[in] | hostGrid | reference to the grid to wrap |
[in] | coordFunction | reference to the coordinate function |
[in] | allocator | storage allocator |
|
inline |
constructor
The grid takes ownership of the pointers to host grid and coordinate function. They will be deleted when the grid is destroyed.
[in] | hostGrid | shared pointer to the grid to wrap |
[in] | coordFunction | shared pointer to the coordinate function |
[in] | allocator | storage allocator |
|
inline |
constructor
The grid takes ownership of the pointer to host grid and it will be deleted when the grid is destroyed. The coordinate function is automatically constructed.
[in] | hostGrid | shared pointer to the grid to wrap |
[in] | allocator | storage allocator |
|
inline |
|
inlineprotected |
|
inline |
obtain Communication object
The Communication object should be used to globally communicate information between all processes sharing this grid.
|
inline |
obtain mutable reference to the coordinate function.
|
inline |
obtain constant reference to the coordinate function
|
inlineprotected |
|
inline |
obtain Entity from EntitySeed
EntitySeed survives to a grid modification which only changes the grid coordinates. Therefore it is consistent to use an EntitySeed to rebuild an Entity after this kind of grid modification.
An example of this is given by the following code:
|
inlinestaticprotected |
|
inline |
|
inline |
|
inline |
|
inline |
obtain mutable reference to the host grid
|
inline |
obtain constant reference to the host grid
|
inline |
View for the leaf grid.
|
inline |
|
inline |
View for a grid level.
|
inline |
|
inline |
|
inline |
|
inline |
obtain maximal grid level
Grid levels are numbered 0, ..., L, where L is the value returned by this method.
|
inline |
returns the number of boundary segments within the macro grid
|
inline |
|
inline |
|
inline |
obtain number of leaf entities
|
inline |
obtain number of leaf entities
[in] | codim | codimension to consider |
|
inline |
obtain number of entites on a level
[in] | level | level to consider |
[in] | type | geometry type to consider |
|
inline |
obtain number of entites on a level
[in] | level | level to consider |
[in] | codim | codimension to consider |
|
inline |
update grid caches
This method has to be called whenever the underlying host grid changes.