33 #ifndef __H__LIB_GRID__DISTRIBUTED_GRID__
34 #define __H__LIB_GRID__DISTRIBUTED_GRID__
134 template <
class TGeomObj>
140 template<
class TElem>
141 inline bool is_ghost(TElem* elem)
const;
144 template<
class TElem>
148 template<
class TElem>
170 template <
class TElem>
176 template <
class TElem>
178 std::vector<std::pair<int, size_t> >& vEntriesOut,
179 TElem* elem,
byte statusType,
bool clearContainer =
true);
214 bool replacesParent =
false);
218 bool replacesParent =
false);
222 bool replacesParent =
false);
226 bool replacesParent =
false);
229 Vertex* replacedBy = NULL);
232 Edge* replacedBy = NULL);
235 Face* replacedBy = NULL);
238 Volume* replacedBy = NULL);
248 template <
class TGeomObj>
258 template <
class TGeomObj,
class TLayoutMap>
260 byte newStatus,
bool addStatus =
false);
262 template <
class TGeomObj>
266 template <
class TElem>
268 bool replacesParent);
270 template <
class TElem,
class TScheduledElemMap,
class TParent>
277 template <
class TScheduledElemMap>
280 template <
class TElem>
283 template <
class TElem>
287 template <
class TElem>
296 template <
class TGeomObj>
301 typedef typename GridLayoutMap::template Types<TGeomObj>
361 if(iter->m_interface == interface)
382 return !
m_data->m_entries.empty();
Definition: smart_pointer.h:108
Be careful when creating copies of ElementInfo.
Definition: distributed_grid.h:298
size_t get_local_id(ConstEntryIterator iter) const
Definition: distributed_grid.h:350
int get_interface_type(ConstEntryIterator iter) const
Definition: distributed_grid.h:355
void reset()
Definition: distributed_grid.h:326
void remove_entry(Interface *interface)
Definition: distributed_grid.h:338
GridLayoutMap::template Types< TGeomObj >::Interface Interface
Definition: distributed_grid.h:302
Interface * get_interface(EntryIterator iter)
Definition: distributed_grid.h:353
int get_target_proc(EntryIterator iter) const
Definition: distributed_grid.h:351
OwnedPtr< Data > m_data
OwnedPtr is required to transfer ownership of the data-ptr during copy-operations.
Definition: distributed_grid.h:406
ConstEntryIterator entries_begin() const
Note: This method may only be called if is_interface_entry() returns true.
Definition: distributed_grid.h:345
bool has_data() const
Definition: distributed_grid.h:400
Data & data()
returns the data object. Creates it if necessary.
Definition: distributed_grid.h:393
std::list< Entry > EntryList
Definition: distributed_grid.h:317
int get_interface_type(EntryIterator iter) const
Definition: distributed_grid.h:354
EntryIterator entries_end()
Note: This method may only be called if is_interface_entry() returns true.
Definition: distributed_grid.h:343
int get_target_proc(ConstEntryIterator iter) const
Definition: distributed_grid.h:352
ElementInfo()
Definition: distributed_grid.h:322
EntryList::iterator EntryIterator
Definition: distributed_grid.h:318
bool is_interface_element()
Definition: distributed_grid.h:379
byte get_status() const
Definition: distributed_grid.h:373
void add_entry(Interface *interface, InterfaceElemIter iter, int intfcType)
Definition: distributed_grid.h:334
void set_status(byte status)
Definition: distributed_grid.h:367
EntryList::const_iterator ConstEntryIterator
Definition: distributed_grid.h:319
EntryIterator entries_begin()
Note: This method may only be called if is_interface_entry() returns true.
Definition: distributed_grid.h:342
Interface::iterator InterfaceElemIter
Definition: distributed_grid.h:303
EntryIterator find_entry(Interface *interface)
Note: This method may only be called if is_interface_entry() returns true.
Definition: distributed_grid.h:358
ConstEntryIterator entries_end() const
Note: This method may only be called if is_interface_entry() returns true.
Definition: distributed_grid.h:346
size_t get_local_id(EntryIterator iter) const
Definition: distributed_grid.h:349
~ElementInfo()
Definition: distributed_grid.h:324
manages the layouts and interfaces which are associated with a distributed grid.
Definition: distributed_grid.h:88
Grid::FaceAttachmentAccessor< AElemInfoFace > m_aaElemInfoFACE
Definition: distributed_grid.h:469
void collect_interface_entries(std::vector< std::pair< int, size_t > > &vEntriesOut, TElem *elem, byte statusType, bool clearContainer=true)
Definition: distributed_grid_impl.hpp:79
void add_element_to_interface(TElem *pElem, int procID)
Definition: distributed_grid.cpp:438
void handle_created_element(TElem *pElem, GridObject *pParent, bool replacesParent)
vertex_created, edge_created, ... callbacks call this method.
Definition: distributed_grid.cpp:570
void free_grid_data()
free's all grid related data
Definition: distributed_grid.cpp:129
ScheduledElemMap m_volMap
holds all elements that were scheduled by volumes
Definition: distributed_grid.h:475
virtual void grid_to_be_destroyed(Grid *grid)
Definition: distributed_grid.cpp:145
AElemInfoFace m_aElemInfoFace
Definition: distributed_grid.h:464
const MultiGrid * get_assigned_grid() const
Definition: distributed_grid.h:98
virtual void volume_created(Grid *grid, Volume *v, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: distributed_grid.cpp:695
byte get_status(Volume *vol) const
returns the status of the given object.
Definition: distributed_grid.h:128
void set_distro_adjuster(SmartPtr< DistroAdjuster > adj)
set a global distribution adjuster
Definition: distributed_grid.h:202
std::vector< Edge * > m_newConstrainedVerticalEdges
Definition: distributed_grid.h:478
ScheduledElemMap m_edgeMap
holds all elements that were scheduled by edges
Definition: distributed_grid.h:473
bool is_in_horizontal_interface(TElem *elem) const
returns true if the element is contained in a horizontal interface
Definition: distributed_grid_impl.hpp:51
byte get_status(Vertex *vrt) const
returns the status of the given object.
Definition: distributed_grid.h:125
virtual ~DistributedGridManager()
Definition: distributed_grid.cpp:76
ElementInfo< Vertex > ElemInfoVrt
Definition: distributed_grid.h:409
std::vector< Vertex * > m_newConstrainedVerticalVrts
Definition: distributed_grid.h:477
SmartPtr< DistroAdjuster > m_spDistroAdjuster
Definition: distributed_grid.h:481
std::multimap< size_t, ScheduledElement > ScheduledElemMap
Definition: distributed_grid.h:434
void begin_element_deletion()
call this method before you start deleting elements in the associated grid
Definition: distributed_grid.cpp:705
byte get_status(GridObject *go) const
returns the status of the given object.
Definition: distributed_grid.cpp:379
void clear_scheduled_elements()
Definition: distributed_grid.cpp:525
DistributedGridManager()
Definition: distributed_grid.cpp:47
void got_new_constrained_vertical(Vertex *v)
Definition: distributed_grid.h:447
const ElemInfoVol & elem_info(Volume *ele) const
Definition: distributed_grid.h:445
const ElemInfoEdge & elem_info(Edge *ele) const
Definition: distributed_grid.h:443
void set_grid(Grid *grid)
performs registration and deregistration at a grid.
Definition: distributed_grid.cpp:98
MultiGrid * m_pGrid
Definition: distributed_grid.h:454
ElemInfoVrt & elem_info(Vertex *ele)
Definition: distributed_grid.h:437
virtual void vertex_created(Grid *grid, Vertex *vrt, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: distributed_grid.cpp:673
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: distributed_grid.cpp:1261
ScheduledElemMap m_faceMap
holds all elements that were scheduled by faces
Definition: distributed_grid.h:474
void grid_layouts_changed(bool addedElemsOnly=false)
call this method if you altered the layout externally.
Definition: distributed_grid.cpp:280
ElemInfoVol & elem_info(Volume *ele)
Definition: distributed_grid.h:440
void got_new_constrained_vertical(Face *f)
Definition: distributed_grid.h:449
void got_new_constrained_vertical(Volume *)
Definition: distributed_grid.h:450
const ElemInfoVrt & elem_info(Vertex *ele) const
Definition: distributed_grid.h:442
Attachment< ElemInfoEdge > AElemInfoEdge
Definition: distributed_grid.h:415
virtual void face_created(Grid *grid, Face *f, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: distributed_grid.cpp:688
void begin_ordered_element_insertion()
call this method before you start creating new elements in the associated grid.
Definition: distributed_grid.cpp:400
void create_missing_constrained_h_interfaces(std::vector< TElem * > &newConstrainedElems)
Definition: distributed_grid.cpp:1042
bool m_interfaceManagementEnabled
only for debug purposes
Definition: distributed_grid.h:457
ElemInfoEdge & elem_info(Edge *ele)
Definition: distributed_grid.h:438
Grid::VertexAttachmentAccessor< AElemInfoVrt > m_aaElemInfoVRT
Definition: distributed_grid.h:467
ElementInfo< Edge > ElemInfoEdge
Definition: distributed_grid.h:410
void schedule_element_for_insertion(TScheduledElemMap &elemMap, TElem *elem, TParent *pParent)
Definition: distributed_grid.cpp:537
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: distributed_grid.cpp:1247
bool is_interface_element(TElem *elem)
returns true if an element is in one or more interfaces
Definition: distributed_grid_impl.hpp:44
void enable_interface_management(bool bEnable)
Enables or disables interface managment. Use with care!
Definition: distributed_grid.h:188
void update_all_elem_infos()
Definition: distributed_grid.cpp:307
GridLayoutMap m_gridLayoutMap
Definition: distributed_grid.h:455
void reset_elem_infos()
Definition: distributed_grid.cpp:324
virtual void edge_created(Grid *grid, Edge *e, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: distributed_grid.cpp:681
AElemInfoVol m_aElemInfoVol
Definition: distributed_grid.h:465
void got_new_constrained_vertical(Edge *e)
Definition: distributed_grid.h:448
ElementInfo< Face > ElemInfoFace
Definition: distributed_grid.h:411
Attachment< ElemInfoVrt > AElemInfoVrt
Definition: distributed_grid.h:414
Grid::VolumeAttachmentAccessor< AElemInfoVol > m_aaElemInfoVOL
Definition: distributed_grid.h:470
Grid::EdgeAttachmentAccessor< AElemInfoEdge > m_aaElemInfoEDGE
Definition: distributed_grid.h:468
ElementInfo< Volume > ElemInfoVol
Definition: distributed_grid.h:412
std::vector< Face * > m_newConstrainedVerticalFaces
Definition: distributed_grid.h:479
bool is_ghost(TElem *elem) const
returns true if the element is a ghost
Definition: distributed_grid_impl.hpp:67
void end_ordered_element_insertion()
call this method when you're done with element creation.
Definition: distributed_grid.cpp:505
byte get_status(Face *face) const
returns the status of the given object.
Definition: distributed_grid.h:127
Attachment< ElemInfoFace > AElemInfoFace
Definition: distributed_grid.h:416
GridLayoutMap & grid_layout_map()
Definition: distributed_grid.h:103
SmartPtr< DistroAdjuster > distro_adjuster()
get the distribution adjuster
Definition: distributed_grid.h:205
bool contains_status(TGeomObj *o, byte status) const
returns true if the status of the given object contains the given status.
Definition: distributed_grid.h:135
const GridLayoutMap & grid_layout_map() const
Definition: distributed_grid.h:104
bool is_in_vertical_interface(TElem *elem) const
returns true if the element is contained in a vertical interface
Definition: distributed_grid_impl.hpp:59
bool m_bOrderedInsertionMode
Definition: distributed_grid.h:459
ElemInfoFace & elem_info(Face *ele)
Definition: distributed_grid.h:439
AElemInfoVrt m_aElemInfoVrt
Definition: distributed_grid.h:462
void perform_ordered_element_insertion(TScheduledElemMap &elemMap)
Definition: distributed_grid.cpp:474
bool m_bElementDeletionMode
Definition: distributed_grid.h:460
void update_elem_info(TLayoutMap &layoutMap, int nodeType, byte newStatus, bool addStatus=false)
Definition: distributed_grid.cpp:337
MultiGrid * get_assigned_grid()
Definition: distributed_grid.h:97
byte get_status(Edge *edge) const
returns the status of the given object.
Definition: distributed_grid.h:126
void assign(MultiGrid &grid)
Definition: distributed_grid.cpp:92
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: distributed_grid.cpp:1254
AElemInfoEdge m_aElemInfoEdge
Definition: distributed_grid.h:463
void end_element_deletion()
call this method after you're done deleting elements from the associated grid
Definition: distributed_grid.cpp:1175
ScheduledElemMap m_vrtMap
holds all elements that were scheduled by vertices
Definition: distributed_grid.h:472
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: distributed_grid.cpp:1268
const ElemInfoFace & elem_info(Face *ele) const
Definition: distributed_grid.h:444
Attachment< ElemInfoVol > AElemInfoVol
Definition: distributed_grid.h:417
void element_to_be_erased(TElem *elem)
Definition: distributed_grid.cpp:1227
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
lets you access layouts by type and key
Definition: parallel_grid_layout.h:152
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Definition: grid_observer.h:80
Definition: multi_grid.h:72
Holds and automatically deletes a pointer, similar to std::auto_ptr. USE WITH CARE!
Definition: owned_pointer.h:63
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
ElementStatusTypes
the states with which elements are marked in ug::DistributedGridManager
Definition: distributed_grid.h:56
@ ES_V_SLAVE
Definition: distributed_grid.h:61
@ ES_IN_INTERFACE
Definition: distributed_grid.h:65
@ ES_H_MASTER
Definition: distributed_grid.h:58
@ ES_NONE
Definition: distributed_grid.h:57
@ ES_SCHEDULED_FOR_INTERFACE
Definition: distributed_grid.h:64
@ ES_V_MASTER
Definition: distributed_grid.h:60
@ ES_H_SLAVE
Definition: distributed_grid.h:59
#define UG_THROW(msg)
Definition: error.h:57
@ INT_NONE
Definition: parallel_grid_layout.h:103
@ INT_V_MASTER
vertical master node
Definition: parallel_grid_layout.h:106
@ INT_H_MASTER
horizontal master node
Definition: parallel_grid_layout.h:104
@ INT_H_SLAVE
horizontal slave node
Definition: parallel_grid_layout.h:105
@ INT_V_SLAVE
vertical slave node
Definition: parallel_grid_layout.h:107
Definition: parser_node.h:59
Definition: distributed_grid.h:386
EntryList m_entries
Definition: distributed_grid.h:388
byte m_status
Definition: distributed_grid.h:389
Data()
Definition: distributed_grid.h:387
Definition: distributed_grid.h:306
Interface * m_interface
Definition: distributed_grid.h:312
int m_interfaceType
Definition: distributed_grid.h:314
Entry()
Definition: distributed_grid.h:307
Entry(Interface *intfc, InterfaceElemIter intfcElemIter, int intfcType)
Definition: distributed_grid.h:308
InterfaceElemIter m_interfaceElemIter
Definition: distributed_grid.h:313
Used to schedule an element for insertion during ordered-insertion-mode.
Definition: distributed_grid.h:426
ScheduledElement(GridObject *obj, int procID)
Definition: distributed_grid.h:427
int connectedProcID
Definition: distributed_grid.h:431
GridObject * geomObj
Definition: distributed_grid.h:430