33 #ifndef __H__LIBGRID__SUBSET_HANDLER_GRID__
34 #define __H__LIBGRID__SUBSET_HANDLER_GRID__
68 void assign_grid(
Grid* grid);
69 void assign_grid(
Grid& grid);
75 void assign_subset(
Vertex* elem,
int subsetIndex);
79 void assign_subset(
Edge* elem,
int subsetIndex);
83 void assign_subset(
Face* elem,
int subsetIndex);
87 void assign_subset(
Volume* elem,
int subsetIndex);
93 template <
class TElem>
95 begin(
int subsetIndex);
99 template <
class TElem>
101 end(
int subsetIndex);
105 template <
class TElem>
107 begin(
int subsetIndex)
const;
111 template <
class TElem>
113 end(
int subsetIndex)
const;
116 template <
class TElem>
117 uint num_elements(
int subsetIndex)
const;
120 template <
class TElem>
124 template <
class TElem>
125 uint num(
int subsetIndex)
const;
128 template <
class TElem>
inline
132 inline bool empty()
const;
134 template <
class TElem>
inline
135 bool empty(
int subsetIndex)
const;
138 inline bool empty(
int subsetIndex)
const;
141 template <
class TElem>
142 void clear_subset_elements(
int subsetIndex);
146 get_grid_objects_in_subset(
int subsetIndex)
const;
150 get_grid_objects()
const;
188 virtual bool contains_edges(
int subsetIndex)
const {
return num<Edge>(subsetIndex) > 0;}
191 virtual bool contains_faces(
int subsetIndex)
const {
return num<Face>(subsetIndex) > 0;}
194 virtual bool contains_volumes(
int subsetIndex)
const {
return num<Volume>(subsetIndex) > 0;}
197 template <
class TElem>
198 bool perform_self_tests();
210 template <
class TElem>
212 begin(
int subsetIndex,
size_t)
const {
return begin<TElem>(subsetIndex);}
218 template <
class TElem>
220 end(
int subsetIndex,
size_t)
const {
return end<TElem>(subsetIndex);}
225 template <
class TElem>
231 template <
class TElem>
232 uint num(
int subsetIndex,
size_t)
const {
return num<TElem>();}
236 virtual void grid_to_be_destroyed(
Grid* grid);
258 virtual void erase_subset_lists();
261 void erase_subset_lists_impl();
264 virtual void clear_subset_lists(
int index);
270 virtual void change_subset_indices(
int indOld,
int indNew);
274 void add_required_subset_lists(
int maxIndex);
277 void erase_subset_lists(
int index);
280 void swap_subset_lists(
int ind1,
int ind2);
283 void move_subset_lists(
int indexFrom,
int indexTo);
286 void join_subset_lists(
int target,
int src1,
int src2);
294 template<
class TElem>
inline
295 void assign_subset_impl(TElem* elem,
int subsetIndex);
298 template<
class TElem>
299 void change_elem_subset_indices(
int indOld,
int indNew);
312 inline VertexSectionContainer::iterator
315 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
316 return section_container<Vertex>(get_subset_index(o)).
317 get_container().get_iterator(o);
320 inline EdgeSectionContainer::iterator
323 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
324 return section_container<Edge>(get_subset_index(o)).
325 get_container().get_iterator(o);
328 inline FaceSectionContainer::iterator
331 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
332 return section_container<Face>(get_subset_index(o)).
333 get_container().get_iterator(o);
336 inline VolumeSectionContainer::iterator
339 assert((get_subset_index(o) >= 0) &&
"invalid subset.");
340 return section_container<Volume>(get_subset_index(o)).
341 get_container().get_iterator(o);
346 template <
class TElem>
inline
348 section_container(
int si);
351 template <
class TElem>
inline
353 section_container(
int si)
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 helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
Partitions elements of a grid into several subsets.
Definition: subset_handler_grid.h:53
VertexSectionContainer::iterator get_list_iterator(Vertex *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_grid.h:313
std::vector< Subset * > SubsetVec
Definition: subset_handler_grid.h:364
virtual bool contains_volumes(int subsetIndex) const
returns true if the subset contains volumes
Definition: subset_handler_grid.h:194
AttachedVertexList::AEntry m_aSharedEntryVRT
Definition: subset_handler_grid.h:369
uint num(int subsetIndex, size_t) const
returns the number of elements in the given subset
Definition: subset_handler_grid.h:232
uint num_levels() const
returns number of levels (always 1)
Definition: subset_handler_grid.h:204
virtual bool contains_edges(int subsetIndex) const
returns true if the subset contains edges
Definition: subset_handler_grid.h:188
AttachedFaceList::AEntry m_aSharedEntryFACE
Definition: subset_handler_grid.h:371
EdgeSectionContainer::iterator get_list_iterator(Edge *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_grid.h:321
SubsetVec m_subsets
Definition: subset_handler_grid.h:367
virtual bool contains_faces(int subsetIndex) const
returns true if the subset contains faces
Definition: subset_handler_grid.h:191
FaceSectionContainer::iterator get_list_iterator(Face *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_grid.h:329
AttachedVolumeList::AEntry m_aSharedEntryVOL
Definition: subset_handler_grid.h:372
AttachedEdgeList::AEntry m_aSharedEntryEDGE
Definition: subset_handler_grid.h:370
uint num_subsets_in_list() const
returns the number of subsets in the local list
Definition: subset_handler_grid.h:250
VolumeSectionContainer::iterator get_list_iterator(Volume *o)
returns the iterator at which the given element lies in the section container
Definition: subset_handler_grid.h:337
geometry_traits< TElem >::const_iterator begin(int subsetIndex, size_t) const
returns the begin-iterator for the elements of type TElem in the given subset.
Definition: subset_handler_grid.h:212
virtual bool contains_vertices(int subsetIndex) const
collects all vertices that are in the given subset.
Definition: subset_handler_grid.h:185
uint num_elements(int subsetIndex, size_t) const
returns the number of elements in the given subset
Definition: subset_handler_grid.h:226
geometry_traits< TElem >::const_iterator end(int subsetIndex, size_t) const
returns the end-iterator for the elements of type TElem in the given subset.
Definition: subset_handler_grid.h:220
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
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
GridSubsetHandler SubsetHandler
Definition: subset_handler_grid.h:376
Definition: subset_handler_grid.h:357
EdgeSectionContainer m_edges
Definition: subset_handler_grid.h:359
FaceSectionContainer m_faces
Definition: subset_handler_grid.h:360
VertexSectionContainer m_vertices
Definition: subset_handler_grid.h:358
VolumeSectionContainer m_volumes
Definition: subset_handler_grid.h:361