5 #ifndef DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH 6 #define DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH 17 #include "../yaspgrid.hh" 33 template<
typename Gr
id>
34 class YaspPersistentContainerIndex
39 : _grid(grid), _codim(codim)
48 template<
class Entity>
52 std::size_t level = e.
level();
53 return _grid.indexsets[level]->template index<cc>(e) + _offsets[level];
57 template<
class Entity >
62 std::size_t level = e.
level();
63 return _grid.indexsets[level]->template subIndex<cc>(e,i,codim) + _offsets[level];
67 std::size_t
size (
int )
const 69 if (_grid.indexsets.
size()+1 != _offsets.size())
71 return _offsets.back();
75 void recomputeOffsets()
const 77 _offsets.resize(_grid.indexsets.
size()+1,0);
79 for (std::size_t i=0; i<_grid.indexsets.
size(); i++)
80 _offsets[i+1] = _offsets[i] + _grid.indexsets[i]->
size(_codim);
85 mutable std::vector<std::size_t> _offsets;
94 template<
int dim,
class CoordCont,
class T>
102 YaspPersistentContainerIndex< const YaspGrid<dim, CoordCont> >,
116 Base(*this, codim, value)
122 #endif // end DUNE_GRID_YASPGRIDPERSISTENTCONTAINER_HH vector-based implementation of the PersistentContainer
Definition: persistentcontainervector.hh:50
G Grid
Definition: persistentcontainervector.hh:55
int level() const
The level of this entity.
Definition: common/entity.hh:124
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.
Definition: common/grid.hh:375
YaspPersistentContainerIndex(const Grid &grid, int codim)
Definition: yaspgridpersistentcontainer.hh:38
Vector::value_type Value
Definition: persistentcontainervector.hh:57
[ provides Dune::Grid ]
Definition: yaspgrid.hh:54
int size(int level, int codim) const
Return number of grid entities of a given codim on a given level in this process. ...
Definition: common/grid.hh:538
PersistentContainer(const Grid &grid, int codim, const Value &value=Value())
Definition: yaspgridpersistentcontainer.hh:114
Size size() const
Definition: persistentcontainermap.hh:85
Definition: yaspgrid.hh:64
Base::Value Value
Definition: utility/persistentcontainer.hh:27
std::size_t size(int) const
Return total number of entities of given geometry type in entity set .
Definition: yaspgridpersistentcontainer.hh:67
Include standard header files.
Definition: agrid.hh:59
IndexType subIndex(const Entity &e, int i, unsigned int codim) const
Map a subentity to an index.
Definition: yaspgridpersistentcontainer.hh:58
static constexpr int codimension
Know your own codimension.
Definition: common/entity.hh:106
Base::Grid Grid
Definition: yaspgridpersistentcontainer.hh:109
concept Grid
Requirements for implementations of the Dune::Grid interface.The Grid concept defines interface requi...
Definition: concepts/grid.hh:109
const Grid & grid() const
Definition: persistentcontainermap.hh:114
Wrapper class for entities.
Definition: common/entity.hh:65
IndexType index(const Entity &e) const
Map entity to index. The result of calling this method with an entity that is not in the index set is...
Definition: yaspgridpersistentcontainer.hh:49
std::size_t IndexType
The type used for the indices.
Definition: yaspgridpersistentcontainer.hh:45
A class for storing data during an adaptation cycle.
Definition: utility/persistentcontainer.hh:20
Base::Value Value
Definition: yaspgridpersistentcontainer.hh:110
concept IndexSet
Model of an index set.
Definition: concepts/indexidset.hh:55