38 #ifndef __H__LIBGRID__SELECTOR_MULTI_GRID__
39 #define __H__LIBGRID__SELECTOR_MULTI_GRID__
43 #include "../multi_grid.h"
44 #include "../lib_grid_messages.h"
116 template <
class TElem,
class TMGSelector,
class TLevelIterator>
135 m_iter = iter.m_iter;
163 return m_iter == other.
m_iter;
170 while((m_iter == m_sel->template end<TElem>(m_lvl))
171 && (m_lvl + 1 < m_sel->num_levels()))
174 m_iter = m_sel->template begin<TElem>(m_lvl);
191 template <
class TElem>
216 inline void set_supported_elements(
uint shElements);
222 inline void enable_element_support(
uint shElements);
228 void disable_element_support(
uint shElements);
233 size_t l = m_levels.size();
240 virtual void clear();
242 template <
class TElem>
245 void clear(
int level);
247 template <
class TElem>
248 inline void clear(
int level);
250 template <
class TElem>
251 inline size_t num(
int level)
const;
253 inline size_t num(
int level)
const;
255 template <
class TElem>
256 inline size_t num()
const;
258 inline size_t num()
const;
261 inline bool empty(
int level)
const;
263 template <
class TElem>
264 inline bool empty(
int level)
const;
266 inline bool empty()
const;
268 template <
class TElem>
269 inline bool empty()
const;
272 template <
class TElem>
273 inline typename traits<TElem>::iterator
276 template <
class TElem>
277 inline typename traits<TElem>::const_iterator
280 template <
class TElem>
281 inline typename traits<TElem>::level_iterator
284 template <
class TElem>
285 inline typename traits<TElem>::const_level_iterator
286 begin(
int level)
const;
289 template <
class TElem>
290 inline typename traits<TElem>::iterator
293 template <
class TElem>
294 inline typename traits<TElem>::const_iterator
297 template <
class TElem>
298 inline typename traits<TElem>::level_iterator
301 template <
class TElem>
302 inline typename traits<TElem>::const_level_iterator
303 end(
int level)
const;
318 template <
class TElem> TElem* front(
int level);
323 template <
class TElem> TElem* back(
int level);
334 virtual void grid_to_be_destroyed(
Grid* grid);
351 virtual void add_to_list(
Vertex* elem);
352 virtual void add_to_list(
Edge* elem);
353 virtual void add_to_list(
Face* elem);
354 virtual void add_to_list(
Volume* elem);
356 virtual void erase_from_list(
Vertex* elem);
357 virtual void erase_from_list(
Edge* elem);
358 virtual void erase_from_list(
Face* elem);
359 virtual void erase_from_list(
Volume* elem);
382 template <
class TElem>
inline
384 section_container(
int level);
387 template <
class TElem>
inline
389 section_container(
int level)
const;
391 template <
class TElem>
392 inline int get_section_index()
const;
394 inline void level_required(
int newSize);
407 assert(is_selected(o) &&
"object not selected.");
408 return section_container<Vertex>(m_pMultiGrid->get_level(o)).
409 get_container().get_iterator(o);
412 inline EdgeSectionContainer::iterator
415 assert(is_selected(o) &&
"object not selected");
416 return section_container<Edge>(m_pMultiGrid->get_level(o)).
417 get_container().get_iterator(o);
420 inline FaceSectionContainer::iterator
423 assert(is_selected(o) &&
"object not selected");
424 return section_container<Face>(m_pMultiGrid->get_level(o)).
425 get_container().get_iterator(o);
428 inline VolumeSectionContainer::iterator
431 assert(is_selected(o) &&
"object not selected");
432 return section_container<Volume>(m_pMultiGrid->get_level(o)).
433 get_container().get_iterator(o);
A special iterator which allows to iterate over elements in a AttachedElementList.
Definition: attached_list.h:52
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
A message sent by the MultiGrid, if something special happened.
Definition: lib_grid_messages.h:51
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
base-implementation of a selector
Definition: selector_interface.h:126
Grid::traits< Face >::SectionContainer FaceSectionContainer
Definition: selector_interface.h:325
Grid::traits< Edge >::AttachedElementList AttachedEdgeList
Definition: selector_interface.h:319
Grid::traits< Vertex >::AttachedElementList AttachedVertexList
Definition: selector_interface.h:318
Grid::traits< Edge >::SectionContainer EdgeSectionContainer
Definition: selector_interface.h:324
Grid::traits< Face >::AttachedElementList AttachedFaceList
Definition: selector_interface.h:320
Grid::traits< Vertex >::SectionContainer VertexSectionContainer
Definition: selector_interface.h:323
Grid::traits< Volume >::SectionContainer VolumeSectionContainer
Definition: selector_interface.h:326
Grid::traits< Volume >::AttachedElementList AttachedVolumeList
Definition: selector_interface.h:321
Definition: selector_multi_grid.h:118
TElem * value_type
Definition: selector_multi_grid.h:124
size_t difference_type
Definition: selector_multi_grid.h:122
size_t m_lvl
Definition: selector_multi_grid.h:186
std::forward_iterator_tag iterator_category
Definition: selector_multi_grid.h:121
value_type & reference
Definition: selector_multi_grid.h:125
TLevelIterator level_iterator
Definition: selector_multi_grid.h:151
MGSelectionIterator(TMGSelector *sel, int lvl, level_iterator iter)
Definition: selector_multi_grid.h:153
value_type dereference() const
dereference
Definition: selector_multi_grid.h:179
MGSelectionIterator()
Definition: selector_multi_grid.h:127
TMGSelector * m_sel
Definition: selector_multi_grid.h:185
TElem ** pointer
Definition: selector_multi_grid.h:123
MGSelectionIterator this_type
Definition: selector_multi_grid.h:120
level_iterator m_iter
Definition: selector_multi_grid.h:187
MGSelectionIterator(const MGSelectionIterator< TElem, MGSelector, typename geometry_traits< TElem >::iterator > &iter)
copy constructor that allows creation of const-iterators from non-const iterators
Definition: selector_multi_grid.h:130
void increment()
returns next valid iterator
Definition: selector_multi_grid.h:167
bool equal(const this_type &other) const
Definition: selector_multi_grid.h:161
specialization of ISelector for grids of class MultiGrid.
Definition: selector_multi_grid.h:108
MultiGrid * m_pMultiGrid
Copy Constructor not yet implemented!
Definition: selector_multi_grid.h:441
virtual bool contains_faces() const
returns true if the selector contains faces
Definition: selector_multi_grid.h:343
traits< Vertex >::level_iterator vertices_begin(int level)
Definition: selector_multi_grid.h:306
AttachedVertexList::AEntry m_aSharedEntryVRT
Definition: selector_multi_grid.h:453
traits< Volume >::level_iterator volumes_begin(int level)
Definition: selector_multi_grid.h:312
VertexIterator m_tmpVEnd
Definition: selector_multi_grid.h:447
AttachedFaceList::AEntry m_aSharedEntryFACE
Definition: selector_multi_grid.h:455
traits< Edge >::level_iterator edges_begin(int level)
Definition: selector_multi_grid.h:308
EdgeSectionContainer::iterator get_level_iterator(Edge *o)
returns the iterator at which the given element lies in the section container
Definition: selector_multi_grid.h:413
VertexSectionContainer::iterator get_level_iterator(Vertex *o)
returns the iterator at which the given element lies in the section container
Definition: selector_multi_grid.h:405
size_t top_level() const
Definition: selector_multi_grid.h:231
LevelVec m_levels
Definition: selector_multi_grid.h:445
traits< Vertex >::level_iterator vertices_end(int level)
Definition: selector_multi_grid.h:307
std::vector< Level * > LevelVec
Definition: selector_multi_grid.h:378
traits< Face >::level_iterator faces_begin(int level)
Definition: selector_multi_grid.h:310
MessageHub::SPCallbackId m_callbackId
Definition: selector_multi_grid.h:450
traits< Edge >::level_iterator edges_end(int level)
Definition: selector_multi_grid.h:309
FaceSectionContainer::iterator get_level_iterator(Face *o)
returns the iterator at which the given element lies in the section container
Definition: selector_multi_grid.h:421
AttachedVolumeList::AEntry m_aSharedEntryVOL
Definition: selector_multi_grid.h:456
traits< Volume >::level_iterator volumes_end(int level)
Definition: selector_multi_grid.h:313
MGSelector(const MGSelector &sel)
Definition: selector_multi_grid.h:441
traits< Face >::level_iterator faces_end(int level)
Definition: selector_multi_grid.h:311
MultiGrid grid_type
Definition: selector_multi_grid.h:111
virtual bool contains_vertices() const
returns true if the selector contains vertices
Definition: selector_multi_grid.h:337
VertexIterator m_tmpVBegin
Definition: selector_multi_grid.h:446
AttachedEdgeList::AEntry m_aSharedEntryEDGE
Definition: selector_multi_grid.h:454
virtual bool contains_volumes() const
returns true if the selector contains volumes
Definition: selector_multi_grid.h:346
size_t num_levels() const
Definition: selector_multi_grid.h:230
MultiGrid * multi_grid()
Definition: selector_multi_grid.h:209
virtual bool contains_edges() const
returns true if the selector contains edges
Definition: selector_multi_grid.h:340
VolumeSectionContainer::iterator get_level_iterator(Volume *o)
returns the iterator at which the given element lies in the section container
Definition: selector_multi_grid.h:429
ISelector BaseClass
Definition: selector_multi_grid.h:110
Definition: multi_grid.h:72
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
Definition: grid_base_object_traits.h:68
#define UG_API
Definition: ug_config.h:65
unsigned int uint
Definition: types.h:114
bool operator==(const MathVector< N, T > &v, const MathVector< N, T > &w)
Definition: math_vector.h:523
bool operator!=(const MathVector< N, T > &v, const MathVector< N, T > &w)
Definition: math_vector.h:552
ElementStorage< Vertex >::SectionContainer::iterator VertexIterator
This Iterator will be used as base-class for iterators of specialized geometric objects.
Definition: grid_base_object_traits.h:73
MatVec_Expression< L, R > operator*(const AlphaMat_Expression< L > &l, const R &r)
create a MatVec_Expression by (alpha*MATRIX) * VECTOR
Definition: template_expressions.h:223
ReferenceObjectID operator++(ReferenceObjectID &roid, int)
Definition: grid_base_objects.h:89
Definition: selector_multi_grid.h:372
FaceSectionContainer m_faces
Definition: selector_multi_grid.h:375
VolumeSectionContainer m_volumes
Definition: selector_multi_grid.h:376
VertexSectionContainer m_vertices
Definition: selector_multi_grid.h:373
EdgeSectionContainer m_edges
Definition: selector_multi_grid.h:374
The traits class holds some important types for each element-type.
Definition: selector_multi_grid.h:192
geometry_traits< TElem >::const_iterator const_level_iterator
Definition: selector_multi_grid.h:195
TElem * value_t
Definition: selector_multi_grid.h:193
MGSelectionIterator< TElem, MGSelector, level_iterator > iterator
Definition: selector_multi_grid.h:197
MGSelectionIterator< TElem, const MGSelector, const_level_iterator > const_iterator
Definition: selector_multi_grid.h:199
geometry_traits< TElem >::iterator level_iterator
Definition: selector_multi_grid.h:194