33 #ifndef __H__LIB_GRID__MULTI_GRID__
34 #define __H__LIB_GRID__MULTI_GRID__
115 template<
class TGeomObj>
119 template <
class TGeomObj>
153 template <
class TElem>
inline
156 template <
class TElem>
inline
166 template <
class TElem>
inline
176 template <
class TElem>
inline
186 template <
class TElem>
inline
205 template <
class TElem>
inline
216 template <
class TElem>
inline
224 template <
class TChild,
class TElem>
227 template <
class TChild>
233 template <
class TElem>
237 template <
class TElem>
242 template <
class TElem>
249 template <
class TElem>
258 template <
class TElem>
267 template <
class TChild,
class TElem>
270 template <
class TChild>
275 template <
class TElem>
280 template <
class TElem>
287 template <
class TElem>
296 template <
class TElem>
302 template <
class TElem>
315 template <
class TElem>
319 template <
class TElem>
326 template <
class TElem>
354 bool replacesParent =
false);
363 bool replacesParent =
false);
372 bool replacesParent =
false);
381 bool replacesParent =
false);
384 Vertex* replacedBy = NULL);
387 Edge* replacedBy = NULL);
390 Face* replacedBy = NULL);
393 Volume* replacedBy = NULL);
426 template <
class TElem>
429 template <
class TElem,
class TParent>
433 template <
class TElem,
class TParent>
434 void element_created(TElem* elem, TParent* pParent, TElem* pReplaceMe);
437 template <
class TElem>
441 template <
class TElem,
class TParent>
450 template <
class TElem>
454 template <
class TElem>
458 template <
class TElem>
462 template <
class TElem>
469 template <
class TElem>
473 template <
class TElem>
477 template <
class TElem>
481 template <
class TElem>
496 template <
class TParent,
class TChild>
499 template <
class TChild>
505 template <
class TParent,
class TChild>
508 template <
class TChild>
567 template <
class TGr
id>
575 template <
class TElem>
inline
578 template <
class TElem>
inline
582 template <
class TElem>
inline
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
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
uint num(int level) const
geometry_traits< TElem >::iterator begin(int level)
geometry_traits< TElem >::iterator end(int level)
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
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