ug4
multi_grid.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2015: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__LIB_GRID__MULTI_GRID__
34 #define __H__LIB_GRID__MULTI_GRID__
35 
36 #include <vector>
37 #include <cassert>
38 #include "grid/grid.h"
40 #include "common_attachments.h"
41 #include "common/util/array_util.h"
42 #include "multi_grid_child_info.h"
44 
45 namespace ug
46 {
47 
49 
71 class MultiGrid : public Grid, public GridObserver
72 {
73  friend struct MGVertexInfo;
74  friend struct MGEdgeInfo;
75  friend struct MGFaceInfo;
76  friend struct MGVolumeInfo;
77 
78  protected:
83 
84  public:
85  // methods from Grid, that would be hidden if not explicitly
86  // declared as required.
87  using Grid::begin;
88  using Grid::end;
89  using Grid::num;
91  using Grid::create;
93 
94 
95  MultiGrid();
97 
99  MultiGrid(uint options);
100 
101  virtual ~MultiGrid();
102 
103  void enable_hierarchical_insertion(bool bEnable);
105 
107  // element creation
109 
115  template<class TGeomObj>
117  create(size_t level);
118 
119  template <class TGeomObj>
121  create(const typename geometry_traits<TGeomObj>::Descriptor& descriptor,
122  size_t level);
127  int level);
128 
131  const EdgeVertices& ev,
132  int level);
133 
136  const FaceVertices& fv,
137  int level);
138 
141  const VolumeVertices& vv,
142  int level);
143 
145  inline size_t num_levels() const {return (size_t)m_hierarchy.num_subsets();}
146 
148  inline size_t top_level() const;
149 
151  inline void level_required(int lvl);
152 
153  template <class TElem> inline
154  size_t num(int level) const {return m_hierarchy.num<TElem>(level);}
155 
156  template <class TElem> inline
158  begin(int level)
159  {
160  //assert(level < (int)num_levels() && "ERROR in MultiGrid::begin(...): requested level too high!");
161  if(level >= (int)num_levels())
162  return end<TElem>();
163  return m_hierarchy.begin<TElem>(level);
164  }
165 
166  template <class TElem> inline
168  end(int level)
169  {
170  //assert(level < (int)num_levels() && "ERROR in MultiGrid::end(...): requested level too high!");
171  if(level >= (int)num_levels())
172  return end<TElem>();
173  return m_hierarchy.end<TElem>(level);
174  }
175 
176  template <class TElem> inline
178  begin(int level) const
179  {
180  //assert(level < (int)num_levels() && "ERROR in MultiGrid::begin(...): requested level too high!");
181  if(level >= (int)num_levels())
182  return end<TElem>();
183  return m_hierarchy.begin<TElem>(level);
184  }
185 
186  template <class TElem> inline
188  end(int level) const
189  {
190  //assert(level < (int)num_levels() && "ERROR in MultiGrid::end(...): requested level too high!");
191  if(level >= (int)num_levels())
192  return end<TElem>();
193  return m_hierarchy.end<TElem>(level);
194  }
195 
196  // geometric-object-collection
197  inline GridObjectCollection
198  get_grid_objects(int level)
199  {return m_hierarchy.get_grid_objects_in_subset(level);}
200 
201  // multi-level-geometric-object-collection
203  {return m_hierarchy.get_grid_objects();}
204 
205  template <class TElem> inline
206  int get_level(TElem* elem) const
207  {return m_hierarchy.get_subset_index(elem);}
208 
209  GridObject* get_parent(GridObject* parent) const;
210  inline GridObject* get_parent(Vertex* o) const {return get_info(o).m_pParent;}
211  inline GridObject* get_parent(Edge* o) const {return get_info(o).m_pParent;}
212  inline GridObject* get_parent(Face* o) const {return m_aaParentFACE[o];}
213  inline GridObject* get_parent(Volume* o) const {return m_aaParentVOL[o];}
214 
215  // number of children
216  template <class TElem> inline
217  bool has_children(TElem* elem) const
218  {return get_info(elem).has_children();}
219 
221  // CHILD QUANTITIES
223 
224  template <class TChild, class TElem>
225  inline size_t num_children(TElem* elem) const {return num_children(elem, TChild());}
226 
227  template <class TChild>
228  size_t num_children(GridObject* elem) const;
232 
233  template <class TElem>
234  inline size_t num_children_total(TElem* elem) const;
235 
237  template <class TElem>
238  inline size_t num_child_vertices(TElem* elem) const {return get_info(elem).num_child_vertices();}
239 
241 
242  template <class TElem>
243  inline size_t num_child_edges(TElem* elem) const {return get_info(elem).num_child_edges();}
244  inline size_t num_child_edges(Vertex*) const {return 0;}
248 
249  template <class TElem>
250  inline size_t num_child_faces(TElem* elem) const {return get_info(elem).num_child_faces();}
251  inline size_t num_child_faces(Vertex*) const {return 0;}
252  inline size_t num_child_faces(Edge*) const {return 0;}
256 
257  inline size_t num_child_volumes(Volume* elem) const {return get_info(elem).num_child_volumes();}
258  template <class TElem>
259  inline size_t num_child_volumes(TElem*) const {return 0;}
264  // CHILD ACCESS
266 
267  template <class TChild, class TElem>
268  inline TChild* get_child(TElem* elem, size_t ind) const {return get_child(elem, ind, TChild());}
269 
270  template <class TChild>
271  TChild* get_child(GridObject* elem, size_t ind) const;
275  template <class TElem>
276  inline Vertex* get_child_vertex(TElem* elem) const {return get_info(elem).child_vertex();}
277 
279 
280  template <class TElem>
281  inline Edge* get_child_edge(TElem* elem, size_t ind) const {return get_info(elem).child_edge(ind);}
282  inline Edge* get_child_edge(Vertex*, size_t) const {return NULL;}
286 
287  template <class TElem>
288  inline Face* get_child_face(TElem* elem, size_t ind) const {return get_info(elem).child_face(ind);}
289  inline Face* get_child_face(Vertex*, size_t) const {return NULL;}
290  inline Face* get_child_face(Edge*, size_t) const {return NULL;}
294 
295  inline Volume* get_child_volume(Volume* elem, size_t ind) const {return get_info(elem).child_volume(ind);}
296  template <class TElem>
297  inline Volume* get_child_volume(TElem*, size_t) const {return NULL;}
301 
302  template <class TElem>
303  void clear_child_connections(TElem* parent);
304 
306 
315  template <class TElem>
316  void associate_parent(TElem* elem, GridObject* parent);
317 
319  template <class TElem>
320  char parent_type(TElem* elem) const;
321 
323 
326  template <class TElem>
327  void set_parent_type(TElem* elem, char type);
328 
330  void check_edge_elem_infos(int level) const;
332  void check_face_elem_infos(int level) const;
334  void check_volume_elem_infos(int level) const;
335 
337 
339 
341  // Don't invoke the following methods directly!
342  // They are intended for internal feedback only.
343 
344  // grid callbacks
345  virtual void elements_to_be_cleared(Grid* grid);
346 
352  virtual void vertex_created(Grid* grid, Vertex* vrt,
353  GridObject* pParent = NULL,
354  bool replacesParent = false);
355 
361  virtual void edge_created(Grid* grid, Edge* e,
362  GridObject* pParent = NULL,
363  bool replacesParent = false);
364 
370  virtual void face_created(Grid* grid, Face* f,
371  GridObject* pParent = NULL,
372  bool replacesParent = false);
373 
379  virtual void volume_created(Grid* grid, Volume* vol,
380  GridObject* pParent = NULL,
381  bool replacesParent = false);
382 
383  virtual void vertex_to_be_erased(Grid* grid, Vertex* vrt,
384  Vertex* replacedBy = NULL);
385 
386  virtual void edge_to_be_erased(Grid* grid, Edge* e,
387  Edge* replacedBy = NULL);
388 
389  virtual void face_to_be_erased(Grid* grid, Face* f,
390  Face* replacedBy = NULL);
391 
392  virtual void volume_to_be_erased(Grid* grid, Volume* vol,
393  Volume* replacedBy = NULL);
394 
395  protected:
396 
397  // Note: VertexInfo and EdgeInfo are stored directly, FaceInfo and
398  // VolumeInfo are stored dynamically.
405 
406 
407  // initialization
408  void init();
409 
410  // create levels
411  void create_levels(int numLevels);
412 
413  // info-access
414  inline VertexInfo& get_info(Vertex* v);
415  inline EdgeInfo& get_info(Edge* e);
416  inline FaceInfo& get_info(Face* f);
417  inline VolumeInfo& get_info(Volume* v);
418 
419  // const info-access
420  inline const VertexInfo& get_info(Vertex* v) const;
421  inline const EdgeInfo& get_info(Edge* e) const;
422  inline const FaceInfo& get_info(Face* f) const;
423  inline const VolumeInfo& get_info(Volume* v) const;
424 
425  // elem creation
426  template <class TElem>
427  inline void element_created(TElem* elem) {element_created<TElem, TElem>(elem, NULL);}
428 
429  template <class TElem, class TParent>
430  void element_created(TElem* elem, TParent* pParent);
431 
433  template <class TElem, class TParent>
434  void element_created(TElem* elem, TParent* pParent, TElem* pReplaceMe);
435 
437  template <class TElem>
438  void element_to_be_erased(TElem* elem);
439 
441  template <class TElem, class TParent>
442  void element_to_be_erased(TElem* elem, TParent* pParent);
443 
444  //template <class TElem>
445  //void element_to_be_replaced(TElem* elemOld, TElem* elemNew);
446 
447 
449 
450  template <class TElem>
451  inline size_t num_children(TElem* elem, const Vertex&) const
452  {return num_child_vertices(elem);}
453 
454  template <class TElem>
455  inline size_t num_children(TElem* elem, const Edge&) const
456  {return num_child_edges(elem);}
457 
458  template <class TElem>
459  inline size_t num_children(TElem* elem, const Face&) const
460  {return num_child_faces(elem);}
461 
462  template <class TElem>
463  inline size_t num_children(TElem* elem, const Volume&) const
464  {return num_child_volumes(elem);}
468 
469  template <class TElem>
470  inline Vertex* get_child(TElem* elem, size_t ind, const Vertex&) const
471  {return get_child_vertex(elem);}
472 
473  template <class TElem>
474  inline Edge* get_child(TElem* elem, size_t ind, const Edge&) const
475  {return get_child_edge(elem, ind);}
476 
477  template <class TElem>
478  inline Face* get_child(TElem* elem, size_t ind, const Face&) const
479  {return get_child_face(elem, ind);}
480 
481  template <class TElem>
482  inline Volume* get_child(TElem* elem, size_t ind, const Volume&) const
483  {return get_child_volume(elem, ind);}
487 
488  inline void set_parent(Vertex* o, GridObject* p) {get_info(o).m_pParent = p;}
489  inline void set_parent(Edge* o, GridObject* p) {get_info(o).m_pParent = p;}
490  inline void set_parent(Face* o, GridObject* p) {m_aaParentFACE[o] = p;}
491  inline void set_parent(Volume* o, GridObject* p) {m_aaParentVOL[o] = p;}
495 
496  template <class TParent, class TChild>
497  void add_child(TParent* p, TChild* c);
498 
499  template <class TChild>
500  void add_child(GridObject* p, TChild* c);
504 
505  template <class TParent, class TChild>
506  void remove_child(TParent* p, TChild* c);
507 
508  template <class TChild>
509  void remove_child(GridObject* p, TChild* c);
513 
514  inline void create_child_info(Vertex* o){}
515  inline void create_child_info(Edge* o) {}
516  inline void create_child_info(Face* o) {if(!m_aaFaceInf[o]) m_aaFaceInf[o] = new FaceInfo();}
517  inline void create_child_info(Volume* o) {if(!m_aaVolInf[o]) m_aaVolInf[o] = new VolumeInfo();}
521 
522  inline void release_child_info(Vertex* o) {}
523  inline void release_child_info(Edge* o) {}
524  inline void release_child_info(Face* o) {if(m_aaFaceInf[o]) delete m_aaFaceInf[o]; m_aaFaceInf[o] = NULL;}
525  inline void release_child_info(Volume* o) {if(m_aaVolInf[o]) delete m_aaVolInf[o]; m_aaVolInf[o] = NULL;}
529  // hierarchy
532 
533  // parent attachment
535 
536  // info attachments
542 
543  // parent access - only required for faces and volumes.
546 
547  // element info access
552 
554 };
555 
556 
557 
561 
567 template <class TGrid>
569 {
570  public:
571  MGWrapper(TGrid& grid);
572 
573  inline uint num_levels() const;
574 
575  template <class TElem> inline
576  uint num(int level) const;
577 
578  template <class TElem> inline
580  begin(int level);
581 
582  template <class TElem> inline
584  end(int level);
585 };
586 
587 }// end of namespace
588 
590 // include implementation
591 #include "multi_grid_impl.hpp"
592 
593 #endif
parameterString p
Base-class for edges.
Definition: grid_base_objects.h:397
holds the vertices of an Edge or an EdgeDescriptor.
Definition: grid_base_objects.h:362
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Definition: grid_base_objects.h:483
Definition: grid.h:211
Definition: grid.h:221
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
VertexIterator create_by_cloning(Vertex *pCloneMe, GridObject *pParent=NULL)
this method creates a new vertex, which has the same type as pCloneMe.
Definition: grid.cpp:419
size_t num() const
Definition: grid_impl.hpp:230
virtual GridObjectCollection get_grid_objects()
returns the the GridObjectCollection of the grid:
Definition: grid.cpp:527
geometry_traits< TGeomObj >::iterator begin()
Definition: grid_impl.hpp:164
geometry_traits< TGeomObj >::iterator create(GridObject *pParent=NULL)
create a custom element.
Definition: grid_impl.hpp:69
geometry_traits< TGeomObj >::iterator end()
Definition: grid_impl.hpp:175
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Definition: grid_observer.h:80
Partitions elements of a grid into several subsets.
Definition: subset_handler_grid.h:53
virtual GridObjectCollection get_grid_objects_in_subset(int subsetIndex) const
Returns the geometric object collection for the given subset.
Definition: subset_handler_grid.cpp:360
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
GridObjectCollection get_grid_objects() const
Definition: subset_handler_grid.cpp:374
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
uint num() const
returns the total number of elements
Definition: subset_handler_grid_impl.hpp:179
int get_subset_index(GridObject *elem) const
Definition: subset_handler_interface.cpp:560
int num_subsets() const
returns the number of subset-infos (return value is int, since SubsetIndices are of type int)
Definition: subset_handler_interface.h:317
Definition: multi_grid.h:569
MGWrapper(TGrid &grid)
uint num(int level) const
geometry_traits< TElem >::iterator begin(int level)
geometry_traits< TElem >::iterator end(int level)
uint num_levels() const
Accesses attachements in different element types at the same time.
Definition: attachment_util.h:56
Definition: multi_grid.h:72
void release_child_info(Volume *o)
releases the info-object for the given object (if necessary)
Definition: multi_grid.h:525
Attachment< char > AParentType
Definition: multi_grid.h:404
void set_parent(Volume *o, GridObject *p)
sets the parent for the given object
Definition: multi_grid.h:491
bool hierarchical_insertion_enabled()
Definition: multi_grid.h:104
Face * get_child(TElem *elem, size_t ind, const Face &) const
returning the i-th child of the type of the dummy-argument.
Definition: multi_grid.h:478
geometry_traits< TElem >::const_iterator begin(int level) const
Definition: multi_grid.h:178
Face * get_child_face(Vertex *, size_t) const
Returns the child faces of the given element or NULL if there is none.
Definition: multi_grid.h:289
size_t num_child_edges(Vertex *) const
Returns the number of child edges.
Definition: multi_grid.h:244
GridObject * get_parent(Face *o) const
Definition: multi_grid.h:212
VertexIterator create_by_cloning(Vertex *pCloneMe, GridObject *pParent=NULL)
this method creates a new vertex, which has the same type as pCloneMe.
Definition: grid.cpp:419
Edge * get_child_edge(TElem *elem, size_t ind) const
Returns the child edges of the given element or NULL if there is none.
Definition: multi_grid.h:281
Edge * get_child(TElem *elem, size_t ind, const Edge &) const
returning the i-th child of the type of the dummy-argument.
Definition: multi_grid.h:474
int get_level(TElem *elem) const
Definition: multi_grid.h:206
virtual void vertex_to_be_erased(Grid *grid, Vertex *vrt, Vertex *replacedBy=NULL)
Notified whenever an element of the given type is erased from the given grid.
Definition: multi_grid.cpp:264
size_t num_children(TElem *elem, const Edge &) const
returning the number of children of the type of the dummy-argument.
Definition: multi_grid.h:455
void associate_parent(TElem *elem, GridObject *parent)
establishes a parent child connection between the given elements
Definition: multi_grid_impl.hpp:179
size_t num_levels() const
number of levels
Definition: multi_grid.h:145
size_t num_child_volumes(Volume *elem) const
Returns the number of child volumes.
Definition: multi_grid.h:257
void check_face_elem_infos(int level) const
for debug purposes
Definition: multi_grid.cpp:552
Attachment< FaceInfo * > AFaceInfo
Definition: multi_grid.h:402
void release_child_info(Face *o)
releases the info-object for the given object (if necessary)
Definition: multi_grid.h:524
void create_child_info(Edge *o)
creates the info-object for the given object (if necessary)
Definition: multi_grid.h:515
size_t top_level() const
index of the highest level.
Definition: multi_grid_impl.hpp:86
Edge * get_child_edge(Vertex *, size_t) const
Returns the child edges of the given element or NULL if there is none.
Definition: multi_grid.h:282
Face * get_child_face(TElem *elem, size_t ind) const
Returns the child faces of the given element or NULL if there is none.
Definition: multi_grid.h:288
size_t num_child_vertices(TElem *elem) const
Returns the number of child vertices.
Definition: multi_grid.h:238
size_t num_children_total(TElem *elem) const
returns the total number of children and grand-children.
Definition: multi_grid_impl.hpp:94
Face * get_child_face(Edge *, size_t) const
Returns the child faces of the given element or NULL if there is none.
Definition: multi_grid.h:290
geometry_traits< TElem >::const_iterator end(int level) const
Definition: multi_grid.h:188
Volume * get_child_volume(TElem *, size_t) const
Returns the child volumes of the given element or NULL if there is none.
Definition: multi_grid.h:297
void set_parent(Edge *o, GridObject *p)
sets the parent for the given object
Definition: multi_grid.h:489
Grid::EdgeAttachmentAccessor< AEdgeInfo > m_aaEdgeInf
Definition: multi_grid.h:549
GridObject * get_parent(Vertex *o) const
Definition: multi_grid.h:210
AParentType m_aParentType
Definition: multi_grid.h:541
void check_volume_elem_infos(int level) const
for debug purposes
Definition: multi_grid.cpp:569
MGVolumeInfo VolumeInfo
Definition: multi_grid.h:82
virtual void volume_created(Grid *grid, Volume *vol, GridObject *pParent=NULL, bool replacesParent=false)
Definition: multi_grid.cpp:460
size_t num_child_faces(Edge *) const
Returns the number of child faces.
Definition: multi_grid.h:252
TChild * get_child(TElem *elem, size_t ind) const
returns the i-th child of the given child-type
Definition: multi_grid.h:268
size_t num_child_faces(TElem *elem) const
Returns the number of child faces.
Definition: multi_grid.h:250
Attachment< GridObject * > AParent
Definition: multi_grid.h:399
AVolumeInfo m_aVolumeInfo
Definition: multi_grid.h:540
char parent_type(TElem *elem) const
returns the object-type of the parent of a given object
Definition: multi_grid_impl.hpp:202
VertexInfo & get_info(Vertex *v)
Definition: multi_grid_impl.hpp:215
size_t num_children(TElem *elem, const Face &) const
returning the number of children of the type of the dummy-argument.
Definition: multi_grid.h:459
size_t num(int level) const
Definition: multi_grid.h:154
void init()
Definition: multi_grid.cpp:74
void release_child_info(Edge *o)
releases the info-object for the given object (if necessary)
Definition: multi_grid.h:523
MGFaceInfo FaceInfo
Definition: multi_grid.h:81
Vertex * get_child_vertex(TElem *elem) const
Returns the child vertex of the given element or NULL if there is none.
Definition: multi_grid.h:276
GridObject * get_parent(GridObject *parent) const
Definition: multi_grid.cpp:180
Grid::VolumeAttachmentAccessor< AVolumeInfo > m_aaVolInf
Definition: multi_grid.h:551
Volume * get_child_volume(Volume *elem, size_t ind) const
Returns the child volumes of the given element or NULL if there is none.
Definition: multi_grid.h:295
virtual void face_created(Grid *grid, Face *f, GridObject *pParent=NULL, bool replacesParent=false)
Definition: multi_grid.cpp:371
size_t num_child_volumes(TElem *) const
Returns the number of child volumes.
Definition: multi_grid.h:259
size_t num_children(TElem *elem, const Volume &) const
returning the number of children of the type of the dummy-argument.
Definition: multi_grid.h:463
virtual void volume_to_be_erased(Grid *grid, Volume *vol, Volume *replacedBy=NULL)
Notified whenever an element of the given type is erased from the given grid.
Definition: multi_grid.cpp:522
virtual GridObjectCollection get_grid_objects()
returns the the GridObjectCollection of the grid:
Definition: multi_grid.h:202
GridObjectCollection get_grid_objects(int level)
Definition: multi_grid.h:198
void create_levels(int numLevels)
Definition: multi_grid.cpp:109
bool m_bHierarchicalInsertion
Definition: multi_grid.h:531
Volume * get_child(TElem *elem, size_t ind, const Volume &) const
returning the i-th child of the type of the dummy-argument.
Definition: multi_grid.h:482
Grid::VolumeAttachmentAccessor< AParent > m_aaParentVOL
Definition: multi_grid.h:545
virtual void edge_created(Grid *grid, Edge *e, GridObject *pParent=NULL, bool replacesParent=false)
Definition: multi_grid.cpp:289
void remove_child(TParent *p, TChild *c)
removes a child from the given object
Definition: multi_grid_impl.hpp:285
virtual void vertex_created(Grid *grid, Vertex *vrt, GridObject *pParent=NULL, bool replacesParent=false)
Definition: multi_grid.cpp:202
Attachment< EdgeInfo > AEdgeInfo
Definition: multi_grid.h:401
bool has_children(TElem *elem) const
Definition: multi_grid.h:217
AVertexInfo m_aVertexInfo
Definition: multi_grid.h:537
void set_parent_type(TElem *elem, char type)
sets the object-type of the parent of a given object
Definition: multi_grid_impl.hpp:209
void level_required(int lvl)
creates new (empty) levels until num_levels() == lvl+1
Definition: multi_grid_impl.hpp:137
AParent m_aParent
Definition: multi_grid.h:534
void check_edge_elem_infos(int level) const
for debug purposes
Definition: multi_grid.cpp:540
void enable_hierarchical_insertion(bool bEnable)
Definition: multi_grid.cpp:120
virtual ~MultiGrid()
Definition: multi_grid.cpp:64
GridObject * get_parent(Volume *o) const
Definition: multi_grid.h:213
SubsetHandler m_hierarchy
Definition: multi_grid.h:530
void set_parent(Face *o, GridObject *p)
sets the parent for the given object
Definition: multi_grid.h:490
virtual void edge_to_be_erased(Grid *grid, Edge *e, Edge *replacedBy=NULL)
Notified whenever an element of the given type is erased from the given grid.
Definition: multi_grid.cpp:349
void element_created(TElem *elem)
Definition: multi_grid.h:427
Grid::VertexAttachmentAccessor< AVertexInfo > m_aaVrtInf
Definition: multi_grid.h:548
AEdgeInfo m_aEdgeInfo
Definition: multi_grid.h:538
geometry_traits< TElem >::iterator end(int level)
Definition: multi_grid.h:168
virtual void face_to_be_erased(Grid *grid, Face *f, Face *replacedBy=NULL)
Notified whenever an element of the given type is erased from the given grid.
Definition: multi_grid.cpp:439
size_t num_child_faces(Vertex *) const
Returns the number of child faces.
Definition: multi_grid.h:251
MGVertexInfo VertexInfo
Definition: multi_grid.h:79
void create_child_info(Volume *o)
creates the info-object for the given object (if necessary)
Definition: multi_grid.h:517
GridObject * get_parent(Edge *o) const
Definition: multi_grid.h:211
geometry_traits< TElem >::iterator begin(int level)
Definition: multi_grid.h:158
size_t num_children(TElem *elem) const
returns the number of children of the given child-type
Definition: multi_grid.h:225
virtual void elements_to_be_cleared(Grid *grid)
Definition: multi_grid.cpp:196
geometry_traits< TGeomObj >::iterator create(size_t level)
create a custom element on a specific level.
Definition: multi_grid_impl.hpp:108
void clear_child_connections(TElem *parent)
clears the relation between a parent and its children
Definition: multi_grid_impl.hpp:171
void release_child_info(Vertex *o)
releases the info-object for the given object (if necessary)
Definition: multi_grid.h:522
void set_parent(Vertex *o, GridObject *p)
sets the parent for the given object
Definition: multi_grid.h:488
AFaceInfo m_aFaceInfo
Definition: multi_grid.h:539
void add_child(TParent *p, TChild *c)
adds a child to the given object
Definition: multi_grid_impl.hpp:267
Grid::FaceAttachmentAccessor< AParent > m_aaParentFACE
Definition: multi_grid.h:544
MGEdgeInfo EdgeInfo
Definition: multi_grid.h:80
MultiElementAttachmentAccessor< AParentType > m_aaParentType
Definition: multi_grid.h:553
Attachment< VolumeInfo * > AVolumeInfo
Definition: multi_grid.h:403
size_t num_children(TElem *elem, const Vertex &) const
returning the number of children of the type of the dummy-argument.
Definition: multi_grid.h:451
MultiGrid()
Definition: multi_grid.cpp:42
void create_child_info(Vertex *o)
creates the info-object for the given object (if necessary)
Definition: multi_grid.h:514
Vertex * get_child(TElem *elem, size_t ind, const Vertex &) const
returning the i-th child of the type of the dummy-argument.
Definition: multi_grid.h:470
void create_child_info(Face *o)
creates the info-object for the given object (if necessary)
Definition: multi_grid.h:516
Grid::FaceAttachmentAccessor< AFaceInfo > m_aaFaceInf
Definition: multi_grid.h:550
void element_to_be_erased(TElem *elem)
this method is called for elements that havn't got any parent.
Definition: multi_grid_impl.hpp:365
SubsetHandler & get_hierarchy_handler()
this method may be removed in future versions of the MultiGrid-class.
Definition: multi_grid.h:338
Attachment< VertexInfo > AVertexInfo
Definition: multi_grid.h:400
size_t num_child_edges(TElem *elem) const
Returns the number of child edges.
Definition: multi_grid.h:243
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
holds the vertices of a Volume or a VolumeDescriptor
Definition: grid_base_objects.h:723
Definition: grid_base_object_traits.h:68
unsigned int uint
Definition: types.h:114
the ug namespace
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
ElementStorage< Face >::SectionContainer::iterator FaceIterator
Definition: grid_base_object_traits.h:79
ElementStorage< Edge >::SectionContainer::iterator EdgeIterator
Definition: grid_base_object_traits.h:76
ElementStorage< Volume >::SectionContainer::iterator VolumeIterator
Definition: grid_base_object_traits.h:82
Holds information about edge relations. Used internally.
Definition: multi_grid_child_info.h:95
Holds information about face relations. Used internally.
Definition: multi_grid_child_info.h:126
Holds information about vertex relations. Used internally.
Definition: multi_grid_child_info.h:63
Vertex * child_vertex() const
Definition: multi_grid_child_info.h:79
size_t num_child_vertices() const
Definition: multi_grid_child_info.h:77
bool has_children() const
Definition: multi_grid_child_info.h:66
GridObject * m_pParent
Definition: multi_grid_child_info.h:81
Holds information about volume relations. Used internally.
Definition: multi_grid_child_info.h:162