Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
grid_impl.hpp
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__GRID_IMPLEMENTATION__
34#define __H__LIB_GRID__GRID_IMPLEMENTATION__
35
36//#include <cassert>
37#include "common/common.h"
39#include "grid_util.h"
40#include "grid.h"
41
42namespace ug
43{
45// parallelism
47is_parallel() const
48{
49 return m_distGridMgr != NULL;
50}
51
57
63
64
66// create functions
67template<class TGeomObj>
70{
73 invalid_geometry_type);
74
75 TGeomObj* geomObj = new TGeomObj;
76// int baseObjectType = geometry_traits<GeomObjType>::base_object_type();
77// geomObj->m_elemHandle = m_elementStorage[baseObjectType].m_sectionContainer.insert_element(geomObj, geometry_traits<GeomObjType>::container_section());
78// m_elementStorage[baseObjectType].m_attachmentPipe.register_element(geomObj);
79
80 register_element(geomObj, pParent);
81
82 return iterator_cast<typename geometry_traits<TGeomObj>::iterator>(get_iterator(geomObj));
83}
84
85template <class TGeomObj>
88 GridObject* pParent)
89{
92 invalid_geometry_type);
93
94 TGeomObj* geomObj = new TGeomObj(descriptor);
95
96// int baseObjectType = geometry_traits<TGeomObj>::base_object_type();
97// geomObj->m_elemHandle = m_elementStorage[baseObjectType].m_sectionContainer.insert_element(geomObj, geometry_traits<GeomObjType>::container_section());
98// m_elementStorage[baseObjectType].m_attachmentPipe.register_element(geomObj);
99
100 register_element(geomObj, pParent);
101
102 return iterator_cast<typename geometry_traits<TGeomObj>::iterator>(get_iterator(geomObj));
103}
104
105template<class TGeomObj>
108{
111 invalid_geometry_type);
112
113 TGeomObj* geomObj = new TGeomObj;
114
115 if(geomObj->reference_object_id() == pReplaceMe->reference_object_id())
116 {
117 register_and_replace_element(geomObj, pReplaceMe);
118 return iterator_cast<typename geometry_traits<TGeomObj>::iterator>(get_iterator(geomObj));
119 }
120 else
121 {
122 LOG("ERROR in Grid::create_and_replace(...): reference objects do not match!");
123 assert(!"ERROR in Grid::create_and_replace(...): reference objects do not match!");
124 delete geomObj;
125 return end<TGeomObj>();
126 }
127}
128
130template <class TGeomObj>
131void Grid::reserve(size_t num)
132{
134 invalid_geometry_type);
135
136 element_storage<TGeomObj>().m_attachmentPipe.reserve(num);
137}
138
140// erase
141template <class GeomObjIter>
142void Grid::erase(const GeomObjIter& iterBegin, const GeomObjIter& iterEnd)
143{
144 GeomObjIter iter = iterBegin;
145 while(iter != iterEnd)
146 {
147 GeomObjIter tmpIter = iter;
148 ++iter;
149 erase(*tmpIter);
150 }
151}
152
153template <class TGeomObj>
155{
156 while(begin<TGeomObj>() != end<TGeomObj>())
157 erase(*begin<TGeomObj>());
158}
159
161// Iterators
162template <class TGeomObj>
165{
167 invalid_GeomObj);
168
169 return iterator_cast<typename geometry_traits<TGeomObj>::iterator>
170 (element_storage<TGeomObj>().m_sectionContainer.section_begin(geometry_traits<TGeomObj>::CONTAINER_SECTION));
171}
172
173template <class TGeomObj>
176{
178 invalid_GeomObj);
179
180 return iterator_cast<typename geometry_traits<TGeomObj>::iterator>
181 (element_storage<TGeomObj>().m_sectionContainer.section_end(geometry_traits<TGeomObj>::CONTAINER_SECTION));
182}
183
184template <class TGeomObj>
189 invalid_GeomObj);
190
191 return iterator_cast<typename geometry_traits<TGeomObj>::const_iterator>
192 (element_storage<TGeomObj>().m_sectionContainer.section_begin(geometry_traits<TGeomObj>::CONTAINER_SECTION));
193}
194
195template <class TGeomObj>
198{
200 invalid_GeomObj);
201
202 return iterator_cast<typename geometry_traits<TGeomObj>::const_iterator>
203 (element_storage<TGeomObj>().m_sectionContainer.section_end(geometry_traits<TGeomObj>::CONTAINER_SECTION));
206template <class TGeomObj>
207TGeomObj*
209{
211 invalid_GeomObj);
212
213 return static_cast<TGeomObj*>(*element_storage<TGeomObj>().m_sectionContainer.
217template <class TGeomObj>
218TGeomObj*
220{
222 invalid_GeomObj);
224 return static_cast<TGeomObj*>(*element_storage<TGeomObj>().m_sectionContainer.
228// element numbers
229template <class TGeomObj>
230size_t Grid::num() const
231{
233 invalid_GeomObj);
237 if(secIndex == -1)
238 return element_storage<TGeomObj>().m_sectionContainer.num_elements();
239
240 return element_storage<TGeomObj>().m_sectionContainer.num_elements(secIndex);
241}
242
243inline void Grid::
244objects_will_be_merged(Vertex* target, Vertex* elem1,
245 Vertex* elem2)
246{
247 for(Grid::ObserverContainer::iterator iter = m_vertexObservers.begin();
248 iter != m_vertexObservers.end(); iter++)
249 {
250 (*iter)->vertices_to_be_merged(this, target, elem1, elem2);
251 }
252}
253
254inline void Grid::
255objects_will_be_merged(Edge* target, Edge* elem1,
256 Edge* elem2)
257{
258 for(Grid::ObserverContainer::iterator iter = m_edgeObservers.begin();
259 iter != m_edgeObservers.end(); iter++)
260 {
261 (*iter)->edges_to_be_merged(this, target, elem1, elem2);
262 }
263}
264
265inline void Grid::
266objects_will_be_merged(Face* target, Face* elem1,
267 Face* elem2)
268{
269 for(Grid::ObserverContainer::iterator iter = m_faceObservers.begin();
270 iter != m_faceObservers.end(); iter++)
271 {
272 (*iter)->faces_to_be_merged(this, target, elem1, elem2);
273 }
274}
275
276inline void Grid::
277objects_will_be_merged(Volume* target, Volume* elem1,
278 Volume* elem2)
279{
280 for(Grid::ObserverContainer::iterator iter = m_volumeObservers.begin();
281 iter != m_volumeObservers.end(); iter++)
282 {
283 (*iter)->volumes_to_be_merged(this, target, elem1, elem2);
284 }
285}
286
287template <class TGeomObj>
289{
290 return element_storage<TGeomObj>().m_attachmentPipe.num_data_entries();
291}
292
294// attachment handling
295template <class TGeomObjClass>
296void Grid::attach_to(IAttachment& attachment, bool passOnValues)
297{
299 invalid_GeomObjClass);
300
301// setup the options for this attachment.
302 int options = 0;
303 if(passOnValues)
304 options = 1;
305
306 element_storage<TGeomObjClass>().m_attachmentPipe.attach(attachment, options);
307}
308
309inline void Grid::attach_to_all(IAttachment& attachment, bool passOnValues)
310{
311 attach_to<Vertex>(attachment, passOnValues);
312 attach_to<Edge>(attachment, passOnValues);
313 attach_to<Face>(attachment, passOnValues);
314 attach_to<Volume>(attachment, passOnValues);
315}
316
317inline void Grid::attach_to_all(IAttachment& attachment)
318{
319 attach_to<Vertex>(attachment);
320 attach_to<Edge>(attachment);
321 attach_to<Face>(attachment);
322 attach_to<Volume>(attachment);
323}
324
325template <class TGeomObjClass, class TAttachment>
326void Grid::attach_to_dv(TAttachment& attachment, const typename TAttachment::ValueType& defaultValue)
327{
328 attach_to_dv<TGeomObjClass, TAttachment>(attachment, defaultValue, attachment.default_pass_on_behaviour());
329}
330
331template <class TAttachment>
332inline void Grid::
333attach_to_all_dv(TAttachment& attachment,
334 const typename TAttachment::ValueType& defaultValue)
335{
336 attach_to_dv<Vertex>(attachment, defaultValue);
337 attach_to_dv<Edge>(attachment, defaultValue);
338 attach_to_dv<Face>(attachment, defaultValue);
339 attach_to_dv<Volume>(attachment, defaultValue);
340}
341
342template <class TGeomObjClass, class TAttachment>
343void Grid::attach_to_dv(TAttachment& attachment, const typename TAttachment::ValueType& defaultValue, bool passOnValues)
344{
346 invalid_GeomObjClass);
347
348// setup the options for this attachment.
349 int options = 0;
350 if(passOnValues)
351 options = 1;
352
353 element_storage<TGeomObjClass>().m_attachmentPipe.attach(attachment, defaultValue, options);
354}
355
356template <class TAttachment>
357inline void Grid::
358attach_to_all_dv(TAttachment& attachment,
359 const typename TAttachment::ValueType& defaultValue,
360 bool passOnValues)
361{
362 attach_to_dv<Vertex>(attachment, defaultValue, passOnValues);
363 attach_to_dv<Edge>(attachment, defaultValue, passOnValues);
364 attach_to_dv<Face>(attachment, defaultValue, passOnValues);
365 attach_to_dv<Volume>(attachment, defaultValue, passOnValues);
366}
367
368template <class TGeomObjClass>
370{
372 invalid_GeomObjClass);
373
374 element_storage<TGeomObjClass>().m_attachmentPipe.detach(attachment);
375}
376
377inline void Grid::detach_from_all(IAttachment& attachment)
379 detach_from<Vertex>(attachment);
380 detach_from<Edge>(attachment);
381 detach_from<Face>(attachment);
382 detach_from<Volume>(attachment);
383}
384
385/*
386template <class TGeomObjClass>
387util::IAttachmentDataContainer* Grid::get_data_container(util::IAttachment& attachment)
388{
389 assert(geometry_traits<TGeomObjClass>::base_object_type() != -1
390 && "ERROR in Grid::get_data_container(...). Invalid base_object_type of GeomObjClass!");
391
392 return m_elementStorage[geometry_traits<TGeomObjClass>::base_object_type()].
393 m_attachmentPipe.get_data_container(attachment);
394}
395*/
396
397template <class TGeomObj, class TAttachment>
398typename TAttachment::ContainerType*
400{
402 invalid_GeomObj);
403
404 return element_storage<TGeomObj>().m_attachmentPipe.get_data_container(attachment);
405}
406
407template <class TGeomObj>
410{
412 invalid_GeomObj);
413
414 return element_storage<TGeomObj>().m_attachmentPipe;
415}
416
417template <class TGeomObj>
418uint
420{
421 typedef typename geometry_traits<TGeomObj>::grid_base_object BaseObj;
423 get_data_index(&element_storage<TGeomObj>(), pObj);
424}
425
426inline void
427Grid::autoenable_option(uint option, const char* caller, const char* optionName)
428{
429 if(!option_is_enabled(option))
430 {
431 LOG("WARNING in " << caller << ": auto-enabling " << optionName << "." << std::endl);
432 enable_options(option);
433 }
434}
435
437// marks
438template <class TIterator>
439void Grid::mark(TIterator begin, TIterator end)
440{
441 for(TIterator iter = begin; iter != end; ++iter)
442 mark(*iter);
443}
444
445template <class TIterator>
446void Grid::unmark(TIterator begin, TIterator end)
447{
448 for(TIterator iter = begin; iter != end; ++iter)
449 unmark(*iter);
450}
451
452
454template <class TContainer>
455void Grid::get_associated(TContainer& container, GridObject* o)
456{
457 switch(o->base_object_id()){
458 case VERTEX: return get_associated(container, static_cast<Vertex*>(o));
459 case EDGE: return get_associated(container, static_cast<Edge*>(o));
460 case FACE: return get_associated(container, static_cast<Face*>(o));
461 case VOLUME: return get_associated(container, static_cast<Volume*>(o));
462 }
463}
464
465template <class TElem>
467{
468 get_associated(elemsOut, e);
469}
470
471template <class TElem>
473{
474 get_associated(elemsOut, e);
475}
476
477template <class TElem>
479{
480 get_associated(elemsOut, e);
481}
482
483template <class TElem>
485{
486 get_associated(elemsOut, e);
487}
488
489template <class TElem>
491 ::secure_container& elems, TElem* e)
492{
493// we have to retrieve a valid pointer on the element pointer. The only way
494// to receive it, is to return the pointer to the entry in which e is stored in
495// the element storage.
496 elems.set_external_array(
497 element_storage<typename TElem::grid_base_object>().m_sectionContainer.
498 get_container().get_pointer_to_element(e),
499 1);
500}
501
502template <class TElem>
508template <class TElem>
510{
512}
513
514template <class TElem>
519
520template <class TElem>
525
526
527template <class TElem>
529 ::secure_container& elems, TElem* e)
530{
531// we have to retrieve a valid pointer on the element pointer. The only way
532// to receive it, is to return the pointer to the entry in which e is stored in
533// the element storage.
534 elems.set_external_array(
535 element_storage<typename TElem::grid_base_object>().m_sectionContainer.
536 get_container().get_pointer_to_element(e),
537 1);
538}
539
540
542// neighbourhood access
543template <class TGeomObj>
545{
547
550 iter != iterEnd; ++iter)
551 {
552 Edge* e = *iter;
553 if(CompareVertices(e, &ev))
554 return e;
555 }
556 return NULL;
557}
558
559
560template <class TGeomObj>
562{
564
565 unsigned long key = hash_key(&fv);
568 iter != iterEnd; ++iter)
569 {
570 Face* f = *iter;
571 if(key == hash_key(f))
572 {
573 if(CompareVertices(f, &fv))
574 return f;
575 }
576 }
577
578 return NULL;
579}
580
581template <class TGeomObj>
583 const VolumeVertices& vv)
584{
586
587 unsigned long key = hash_key(&vv);
590 iter != iterEnd; ++iter)
591 {
592 Volume* v = *iter;
593 if(key == hash_key(v))
594 {
595 if(CompareVertices(v, &vv))
596 return v;
597 }
598 }
599
600 return NULL;
601}
602
603
606// implementation of Grids AttachmentAccessors
607
609// AttachmentAccessor
610template <class TElem, class TAttachment>
616
617template <class TElem, class TAttachment>
623
624template <class TElem, class TAttachment>
626AttachmentAccessor(Grid& grid, TAttachment& a) :
627ug::AttachmentAccessor<typename TElem::grid_base_object*, TAttachment,
628 typename traits<TElem>::ElementStorage>
629 (grid.get_attachment_pipe<TElem>(), a)
630{
631}
632
633template <class TElem, class TAttachment>
635AttachmentAccessor(Grid& grid, TAttachment& a, bool autoAttach) :
636ug::AttachmentAccessor<typename TElem::grid_base_object*, TAttachment,
637 typename traits<TElem>::ElementStorage>()
638{
639 if(autoAttach){
640 if(!grid.has_attachment<TElem>(a))
641 grid.attach_to<TElem>(a);
642 }
643
644 access(grid, a);
645}
646
648// VertexAttachmentAccessor
649template <class TAttachment>
655
656template <class TAttachment>
662
663template <class TAttachment>
665VertexAttachmentAccessor(Grid& grid, TAttachment& a) :
666 Grid::AttachmentAccessor<Vertex, TAttachment>(grid, a)
667{
668}
669
670template <class TAttachment>
672VertexAttachmentAccessor(Grid& grid, TAttachment& a, bool autoAttach) :
673 Grid::AttachmentAccessor<Vertex, TAttachment>(grid, a, autoAttach)
674{
675}
676
677
679// EdgeAttachmentAccessor
680template <class TAttachment>
686
687template <class TAttachment>
693
694template <class TAttachment>
696EdgeAttachmentAccessor(Grid& grid, TAttachment& a) :
697 Grid::AttachmentAccessor<Edge, TAttachment>(grid, a)
698{
699}
700
701template <class TAttachment>
703EdgeAttachmentAccessor(Grid& grid, TAttachment& a, bool autoAttach) :
704 Grid::AttachmentAccessor<Edge, TAttachment>(grid, a, autoAttach)
705{
706}
707
708
710// FaceAttachmentAccessor
711template <class TAttachment>
717
718template <class TAttachment>
724
725template <class TAttachment>
727FaceAttachmentAccessor(Grid& grid, TAttachment& a) :
728 Grid::AttachmentAccessor<Face, TAttachment>(grid, a)
729{
730}
731
732template <class TAttachment>
734FaceAttachmentAccessor(Grid& grid, TAttachment& a, bool autoAttach) :
735 Grid::AttachmentAccessor<Face, TAttachment>(grid, a, autoAttach)
736{
737}
738
739
741// FaceAttachmentAccessor
742template <class TAttachment>
748
749template <class TAttachment>
755
756template <class TAttachment>
758VolumeAttachmentAccessor(Grid& grid, TAttachment& a) :
759 Grid::AttachmentAccessor<Volume, TAttachment>(grid, a)
760{
761}
762
763template <class TAttachment>
765VolumeAttachmentAccessor(Grid& grid, TAttachment& a, bool autoAttach) :
766 Grid::AttachmentAccessor<Volume, TAttachment>(grid, a, autoAttach)
767{
768}
769
770
772// marks
773inline void Grid::mark(GridObject* obj)
774{
775 const int typeID = obj->base_object_id();
776 switch(typeID){
777 case VERTEX: mark(static_cast<Vertex*>(obj)); break;
778 case EDGE: mark(static_cast<Edge*>(obj)); break;
779 case FACE: mark(static_cast<Face*>(obj)); break;
780 case VOLUME: mark(static_cast<Volume*>(obj)); break;
781 }
782}
783
784inline void Grid::mark(Vertex* obj)
785{
786 assert(m_bMarking && "ERROR: Grid::mark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
788}
789
790inline void Grid::mark(Edge* obj)
791{
792 assert(m_bMarking && "ERROR: Grid::mark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
794}
795
796inline void Grid::mark(Face* obj)
797{
798 assert(m_bMarking && "ERROR: Grid::mark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
800}
801
802inline void Grid::mark(Volume* obj)
803{
804 assert(m_bMarking && "ERROR: Grid::mark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
806}
807
808inline void Grid::unmark(GridObject* obj)
809{
810 const int typeID = obj->base_object_id();
811 switch(typeID){
812 case VERTEX: unmark(static_cast<Vertex*>(obj)); break;
813 case EDGE: unmark(static_cast<Edge*>(obj)); break;
814 case FACE: unmark(static_cast<Face*>(obj)); break;
815 case VOLUME: unmark(static_cast<Volume*>(obj)); break;
816 }
817}
818
819inline void Grid::unmark(Vertex* obj)
820{
821 assert(m_bMarking && "ERROR: Grid::unmark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
822 m_aaMarkVRT[obj] = 0;
823}
824
825inline void Grid::unmark(Edge* obj)
826{
827 assert(m_bMarking && "ERROR: Grid::unmark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
828 m_aaMarkEDGE[obj] = 0;
829}
830
831inline void Grid::unmark(Face* obj)
832{
833 assert(m_bMarking && "ERROR: Grid::unmark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
834 m_aaMarkFACE[obj] = 0;
835}
836
837inline void Grid::unmark(Volume* obj)
838{
839 assert(m_bMarking && "ERROR: Grid::unmark may only be called between calls to Grid::begin_marking and Grid::end_marking.");
840 m_aaMarkVOL[obj] = 0;
841}
842
843inline bool Grid::is_marked(GridObject* obj) const
844{
845 const int typeID = obj->base_object_id();
846 switch(typeID){
847 case VERTEX: return is_marked(static_cast<Vertex*>(obj));
848 case EDGE: return is_marked(static_cast<Edge*>(obj));
849 case FACE: return is_marked(static_cast<Face*>(obj));
850 case VOLUME: return is_marked(static_cast<Volume*>(obj));
851 default: return false;
852 }
853}
854
855inline bool Grid::is_marked(Vertex* obj) const
856{
857 if(m_currentMark == 0)
858 return false;
859 return m_aaMarkVRT[obj] == m_currentMark;
860}
861
862inline bool Grid::is_marked(Edge* obj) const
863{
864 if(m_currentMark == 0)
865 return false;
866 return m_aaMarkEDGE[obj] == m_currentMark;
867}
868
869inline bool Grid::is_marked(Face* obj) const
870{
871 if(m_currentMark == 0)
872 return false;
873 return m_aaMarkFACE[obj] == m_currentMark;
874}
875
876inline bool Grid::is_marked(Volume* obj) const
877{
878 if(m_currentMark == 0)
879 return false;
880 return m_aaMarkVOL[obj] == m_currentMark;
881}
882
883}// end of namespace libGrid
884#endif
manages the layouts and interfaces which are associated with a distributed grid.
Definition distributed_grid.h:88
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
This struct is used to hold GridObjects and their attachment pipes.
Definition element_storage.h:44
Faces are 2-dimensional objects.
Definition grid_base_objects.h:510
Definition grid_base_objects.h:483
the generic attachment-accessor for access to grids attachment pipes.
Definition grid.h:182
AttachmentAccessor()
Definition grid_impl.hpp:612
bool access(Grid &grid, TAttachment &a)
Definition grid.h:189
EdgeAttachmentAccessor()
Definition grid_impl.hpp:682
FaceAttachmentAccessor()
Definition grid_impl.hpp:713
VertexAttachmentAccessor()
Definition grid_impl.hpp:651
VolumeAttachmentAccessor()
Definition grid_impl.hpp:744
Manages the elements of a grid and their interconnection.
Definition grid.h:132
EdgeContainer::iterator AssociatedEdgeIterator
used to iterate over associated edges of vertices, faces and volumes
Definition grid.h:249
void clear()
clears the grids geometry and attachments
Definition grid.cpp:220
void detach_from_all(IAttachment &attachment)
Definition grid_impl.hpp:377
AssociatedFaceIterator associated_faces_begin(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition grid.cpp:944
VolumeAttachmentAccessor< AMark > m_aaMarkVOL
Definition grid.h:1196
AssociatedEdgeIterator associated_edges_begin(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition grid.cpp:882
bool option_is_enabled(uint option) const
see set_options for a description of valid parameters.
Definition grid.cpp:721
uint get_attachment_data_index(TGeomObj *pObj) const
Definition grid_impl.hpp:419
Edge * find_edge_in_associated_edges(TGeomObj *obj, const EdgeVertices &ev)
Definition grid_impl.hpp:544
void detach_from(IAttachment &attachment)
Definition grid_impl.hpp:369
bool m_bMarking
Definition grid.h:1191
ObserverContainer m_vertexObservers
Definition grid.h:1162
void reserve(size_t num)
Reserves memory for the creation of the given object type.
Definition grid_impl.hpp:131
Face * find_face_in_associated_faces(TGeomObj *obj, const FaceVertices &fv)
Definition grid_impl.hpp:561
void register_element(Vertex *v, GridObject *pParent=NULL)
Definition grid.h:870
void get_associated(SecureVertexContainer &vrts, Edge *e)
Definition grid_connection_managment.cpp:2608
DistributedGridManager * distributed_grid_manager()
returns a pointer to the associated distributed grid manager.
Definition grid_impl.hpp:53
void unmark(GridObject *obj)
unmarks the object. Calls are only valid between calls to Grid::begin_marking and Grid::end_marking.
Definition grid_impl.hpp:808
bool is_marked(GridObject *obj) const
returns true if the object is marked, false if not.
Definition grid_impl.hpp:843
DistributedGridManager * m_distGridMgr
Definition grid.h:1199
size_t num() const
Definition grid_impl.hpp:230
AssociatedEdgeIterator associated_edges_end(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition grid.cpp:892
traits< Vertex >::SectionContainer::iterator get_iterator(Vertex *o)
returns the iterator at which the given element lies in the section container
Definition grid.h:1118
size_t attachment_container_size() const
returns the size of the associated attachment containers.
Definition grid_impl.hpp:288
void attach_to(IAttachment &attachment, bool passOnValues)
attach with custom pass-on-behaviour and unspecified default value.
Definition grid_impl.hpp:296
VolumeContainer::iterator AssociatedVolumeIterator
used to iterate over associated volumes of vertices, edges and faces
Definition grid.h:253
bool has_attachment(IAttachment &attachment)
Definition grid.h:796
int m_currentMark
Definition grid.h:1190
void attach_to_all(IAttachment &attachment, bool passOnValues)
Definition grid_impl.hpp:309
void mark(GridObject *obj)
marks the object. Calls are only valid between calls to Grid::begin_marking and Grid::end_marking.
Definition grid_impl.hpp:773
VertexAttachmentAccessor< AMark > m_aaMarkVRT
Definition grid.h:1193
void autoenable_option(uint option, const char *caller, const char *optionName)
Definition grid_impl.hpp:427
TGeomObj * back()
returns the last element of the given type.
Definition grid_impl.hpp:219
void erase(GridObject *geomObj)
Definition grid.cpp:459
AssociatedVolumeIterator associated_volumes_begin(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition grid.cpp:1006
Volume * find_volume_in_associated_volumes(TGeomObj *obj, const VolumeVertices &vv)
Definition grid_impl.hpp:582
void get_associated_sorted(SecureVertexContainer &vrts, Edge *e) const
Definition grid_connection_managment.cpp:2932
ObserverContainer m_faceObservers
Definition grid.h:1164
ObserverContainer m_edgeObservers
Definition grid.h:1163
bool is_parallel() const
returns true if the grid is prepared for parallel computations.
Definition grid_impl.hpp:47
AssociatedFaceIterator associated_faces_end(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition grid.cpp:954
void objects_will_be_merged(Vertex *target, Vertex *elem1, Vertex *elem2)
notifies the grid that two objects will be merged.
Definition grid_impl.hpp:244
geometry_traits< TGeomObj >::iterator create_and_replace(typename geometry_traits< TGeomObj >::grid_base_object *pReplaceMe)
create a custom element and replaces an old one.
Definition grid_impl.hpp:107
void attach_to_dv(TAttachment &attachment, const typename TAttachment::ValueType &defaultValue)
Definition grid_impl.hpp:326
geometry_traits< TGeomObj >::iterator begin()
Definition grid_impl.hpp:164
traits< TGeomObj >::AttachmentPipe & get_attachment_pipe()
returns the attachment-pipe in which data associated with the given objects-types are stored.
Definition grid_impl.hpp:409
void associated_elements(traits< Vertex >::secure_container &elemsOut, TElem *e)
Puts all elements of type TAss which are contained in 'e' or which contain 'e' into elemsOut.
Definition grid_impl.hpp:466
ObserverContainer m_volumeObservers
Definition grid.h:1165
EdgeAttachmentAccessor< AMark > m_aaMarkEDGE
Definition grid.h:1194
FaceAttachmentAccessor< AMark > m_aaMarkFACE
Definition grid.h:1195
void attach_to_all_dv(TAttachment &attachment, const typename TAttachment::ValueType &defaultValue)
attaches to vertices, edges, faces and volumes at once.
Definition grid_impl.hpp:333
geometry_traits< TGeomObj >::iterator create(GridObject *pParent=NULL)
create a custom element.
Definition grid_impl.hpp:69
AssociatedVolumeIterator associated_volumes_end(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition grid.cpp:1016
FaceContainer::iterator AssociatedFaceIterator
used to iterate over associated faces of vertices, edges and volumes
Definition grid.h:251
void enable_options(uint options)
see set_options for a description of valid parameters.
Definition grid.cpp:711
void associated_elements_sorted(traits< Vertex >::secure_container &elemsOut, TElem *e)
Puts all elements of type TAss which are contained in 'e' into elemsOut in the reference elements ord...
Definition grid_impl.hpp:503
geometry_traits< TGeomObj >::iterator end()
Definition grid_impl.hpp:175
void register_and_replace_element(Vertex *v, Vertex *pReplaceMe)
Definition grid_connection_managment.cpp:114
TAttachment::ContainerType * get_attachment_data_container(TAttachment &attachment)
Definition grid_impl.hpp:399
TGeomObj * front()
returns the first element of the given type.
Definition grid_impl.hpp:208
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition grid_base_objects.h:157
virtual int base_object_id() const =0
the interface for attachments.
Definition attachment_pipe.h:239
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
define the interface that enables you to use your own types as element-types in an AttachmentPipe.
Definition attachment_pipe.h:305
Definition grid_base_object_traits.h:68
#define GRID_PROFILE_FUNC()
Definition grid.h:57
bool CompareVertices(const FaceVertices *fv1, const FaceVertices *fv2)
Checks whether fv1 and fv2 contain the same vertices.
Definition grid_util.cpp:44
size_t hash_key(const TKey &key)
The hashing method can be specialized for different types.
Definition hash_function.h:50
#define LOG(msg)
Definition common.h:60
#define STATIC_ASSERT(expr, msg)
Definition common.h:61
unsigned int uint
Definition types.h:114
the ug namespace
@ VOLUME
Definition grid_base_objects.h:63
@ VERTEX
Definition grid_base_objects.h:60
@ EDGE
Definition grid_base_objects.h:61
@ FACE
Definition grid_base_objects.h:62
The traits class holds some important types for each element-type.
Definition grid.h:136
PointerConstArray< TElem * > secure_container
Definition grid.h:146