33 #ifndef __H__LIBGRID__SUBSET_HANDLER_GRID_IMPL__
34 #define __H__LIBGRID__SUBSET_HANDLER_GRID_IMPL__
41 template <
class TElem>
42 typename geometry_traits<TElem>::iterator
44 begin(
int subsetIndex)
49 return iterator_cast<typename geometry_traits<TElem>::iterator>(
53 return iterator_cast<typename geometry_traits<TElem>::iterator>(
54 section_container<TElem>(subsetIndex).begin());
56 return iterator_cast<typename geometry_traits<TElem>::iterator>(
57 section_container<TElem>(subsetIndex).section_begin(sectionInd));
60 template <
class TElem>
68 return iterator_cast<typename geometry_traits<TElem>::iterator>(
72 return iterator_cast<typename geometry_traits<TElem>::iterator>(
73 section_container<TElem>(subsetIndex).end());
75 return iterator_cast<typename geometry_traits<TElem>::iterator>(
76 section_container<TElem>(subsetIndex).section_end(sectionInd));
79 template <
class TElem>
82 begin(
int subsetIndex)
const
87 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
91 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
92 section_container<TElem>(subsetIndex).begin());
94 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
95 section_container<TElem>(subsetIndex).section_begin(sectionInd));
98 template <
class TElem>
101 end(
int subsetIndex)
const
106 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
110 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
111 section_container<TElem>(subsetIndex).end());
113 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
114 section_container<TElem>(subsetIndex).section_end(sectionInd));
118 template <
class TElem>
132 section_container<TElem>(subsetIndex);
135 while(iter != end<TElem>(subsetIndex))
139 secCon.
erase(iterErase, sectionInd);
144 template <
class TElem>
155 return section_container<TElem>(subsetIndex).num_elements();
157 return section_container<TElem>(subsetIndex).num_elements(sectionInd);
160 template <
class TElem>
163 num(
int subsetIndex)
const
171 return section_container<TElem>(subsetIndex).num_elements();
173 return section_container<TElem>(subsetIndex).num_elements(sectionInd);
176 template <
class TElem>
188 template <
class TElem>
inline
192 return num<TElem>() == 0;
198 return empty<Vertex>() && empty<Edge>()
199 && empty<Face>() && empty<Volume>();
202 template <
class TElem>
inline
204 empty(
int subsetIndex)
const
206 return num<TElem>(subsetIndex) == 0;
210 empty(
int subsetIndex)
const
212 return empty<Vertex>(subsetIndex) && empty<Edge>(subsetIndex)
213 && empty<Face>(subsetIndex) && empty<Volume>(subsetIndex);
216 template<
class TElem>
221 for(iterator iter = begin<TElem>(indOld);
222 iter != end<TElem>(indOld); iter++){
227 template <
class TElem>
232 bool bSuccess =
true;
234 LOG(
"performing self tests on GridSubsetHandler\n");
239 LOG(
" checking subset indices\n");
241 LOG(
" checking subset " << i);
242 for(iterator iter = begin<TElem>(i); iter != end<TElem>(i); ++iter)
245 LOG(
" bad element subset index: "
257 template <
class TElem>
268 template <
class TElem>
AttachedElementListIterator< AAEntry > iterator
Definition: attached_list.h:197
bool empty() const
returns true if the subset-handler contains no elements of the given type.
Definition: subset_handler_grid_impl.hpp:190
Grid::traits< TElem >::SectionContainer & section_container(int si)
returns the section container for the given type, subset and level
Definition: subset_handler_grid_impl.hpp:260
void change_elem_subset_indices(int indOld, int indNew)
helper for change_subset_indices
Definition: subset_handler_grid_impl.hpp:218
geometry_traits< TElem >::iterator end(int subsetIndex)
returns the end-iterator for the elements of type TElem in the given subset.
Definition: subset_handler_grid_impl.hpp:63
SubsetVec m_subsets
Definition: subset_handler_grid.h:367
uint num_subsets_in_list() const
returns the number of subsets in the local list
Definition: subset_handler_grid.h:250
void clear_subset_elements(int subsetIndex)
removes all elements of type TElem from the specified subset.
Definition: subset_handler_grid_impl.hpp:121
geometry_traits< TElem >::iterator begin(int subsetIndex)
returns the begin-iterator for the elements of type TElem in the given subset.
Definition: subset_handler_grid_impl.hpp:44
bool perform_self_tests()
only for debug purposes
Definition: subset_handler_grid_impl.hpp:228
uint num_elements(int subsetIndex) const
returns the number of elements in the given subset
Definition: subset_handler_grid_impl.hpp:147
uint num() const
returns the total number of elements
Definition: subset_handler_grid_impl.hpp:179
Grid * m_pGrid
Definition: subset_handler_interface.h:736
void alter_subset_index(Vertex *v, int subsetIndex)
Definition: subset_handler_interface.h:599
int get_subset_index(GridObject *elem) const
Definition: subset_handler_interface.cpp:560
void erase(const iterator &iter, int sectionIndex)
Definition: section_container.hpp:296
Definition: grid_base_object_traits.h:68
#define LOG(msg)
Definition: common.h:60
unsigned int uint
Definition: types.h:114
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
Helper class to access the correct element storage from its element type.
Definition: element_storage.h:210