33 #ifndef __H__LIBGRID__SUBSET_HANDLER_MULTI_GRID__
34 #define __H__LIBGRID__SUBSET_HANDLER_MULTI_GRID__
41 #include "../lib_grid_messages.h"
77 inline void level_required(
int level);
83 template <
class TGeomObj>
84 inline uint get_level(TGeomObj* obj)
const {
return m_pMG->get_level(obj);}
90 void assign_subset(
Vertex* elem,
int subsetIndex);
94 void assign_subset(
Edge* elem,
int subsetIndex);
98 void assign_subset(
Face* elem,
int subsetIndex);
102 void assign_subset(
Volume* elem,
int subsetIndex);
108 template <
class TElem>
110 begin(
int subsetIndex,
int level);
114 template <
class TElem>
116 end(
int subsetIndex,
int level);
121 template <
class TElem>
123 begin(
int subsetIndex,
int level)
const;
128 template <
class TElem>
130 end(
int subsetIndex,
int level)
const;
133 template <
class TElem>
137 template <
class TElem>
138 uint num(
int subsetIndex)
const;
141 template <
class TElem>
142 uint num(
int subsetIndex,
int level)
const;
145 template <
class TElem>
146 void clear_subset_elements(
int subsetIndex);
149 template <
class TElem>
150 void clear_subset_elements(
int subsetIndex,
int level);
156 get_grid_objects(
int subsetIndex,
int level)
const;
162 get_grid_objects_in_subset(
int subsetIndex)
const;
169 get_grid_objects_in_level(
int level)
const;
207 virtual bool contains_edges(
int subsetIndex)
const {
return num<Edge>(subsetIndex) > 0;}
210 virtual bool contains_faces(
int subsetIndex)
const {
return num<Face>(subsetIndex) > 0;}
213 virtual bool contains_volumes(
int subsetIndex)
const {
return num<Volume>(subsetIndex) > 0;}
217 virtual void grid_to_be_destroyed(
Grid* grid);
229 virtual void erase_subset_lists();
232 void erase_subset_lists_impl();
235 void clear_subset_lists(
int index);
241 void change_subset_indices(
int indOld,
int indNew);
245 void add_required_subset_lists(
int maxIndex);
248 void erase_subset_lists(
int index);
251 void swap_subset_lists(
int ind1,
int ind2);
254 void move_subset_lists(
int indexFrom,
int indexTo);
257 virtual void join_subset_lists(
int target,
int src1,
int src2);
265 template<
class TElem>
266 void assign_subset_impl(TElem* elem,
int subsetIndex);
269 template<
class TElem>
270 void change_elem_subset_indices(
int indOld,
int indNew);
273 inline void level_required(
int level)
const;
276 void add_subset_to_all_levels();
279 template <
class TElem>
306 inline const Subset*
subset(
int si,
int level)
const {
return m_levels[level][si];}
309 Subset* new_subset();
317 inline VertexSectionContainer::iterator
320 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
321 return subset(get_subset_index(o), m_pMG->get_level(o))->
322 m_vertices.get_container().get_iterator(o);
325 inline EdgeSectionContainer::iterator
328 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
329 return subset(get_subset_index(o), m_pMG->get_level(o))->
330 m_edges.get_container().get_iterator(o);
333 inline FaceSectionContainer::iterator
336 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
337 return subset(get_subset_index(o), m_pMG->get_level(o))->
338 m_faces.get_container().get_iterator(o);
341 inline VolumeSectionContainer::iterator
344 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
345 return subset(get_subset_index(o), m_pMG->get_level(o))->
346 m_volumes.get_container().get_iterator(o);
351 template <
class TElem>
inline
353 section_container(
int si,
int lvl);
356 template <
class TElem>
inline
358 section_container(
int si,
int lvl)
const;
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
Definition: subset_handler_interface.h:223
Grid::traits< Edge >::SectionContainer EdgeSectionContainer
Definition: subset_handler_interface.h:562
Grid::traits< Edge >::AttachedElementList AttachedEdgeList
Definition: subset_handler_interface.h:557
Grid::traits< Vertex >::SectionContainer VertexSectionContainer
Definition: subset_handler_interface.h:561
Grid::traits< Vertex >::AttachedElementList AttachedVertexList
enable subset-attachment support
Definition: subset_handler_interface.h:556
void assign_subset(TIterator iterBegin, TIterator iterEnd, int subsetIndex)
Definition: subset_handler_interface_impl.hpp:170
Grid::traits< Face >::AttachedElementList AttachedFaceList
Definition: subset_handler_interface.h:558
Grid::traits< Volume >::AttachedElementList AttachedVolumeList
Definition: subset_handler_interface.h:559
Grid::traits< Face >::SectionContainer FaceSectionContainer
Definition: subset_handler_interface.h:563
Grid::traits< Volume >::SectionContainer VolumeSectionContainer
Definition: subset_handler_interface.h:564
Definition: multi_grid.h:72
Handles subsets on a per level basis.
Definition: subset_handler_multi_grid.h:60
uint num_subsets_in_list() const
returns the number of subsets in the local list
Definition: subset_handler_multi_grid.h:221
const MultiGrid * multi_grid() const
Definition: subset_handler_multi_grid.h:74
virtual bool contains_vertices(int subsetIndex) const
collects all vertices that are in the given subset.
Definition: subset_handler_multi_grid.h:204
AttachedFaceList::AEntry m_aSharedEntryFACE
Definition: subset_handler_multi_grid.h:373
FaceSectionContainer::iterator get_list_iterator(Face *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_multi_grid.h:334
size_t collect_subset_elements_impl(std::vector< TElem * > &elemsOut, int subsetIndex) const
helper for collect_subset_elements
MultiGrid * m_pMG
Definition: subset_handler_multi_grid.h:364
AttachedEdgeList::AEntry m_aSharedEntryEDGE
Definition: subset_handler_multi_grid.h:372
const Subset * subset(int si, int level) const
Definition: subset_handler_multi_grid.h:306
LevelVec m_levels
Definition: subset_handler_multi_grid.h:365
MessageHub::SPCallbackId m_callbackId
Definition: subset_handler_multi_grid.h:369
virtual bool contains_edges(int subsetIndex) const
returns true if the subset contains edges
Definition: subset_handler_multi_grid.h:207
MultiGrid * multi_grid()
Definition: subset_handler_multi_grid.h:73
AttachedVolumeList::AEntry m_aSharedEntryVOL
Definition: subset_handler_multi_grid.h:374
Subset * subset(int si, int level)
returns the subset with index si on the given level
Definition: subset_handler_multi_grid.h:305
virtual bool contains_volumes(int subsetIndex) const
returns true if the subset contains volumes
Definition: subset_handler_multi_grid.h:213
AttachedVertexList::AEntry m_aSharedEntryVRT
Definition: subset_handler_multi_grid.h:371
VolumeSectionContainer::iterator get_list_iterator(Volume *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_multi_grid.h:342
uint get_level(TGeomObj *obj) const
returns the level in which an element is located
Definition: subset_handler_multi_grid.h:84
VertexSectionContainer::iterator get_list_iterator(Vertex *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_multi_grid.h:318
uint num_levels() const
returns the number of levels
Definition: subset_handler_multi_grid.h:80
virtual bool contains_faces(int subsetIndex) const
returns true if the subset contains faces
Definition: subset_handler_multi_grid.h:210
std::vector< Subset * > SubsetVec
Definition: subset_handler_multi_grid.h:301
EdgeSectionContainer::iterator get_list_iterator(Edge *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_multi_grid.h:326
std::vector< SubsetVec > LevelVec
Definition: subset_handler_multi_grid.h:302
int m_numSubsets
Definition: subset_handler_multi_grid.h:366
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
size_t target(SM_edge< typename T::value_type > const &e, ug::BidirectionalMatrix< T > const &m)
Definition: bidirectional_boost.h:100
MultiGridSubsetHandler MGSubsetHandler
Definition: subset_handler_multi_grid.h:377
Definition: subset_handler_multi_grid.h:294
VolumeSectionContainer m_volumes
Definition: subset_handler_multi_grid.h:298
FaceSectionContainer m_faces
Definition: subset_handler_multi_grid.h:297
EdgeSectionContainer m_edges
Definition: subset_handler_multi_grid.h:296
VertexSectionContainer m_vertices
Definition: subset_handler_multi_grid.h:295