38 #ifndef __H__LIBGRID__SELECTOR_MULTI_GRID_IMPL__
39 #define __H__LIBGRID__SELECTOR_MULTI_GRID_IMPL__
46 template <
class TElem>
58 while((
int)
m_levels.size() <= level){
63 template <
class TElem>
70 for(iter = begin<TElem>(level); iter != end<TElem>(level); ++iter)
74 const int sInd = get_section_index<TElem>();
76 section_container<TElem>(level).clear();
78 section_container<TElem>(level).clear_section(sInd);
82 template <
class TElem>
92 template <
class TElem>
96 const int sInd = get_section_index<TElem>();
99 return section_container<TElem>(level).num_elements();
101 return section_container<TElem>(level).num_elements(sInd);
109 return num<Vertex>(level) + num<Edge>(level)
110 + num<Face>(level) + num<Volume>(level);
113 template <
class TElem>
119 n += num<TElem>((
int)i);
126 return num<Vertex>() + num<Edge>()
127 + num<Face>() + num<Volume>();
134 return num(level) == 0;
137 template <
class TElem>
141 return num<TElem>(level) == 0;
150 template <
class TElem>
154 return num<TElem>() == 0;
158 template <
class TElem>
166 while(empty<TElem>(lvl) && (lvl <
top_level()))
172 template <
class TElem>
180 while(empty<TElem>(lvl) && (lvl <
top_level()))
186 template <
class TElem>
190 const int sInd = get_section_index<TElem>();
193 return iterator_cast<typename geometry_traits<TElem>::iterator>(
194 section_container<TElem>(level).begin());
196 return iterator_cast<typename geometry_traits<TElem>::iterator>(
197 section_container<TElem>(level).section_begin(sInd));
200 template <
class TElem>
204 const int sInd = get_section_index<TElem>();
207 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
208 section_container<TElem>(level).begin());
210 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
211 section_container<TElem>(level).section_begin(sInd));
215 template <
class TElem>
223 template <
class TElem>
231 template <
class TElem>
235 const int sInd = get_section_index<TElem>();
238 return iterator_cast<typename geometry_traits<TElem>::iterator>(
239 section_container<TElem>(level).end());
241 return iterator_cast<typename geometry_traits<TElem>::iterator>(
242 section_container<TElem>(level).section_end(sInd));
245 template <
class TElem>
249 const int sInd = get_section_index<TElem>();
252 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
253 section_container<TElem>(level).end());
255 return iterator_cast<typename geometry_traits<TElem>::const_iterator>(
256 section_container<TElem>(level).section_end(sInd));
259 template <
class TElem>
263 const int sInd = get_section_index<TElem>();
264 return static_cast<TElem*
>(section_container<TElem>(level).front(sInd));
267 template <
class TElem>
271 const int sInd = get_section_index<TElem>();
272 return static_cast<TElem*
>(section_container<TElem>(level).back(sInd));
275 template <
class TElem>
280 assert(level >= 0 &&
"bad level index.");
288 template <
class TElem>
293 assert((level >= 0) && (level < (
int)
m_levels.size()) &&
"bad level index.");
void mark_deselected(Vertex *elem)
Definition: selector_interface.h:368
Grid * m_pGrid
Definition: selector_interface.h:388
Definition: selector_multi_grid.h:118
Grid::traits< TElem >::SectionContainer & section_container(int level)
returns the section container for the given type, subset and level
Definition: selector_multi_grid_impl.hpp:278
void level_required(int newSize)
Definition: selector_multi_grid_impl.hpp:54
virtual void clear()
Definition: selector_multi_grid.cpp:224
size_t top_level() const
Definition: selector_multi_grid.h:231
LevelVec m_levels
Definition: selector_multi_grid.h:445
TElem * front(int level)
returns the first selected element of the given type on the specified level.
Definition: selector_multi_grid_impl.hpp:261
traits< TElem >::iterator begin()
Definition: selector_multi_grid_impl.hpp:160
bool empty() const
Definition: selector_multi_grid_impl.hpp:145
void add_level()
Definition: selector_multi_grid.cpp:197
traits< TElem >::iterator end()
Definition: selector_multi_grid_impl.hpp:217
size_t num() const
Definition: selector_multi_grid_impl.hpp:115
TElem * back(int level)
returns the last selected element of the given type on the specified level.
Definition: selector_multi_grid_impl.hpp:269
size_t num_levels() const
Definition: selector_multi_grid.h:230
int get_section_index() const
Definition: selector_multi_grid_impl.hpp:48
Definition: grid_base_object_traits.h:68
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
geometry_traits< TElem >::const_iterator const_level_iterator
Definition: selector_multi_grid.h:195
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
Helper class to access the correct element storage from its element type.
Definition: element_storage.h:210