33 #ifndef LIB_GRID__COPY_ATTACHMENT_HANDLER_H_
34 #define LIB_GRID__COPY_ATTACHMENT_HANDLER_H_
101 template <
typename TElem,
typename TAttachment>
113 m_spMG->unregister_observer(
this);
138 m_spMG->unregister_observer(
this);
151 "Given grid does not have given attachment attached to it.");
172 bool replacesParent =
false
183 bool replacesParent =
false
194 bool replacesParent =
false
205 bool replacesParent =
false
214 template <
typename TCreatedElem,
typename Dummy>
221 template <
typename Dummy>
227 if (!pParent)
return;
230 TElem* par =
dynamic_cast<TElem*
>(pParent);
238 cah->
copy(par, elem);
242 friend struct propagate<TElem, void>;
244 template <
typename TObserverElem,
typename Dummy>
250 template <
typename Dummy>
258 template <
typename Dummy>
266 template <
typename Dummy>
274 template <
typename Dummy>
288 for (
size_t i = 1; i < nProp; ++i)
310 iter_type iter =
m_spMG->begin<TElem>(lvl);
311 iter_type iter_end =
m_spMG->end<TElem>(lvl);
312 for (; iter != iter_end; ++iter)
314 TElem* child = *iter;
321 virtual void copy(TElem* parent, TElem* child)
bool valid() const
returns true if the pointer is valid, false if not.
Definition: smart_pointer.h:206
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
bool communicate(int tag=749345)
sends and receives the collected data.
Definition: pcl_interface_communicator_impl.hpp:409
void exchange_data(const TLayoutMap &layoutMap, const typename TLayoutMap::Key &keyFrom, const typename TLayoutMap::Key &keyTo, ICommunicationPolicy< TLayout > &commPol)
internally calls send_data and receive_data with the specified layouts.
Definition: pcl_interface_communicator_impl.hpp:213
the standard multi-level-layout implementation
Definition: pcl_communication_structs.h:615
copies values from a specified attachment to a stream and back.
Definition: compol_copy_attachment.h:54
handler for attachments in a multi-grid
Definition: copy_attachment_handler.h:103
virtual void volume_created(Grid *grid, Volume *vol, GridObject *pParent=NULL, bool replacesParent=false)
Notified whenever a new element of the given type is created in the given grid.
Definition: copy_attachment_handler.h:201
void set_grid(SmartPtr< MultiGrid > mg)
Definition: copy_attachment_handler.h:130
virtual ~CopyAttachmentHandler()
destructor
Definition: copy_attachment_handler.h:110
void set_attachment(const TAttachment &attch)
Definition: copy_attachment_handler.h:118
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: copy_attachment_handler.h:190
CopyAttachmentHandler()
constructor
Definition: copy_attachment_handler.h:106
void propagate_to_levels()
Definition: copy_attachment_handler.h:284
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: copy_attachment_handler.h:179
virtual void copy_from_other_elem_type(GridObject *parent, TElem *child)
Definition: copy_attachment_handler.h:326
void enable_vertical_communication(bool b)
Definition: copy_attachment_handler.h:160
void propagate_to_level(size_t lvl, bool vertComm=true)
Definition: copy_attachment_handler.h:292
friend struct propagate< TElem, void >
Definition: copy_attachment_handler.h:242
virtual void copy(TElem *parent, TElem *child)
Definition: copy_attachment_handler.h:321
TAttachment m_a
attachment to be handled
Definition: copy_attachment_handler.h:335
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: copy_attachment_handler.h:168
Grid::AttachmentAccessor< TElem, TAttachment > m_aa
accessor for handled attachment
Definition: copy_attachment_handler.h:338
bool m_bEnableVertComm
Definition: copy_attachment_handler.h:332
SmartPtr< MultiGrid > m_spMG
multigrid
Definition: copy_attachment_handler.h:326
manages the layouts and interfaces which are associated with a distributed grid.
Definition: distributed_grid.h:88
GridLayoutMap & grid_layout_map()
Definition: distributed_grid.h:103
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
the generic attachment-accessor for access to grids attachment pipes.
Definition: grid.h:182
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
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
Definition: grid_base_object_traits.h:68
int NumProcs()
returns the number of processes
Definition: pcl_base.cpp:91
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
@ OT_VERTEX_OBSERVER
Definition: grid_observer.h:55
@ OT_VOLUME_OBSERVER
Definition: grid_observer.h:58
@ OT_FACE_OBSERVER
Definition: grid_observer.h:57
@ OT_EDGE_OBSERVER
Definition: grid_observer.h:56
@ INT_V_MASTER
vertical master node
Definition: parallel_grid_layout.h:106
@ INT_V_SLAVE
vertical slave node
Definition: parallel_grid_layout.h:107
propagate(TElem *elem, GridObject *pParent, CopyAttachmentHandler< TElem, TAttachment > *cah)
Definition: copy_attachment_handler.h:224
Definition: copy_attachment_handler.h:216
propagate(TCreatedElem *elem, GridObject *pParent, CopyAttachmentHandler< TElem, TAttachment > *cah)
Definition: copy_attachment_handler.h:217
register_as_observer(SmartPtr< MultiGrid > mg, CopyAttachmentHandler< Edge, TAttachment > *cah)
Definition: copy_attachment_handler.h:261
register_as_observer(SmartPtr< MultiGrid > mg, CopyAttachmentHandler< Face, TAttachment > *cah)
Definition: copy_attachment_handler.h:269
register_as_observer(SmartPtr< MultiGrid > mg, CopyAttachmentHandler< Vertex, TAttachment > *cah)
Definition: copy_attachment_handler.h:253
register_as_observer(SmartPtr< MultiGrid > mg, CopyAttachmentHandler< Volume, TAttachment > *cah)
Definition: copy_attachment_handler.h:277
Definition: copy_attachment_handler.h:246
register_as_observer(SmartPtr< MultiGrid > mg, CopyAttachmentHandler< TObserverElem, TAttachment > *cah)
Definition: copy_attachment_handler.h:247