Go to the documentation of this file.
3 #ifndef DUNE_DATAHANDLEIF_HH
4 #define DUNE_DATAHANDLEIF_HH
12 #include <dune/common/bartonnackmanifcheck.hh>
29 template <
class MessageBufferImp>
32 MessageBufferImp & buff_;
74 template <
class DataHandleImp,
class DataTypeImp>
93 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(dim,codim)));
94 return asImp().contains(dim,codim);
110 auto derPtr = &DataHandleImp::fixedSize;
111 bool hasOverwrittenFixedSize = basePtr != derPtr;
112 if (hasOverwrittenFixedSize)
113 return asImp().fixedSize(dim,codim);
115 return asImp().fixedsize(dim,codim);
129 auto derPtr = &DataHandleImp::fixedSize;
130 bool hasOverwrittenFixedSize = basePtr != derPtr;
131 if (hasOverwrittenFixedSize)
132 return asImp().fixedSize(dim,codim);
134 return asImp().fixedsize(dim,codim);
141 template<
class EntityType>
142 size_t size (
const EntityType& e)
const
144 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size(e)));
145 return asImp().size(e);
152 template<
class MessageBufferImp,
class EntityType>
153 void gather (MessageBufferImp& buff,
const EntityType& e)
const
156 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
gather(buffIF,e)));
166 template<
class MessageBufferImp,
class EntityType>
167 void scatter (MessageBufferImp& buff,
const EntityType& e,
size_t n)
170 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
scatter(buffIF,e,n)));
175 DataHandleImp& asImp () {
return static_cast<DataHandleImp &
> (*this);}
177 const DataHandleImp& asImp ()
const
179 return static_cast<const DataHandleImp &
>(*this);
183 #undef CHECK_INTERFACE_IMPLEMENTATION
184 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
void read(T &val)
just wraps the call of the internal buffer method read which reads the data of type T from the buffer...
Definition: datahandleif.hh:57
bool fixedSize(int dim, int codim) const
returns true if size of data per entity of given dim and codim is a constant
Definition: datahandleif.hh:126
bool contains(int dim, int codim) const
returns true if data for given valid codim should be communicated
Definition: datahandleif.hh:91
bool fixedsize(int dim, int codim) const
returns true if size of data per entity of given dim and codim is a constant
Definition: datahandleif.hh:107
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:75
DataTypeImp DataType
data type of data to communicate
Definition: datahandleif.hh:79
void write(const T &val)
just wraps the call of the internal buffer method write which writes the data of type T from the buff...
Definition: datahandleif.hh:43
size_t size(const EntityType &e) const
how many objects of type DataType have to be sent for a given entity
Definition: datahandleif.hh:142
CommDataHandleIF()
Definition: datahandleif.hh:83
void gather(MessageBufferImp &buff, const EntityType &e) const
pack data from user to message buffer
Definition: datahandleif.hh:153
Communication message buffer interface. This class describes the interface for reading and writing da...
Definition: datahandleif.hh:30
MessageBufferIF(MessageBufferImp &buff)
stores reference to original buffer buff
Definition: datahandleif.hh:35
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
unpack data from message buffer to user.
Definition: datahandleif.hh:167
Include standard header files.
Definition: agrid.hh:58