dune-grid 2.9.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Dune::PersistentContainerVector< G, IndexSet, Vector > Class Template Reference

vector-based implementation of the PersistentContainer More...

#include <dune/grid/utility/persistentcontainervector.hh>

Inheritance diagram for Dune::PersistentContainerVector< G, IndexSet, Vector >:
Inheritance graph

Public Types

typedef G Grid
 
typedef Vector::value_type Value
 
typedef Vector::size_type Size
 
typedef Vector::const_iterator ConstIterator
 
typedef Vector::iterator Iterator
 
typedef Vector::allocator_type Allocator
 

Public Member Functions

 PersistentContainerVector (const IndexSet &indexSet, int codim, const Value &value, const Allocator &allocator=Allocator())
 
template<class Entity >
const Valueoperator[] (const Entity &entity) const
 
template<class Entity >
Valueoperator[] (const Entity &entity)
 
template<class Entity >
const Valueoperator() (const Entity &entity, int subEntity) const
 
template<class Entity >
Valueoperator() (const Entity &entity, int subEntity)
 
Size size () const
 
void resize (const Value &value=Value())
 
void shrinkToFit ()
 
void fill (const Value &value)
 
void swap (This &other)
 
ConstIterator begin () const
 
Iterator begin ()
 
ConstIterator end () const
 
Iterator end ()
 
int codimension () const
 

Protected Member Functions

const IndexSetindexSet () const
 

Protected Attributes

int codim_
 
const IndexSetindexSet_
 
Vector data_
 

Detailed Description

template<class G, class IndexSet, class Vector>
class Dune::PersistentContainerVector< G, IndexSet, Vector >

vector-based implementation of the PersistentContainer

Some grid implementations, like YaspGrid, can provide consecutive, zero-based, persistent indices for the entire grid hierarchy. This implementation of a PersistentContainer uses such an index set and a std::vector-like container to store user data in an efficient and persistent manner.

Note
The persistent index set is actually allowed to be non-consecutive, i.e., some indices might not be assigned to an entity. As the result of the size method on the index set is used to allocate storage for the vector, it must be larger than the largest used index.
It is sufficient if the index set provides indices to the codimension the persistent container is created for. Neither the method types() nor the method contains() need to be implemented.
The persistent container is currently restricted to index sets containing a single geometry type.
Todo:
Actually, we use a mapper rather than an index set. This would automatically resolve two problems:
  • support multiple geometry types,
  • the requirement to store a reference to the index set .
Template Parameters
Gtype of grid
IndexSettype of persistent index set
Vectortype of vector to store the data in

Member Typedef Documentation

◆ Allocator

template<class G , class IndexSet , class Vector >
typedef Vector::allocator_type Dune::PersistentContainerVector< G, IndexSet, Vector >::Allocator

◆ ConstIterator

template<class G , class IndexSet , class Vector >
typedef Vector::const_iterator Dune::PersistentContainerVector< G, IndexSet, Vector >::ConstIterator

◆ Grid

template<class G , class IndexSet , class Vector >
typedef G Dune::PersistentContainerVector< G, IndexSet, Vector >::Grid

◆ Iterator

template<class G , class IndexSet , class Vector >
typedef Vector::iterator Dune::PersistentContainerVector< G, IndexSet, Vector >::Iterator

◆ Size

template<class G , class IndexSet , class Vector >
typedef Vector::size_type Dune::PersistentContainerVector< G, IndexSet, Vector >::Size

◆ Value

template<class G , class IndexSet , class Vector >
typedef Vector::value_type Dune::PersistentContainerVector< G, IndexSet, Vector >::Value

Constructor & Destructor Documentation

◆ PersistentContainerVector()

template<class G , class IndexSet , class Vector >
Dune::PersistentContainerVector< G, IndexSet, Vector >::PersistentContainerVector ( const IndexSet indexSet,
int  codim,
const Value value,
const Allocator allocator = Allocator() 
)
inline

Member Function Documentation

◆ begin() [1/2]

template<class G , class IndexSet , class Vector >
Iterator Dune::PersistentContainerVector< G, IndexSet, Vector >::begin ( )
inline

◆ begin() [2/2]

template<class G , class IndexSet , class Vector >
ConstIterator Dune::PersistentContainerVector< G, IndexSet, Vector >::begin ( ) const
inline

◆ codimension()

template<class G , class IndexSet , class Vector >
int Dune::PersistentContainerVector< G, IndexSet, Vector >::codimension ( ) const
inline

◆ end() [1/2]

template<class G , class IndexSet , class Vector >
Iterator Dune::PersistentContainerVector< G, IndexSet, Vector >::end ( )
inline

◆ end() [2/2]

template<class G , class IndexSet , class Vector >
ConstIterator Dune::PersistentContainerVector< G, IndexSet, Vector >::end ( ) const
inline

◆ fill()

template<class G , class IndexSet , class Vector >
void Dune::PersistentContainerVector< G, IndexSet, Vector >::fill ( const Value value)
inline

◆ indexSet()

template<class G , class IndexSet , class Vector >
const IndexSet & Dune::PersistentContainerVector< G, IndexSet, Vector >::indexSet ( ) const
inlineprotected

◆ operator()() [1/2]

template<class G , class IndexSet , class Vector >
template<class Entity >
Value & Dune::PersistentContainerVector< G, IndexSet, Vector >::operator() ( const Entity entity,
int  subEntity 
)
inline

◆ operator()() [2/2]

template<class G , class IndexSet , class Vector >
template<class Entity >
const Value & Dune::PersistentContainerVector< G, IndexSet, Vector >::operator() ( const Entity entity,
int  subEntity 
) const
inline

◆ operator[]() [1/2]

template<class G , class IndexSet , class Vector >
template<class Entity >
Value & Dune::PersistentContainerVector< G, IndexSet, Vector >::operator[] ( const Entity entity)
inline

◆ operator[]() [2/2]

template<class G , class IndexSet , class Vector >
template<class Entity >
const Value & Dune::PersistentContainerVector< G, IndexSet, Vector >::operator[] ( const Entity entity) const
inline

◆ resize()

template<class G , class IndexSet , class Vector >
void Dune::PersistentContainerVector< G, IndexSet, Vector >::resize ( const Value value = Value())
inline

◆ shrinkToFit()

template<class G , class IndexSet , class Vector >
void Dune::PersistentContainerVector< G, IndexSet, Vector >::shrinkToFit ( )
inline

◆ size()

template<class G , class IndexSet , class Vector >
Size Dune::PersistentContainerVector< G, IndexSet, Vector >::size ( ) const
inline

◆ swap()

template<class G , class IndexSet , class Vector >
void Dune::PersistentContainerVector< G, IndexSet, Vector >::swap ( This other)
inline

Member Data Documentation

◆ codim_

template<class G , class IndexSet , class Vector >
int Dune::PersistentContainerVector< G, IndexSet, Vector >::codim_
protected

◆ data_

template<class G , class IndexSet , class Vector >
Vector Dune::PersistentContainerVector< G, IndexSet, Vector >::data_
protected

◆ indexSet_

template<class G , class IndexSet , class Vector >
const IndexSet* Dune::PersistentContainerVector< G, IndexSet, Vector >::indexSet_
protected

The documentation for this class was generated from the following file: