3 #ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH
4 #define DUNE_PERSISTENTCONTAINERVECTOR_HH
47 template<
class G,
class IndexSet,
class Vector >
55 typedef typename Vector::value_type
Value;
56 typedef typename Vector::size_type
Size;
63 const Allocator &allocator =
Allocator() )
66 data_( indexSet.
size( codim ), value, allocator )
69 template<
class Entity >
74 assert( index <
data_.size() );
75 return data_[ index ];
78 template<
class Entity >
83 assert( index <
data_.size() );
84 return data_[ index ];
87 template<
class Entity >
91 assert( index <
data_.size() );
92 return data_[ index ];
95 template<
class Entity >
99 assert( index <
data_.size() );
100 return data_[ index ];
108 data_.resize( indexSetSize, value );
113 void fill (
const Value &value ) { std::fill(
begin(),
end(), value ); }
140 #endif // #ifndef DUNE_PERSISTENTCONTAINERVECTOR_HH
const IndexSet & indexSet() const
Definition: persistentcontainervector.hh:131
Vector::value_type Value
Definition: persistentcontainervector.hh:55
IndexType index(const typename Traits::template Codim< cc >::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: indexidset.hh:115
void fill(const Value &value)
Definition: persistentcontainervector.hh:113
Vector::const_iterator ConstIterator
Definition: persistentcontainervector.hh:57
Know your own codimension.
Definition: common/entity.hh:104
Iterator end()
Definition: persistentcontainervector.hh:126
Include standard header files.
Definition: agrid.hh:59
Vector::allocator_type Allocator
Definition: persistentcontainervector.hh:60
int codim_
Definition: persistentcontainervector.hh:133
void swap(This &other)
Definition: persistentcontainervector.hh:115
Size size() const
Definition: persistentcontainervector.hh:103
Iterator begin()
Definition: persistentcontainervector.hh:123
void shrinkToFit()
Definition: persistentcontainervector.hh:111
Index Set Interface base class.
Definition: common/grid.hh:361
vector-based implementation of the PersistentContainer
Definition: persistentcontainervector.hh:48
ConstIterator begin() const
Definition: persistentcontainervector.hh:122
Vector::iterator Iterator
Definition: persistentcontainervector.hh:58
int codimension() const
Definition: persistentcontainervector.hh:128
G Grid
Definition: persistentcontainervector.hh:53
Vector data_
Definition: persistentcontainervector.hh:135
const Value & operator()(const Entity &entity, int subEntity) const
Definition: persistentcontainervector.hh:88
PersistentContainerVector(const IndexSet &indexSet, int codim, const Value &value, const Allocator &allocator=Allocator())
Definition: persistentcontainervector.hh:62
const IndexSet * indexSet_
Definition: persistentcontainervector.hh:134
Vector::size_type Size
Definition: persistentcontainervector.hh:56
ConstIterator end() const
Definition: persistentcontainervector.hh:125
IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
Map a subentity to an index.
Definition: indexidset.hh:153
const Value & operator[](const Entity &entity) const
Definition: persistentcontainervector.hh:70
void resize(const Value &value=Value())
Definition: persistentcontainervector.hh:105
IndexType size(GeometryType type) const
Return total number of entities of given geometry type in entity set .
Definition: indexidset.hh:232
Wrapper class for entities.
Definition: common/entity.hh:61