38 #ifndef __H__PLG__COMPOL_COPY_ATTACHMENT__
39 #define __H__PLG__COMPOL_COPY_ATTACHMENT__
52 template <
class TLayout,
class TAttachment>
60 typedef typename TAttachment::ValueType
Value;
104 template <
class TNodeLayout,
class TAttachment>
107 m_extractOnConstrainedElemsOnly(false)
112 template <
class TNodeLayout,
class TAttachment>
115 m_extractOnConstrainedElemsOnly(false)
121 template <
class TNodeLayout,
class TAttachment>
125 m_aaVal.access(grid, attachment);
129 template <
class TNodeLayout,
class TAttachment>
133 for(
typename Interface::const_iterator iter = interface.begin();
134 iter != interface.end(); ++iter)
136 Serialize(buff, m_aaVal[interface.get_element(iter)]);
142 template <
class TNodeLayout,
class TAttachment>
146 if(m_extractOnConstrainedElemsOnly){
147 for(
typename Interface::const_iterator iter = interface.begin();
148 iter != interface.end(); ++iter)
150 typename TAttachment::ValueType val;
152 if(interface.get_element(iter)->is_constrained())
153 m_aaVal[interface.get_element(iter)] = val;
157 for(
typename Interface::const_iterator iter = interface.begin();
158 iter != interface.end(); ++iter)
160 Deserialize(buff, m_aaVal[interface.get_element(iter)]);
166 template <
class TNodeLayout,
class TAttachment>
170 m_extractOnConstrainedElemsOnly = enable;
specializations are responsible to pack and unpack interface data during communication.
Definition: pcl_communication_structs.h:790
A Buffer for binary data.
Definition: binary_buffer.h:56
copies values from a specified attachment to a stream and back.
Definition: compol_copy_attachment.h:54
Layout::Element Element
Definition: compol_copy_attachment.h:58
virtual bool collect(ug::BinaryBuffer &buff, const Interface &interface)
writes the data for the given interface to the buffer.
Definition: compol_copy_attachment.h:131
Grid::AttachmentAccessor< GeomObj, TAttachment > m_aaVal
Definition: compol_copy_attachment.h:93
void set_attachment(Grid &grid, TAttachment &attachment)
The grid and the attachment from where the data shall be copied.
Definition: compol_copy_attachment.h:123
virtual ~ComPol_CopyAttachment()
Definition: compol_copy_attachment.h:69
void extract_on_constrained_elems_only(bool enable)
Definition: compol_copy_attachment.h:168
TLayout Layout
Definition: compol_copy_attachment.h:56
bool m_extractOnConstrainedElemsOnly
Definition: compol_copy_attachment.h:94
Layout::Type GeomObj
Definition: compol_copy_attachment.h:57
TAttachment::ValueType Value
Definition: compol_copy_attachment.h:60
ComPol_CopyAttachment()
Initialises the collector with an invalid grid.
Definition: compol_copy_attachment.h:106
Layout::Interface Interface
Definition: compol_copy_attachment.h:59
virtual bool extract(ug::BinaryBuffer &buff, const Interface &interface)
reads the data from the buffer to the given interface .
Definition: compol_copy_attachment.h:144
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
void Deserialize(TIStream &buf, ParallelVector< T > &v)
Deerialize for ParallelVector<T>
Definition: restart_bridge.cpp:112
void Serialize(TOStream &buf, const ParallelVector< T > &v)
Serialize for ParallelVector<T>
Definition: restart_bridge.cpp:103