1#ifndef DUNE_IDGRID_DATAHANDLE_HH
2#define DUNE_IDGRID_DATAHANDLE_HH
11#include <dune/alugrid/common/ldbhandleif.hh>
20 template<
class WrappedHandle,
class Gr
idFamily >
22 :
public CommDataHandleIF< IdDataHandle< WrappedHandle, GridFamily >, typename WrappedHandle::DataType >
25 typedef IdDataHandle< WrappedHandle, GridFamily > ThisType;
28 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
30 typedef typename Traits :: ExtraData ExtraData ;
36 typedef typename Traits::template Codim< codim >::Entity EntityType;
41 typedef typename WrappedHandle::DataType DataType;
43 typedef CommDataHandleIF< ThisType, DataType > DataHandleIFType;
45 IdDataHandle (
const ThisType & ) =
delete;
47 IdDataHandle ( ExtraData data, WrappedHandle &wrappedHandle )
48 : wrappedHandle_( wrappedHandle ),
52 bool contains (
int dim,
int codim )
const
54 return wrappedHandle_.contains( dim, codim );
57 bool fixedSize (
int dim,
int codim )
const
59 return wrappedHandle_.fixedSize( dim, codim );
62 template<
class HostEntity >
63 size_t size (
const HostEntity &hostEntity )
const
65 typedef typename Codim< HostEntity::codimension >::EntityType EntityType;
66 const EntityType entity(
typename EntityType::Implementation( data(), hostEntity ) );
67 return wrappedHandle_.size( entity );
70 template<
class MessageBuffer,
class HostEntity >
71 void gather ( MessageBuffer &buffer,
const HostEntity &hostEntity )
const
73 typedef typename Codim< HostEntity::codimension >::EntityType EntityType;
74 const EntityType entity(
typename EntityType::Implementation( data(), hostEntity ) );
75 wrappedHandle_.gather( buffer, entity );
78 template<
class MessageBuffer,
class HostEntity >
79 void scatter ( MessageBuffer &buffer,
const HostEntity &hostEntity,
size_t size )
81 typedef typename Codim< HostEntity::codimension >::EntityType EntityType;
82 const EntityType entity(
typename EntityType::Implementation( data(), hostEntity ) );
83 wrappedHandle_.scatter( buffer, entity,
size );
86 ExtraData data()
const {
return data_; }
89 WrappedHandle &wrappedHandle_;
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
unpack data from message buffer to user.
Definition: datahandleif.hh:143
void gather(MessageBufferImp &buff, const EntityType &e) const
pack data from user to message buffer
Definition: datahandleif.hh:129
Describes the parallel communication interface class for MessageBuffers and DataHandles.
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
constexpr std::bool_constant<((II==value)||...)> contains(std::integer_sequence< T, II... >, std::integral_constant< T, value >)
Checks whether or not a given sequence contains a value.
Definition: integersequence.hh:137
std::size_t fixedSize
The number of data items per index if it is fixed, 0 otherwise.
Definition: variablesizecommunicator.hh:264