Dune Core Modules (2.3.1)

persistentcontainerinterface.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH
4#define DUNE_PERSISTENTCONTAINERINTERFACE_HH
5
6#ifndef HEADERCHECK
7#error "This header exists for documentation purposes only and should never be included directly."
8#endif
9
10namespace Dune
11{
12
51 template< class G, class T >
53 {
55
57
58 public:
59 typedef G Grid;
60
61 typedef T Value;
62
66
67 // construction
68
77 PersistentContainerInterface ( Grid &grid, int codim, const Value &value = Value() );
78
81
83 const This &operator= ( const This &other );
84
85 // element access
86
91 template< class Entity >
92 const Value &operator[] ( const Entity &entity ) const;
93
98 template< class Entity >
99 Value &operator[] ( const Entity &entity );
100
106 template< class Entity >
107 const Value &operator() ( const Entity &entity, int subEntity ) const;
108
114 template< class Entity >
115 Value &operator() ( const Entity &entity, int subEntity );
116
117 // capacity
118
124 Size size () const;
125
136 void resize ( const Value &value = Value() );
137
151 void shrinkToFit ();
152
153 // modifiers
154
160 void fill ( const Value &value );
161
166 void swap ( This &other );
167
168 // iterators
169
182
195
196 // information
197
199 int codimension () const;
200 };
201
202} // namespace Dune
203
204#endif // #ifndef DUNE_PERSISTENTCONTAINERINTERFACE_HH
Wrapper class for entities.
Definition: entity.hh:57
Persistent storage of data on all entities of a grid.
Definition: persistentcontainerinterface.hh:53
PersistentContainerInterface(Grid &grid, int codim, const Value &value=Value())
constuctor
const Value & operator[](const Entity &entity) const
access the data associated with an entity
Size size() const
number of entries in the container
PersistentContainerInterface(const This &other)
copy constructor
ConstIterator end() const
returns an iterator pointing to the last element of the container
ConstIterator begin() const
returns an iterator pointing to the first element of the container
Iterator begin()
returns an iterator pointing to the first element of the container
Iterator end()
returns an iterator pointing to the last element of the container
void shrinkToFit()
remove unnecessary entries from container
int codimension() const
return the codimension, the container attaches data to
void swap(This &other)
exchange the content of the container with another one
void resize(const Value &value=Value())
reserve memory for all entities in the grid
void fill(const Value &value)
set all accessible entries to a given value
const Value & operator()(const Entity &entity, int subEntity) const
access the data associated with a subentity
const This & operator=(const This &other)
assignment operator
Dune namespace.
Definition: alignment.hh:14
Dummy struct used for documentation purposes.
Definition: documentation.hh:39
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)