3 #ifndef DUNE_DATAHANDLEIF_HH 4 #define DUNE_DATAHANDLEIF_HH 12 #include <dune/common/bartonnackmanifcheck.hh> 29 template <
class MessageBufferImp>
32 MessageBufferImp & buff_;
71 template <
class DataHandleImp,
class DataTypeImp>
90 CHECK_INTERFACE_IMPLEMENTATION((asImp().contains(dim,codim)));
91 return asImp().contains(dim,codim);
107 auto derPtr = &DataHandleImp::fixedSize;
108 bool hasOverwrittenFixedSize = basePtr != derPtr;
109 if (hasOverwrittenFixedSize)
112 return asImp().fixedsize(dim,codim);
126 auto derPtr = &DataHandleImp::fixedSize;
127 bool hasOverwrittenFixedSize = basePtr != derPtr;
128 if (hasOverwrittenFixedSize)
131 return asImp().fixedsize(dim,codim);
138 template<
class EntityType>
139 size_t size (
const EntityType& e)
const 141 CHECK_INTERFACE_IMPLEMENTATION((asImp().size(e)));
142 return asImp().size(e);
149 template<
class MessageBufferImp,
class EntityType>
150 void gather (MessageBufferImp& buff,
const EntityType& e)
const 153 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().gather(buffIF,e)));
161 template<
class MessageBufferImp,
class EntityType>
162 void scatter (MessageBufferImp& buff,
const EntityType& e,
size_t n)
165 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().scatter(buffIF,e,n)));
170 DataHandleImp& asImp () {
return static_cast<DataHandleImp &
> (*this);}
172 const DataHandleImp& asImp ()
const 174 return static_cast<const DataHandleImp &
>(*this);
178 #undef CHECK_INTERFACE_IMPLEMENTATION 179 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION 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
CommDataHandleIF()
Definition: datahandleif.hh:80
Communication message buffer interface. This class describes the interface for reading and writing da...
Definition: datahandleif.hh:30
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:123
MessageBufferIF(MessageBufferImp &buff)
stores reference to original buffer buff
Definition: datahandleif.hh:35
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:104
Include standard header files.
Definition: agrid.hh:59
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:72
void read(T &val) const
just wraps the call of the internal buffer method read which reads the data of type T from the buffer...
Definition: datahandleif.hh:54
size_t size(const EntityType &e) const
how many objects of type DataType have to be sent for a given entity
Definition: datahandleif.hh:139
void gather(MessageBufferImp &buff, const EntityType &e) const
pack data from user to message buffer
Definition: datahandleif.hh:150
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
unpack data from message buffer to user.
Definition: datahandleif.hh:162
bool contains(int dim, int codim) const
returns true if data for given valid codim should be communicated
Definition: datahandleif.hh:88
DataTypeImp DataType
data type of data to communicate
Definition: datahandleif.hh:76