1#ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_DATAHANDLE_HH
2#define DUNE_FEM_GRIDPART_FILTEREDGRIDPART_DATAHANDLE_HH
20 template<
class HostGr
idPartImp,
class FilterImp,
bool useFilteredIndexSet >
21 class FilteredGridPart;
28 template<
class WrappedHandle,
class Gr
idPart >
29 class FilteredGridPartDataHandle
30 :
public CommDataHandleIF< FilteredGridPartDataHandle< WrappedHandle, GridPart >, typename WrappedHandle::DataType >
32 typedef CommDataHandleIF< FilteredGridPartDataHandle< WrappedHandle, GridPart >,
33 typename WrappedHandle::DataType > BaseType;
34 typedef GridPart GridPartType;
35 typedef typename std::remove_const< GridPartType >::type::Traits Traits;
38 FilteredGridPartDataHandle ( WrappedHandle &dataHandle,
const GridPart &gridPart )
39 : gridPart_( gridPart ),
40 wrappedHandle_( dataHandle )
43 bool contains (
int dim,
int codim )
const
45 return wrappedHandle_.contains( dim, codim );
48 bool fixedSize (
int dim,
int codim )
const
53 template<
class HostEntity >
54 size_t size (
const HostEntity &hostEntity )
const
56 if( gridPart().
contains( hostEntity ) )
57 return wrappedHandle_.size( hostEntity );
62 template<
class MessageBuffer,
class HostEntity >
63 void gather ( MessageBuffer &buffer,
const HostEntity &hostEntity )
const
65 if( gridPart().
contains( hostEntity ) )
66 wrappedHandle_.gather( buffer, hostEntity );
69 template<
class MessageBuffer,
class HostEntity >
70 void scatter ( MessageBuffer &buffer,
const HostEntity &hostEntity,
size_t size )
72 if( gridPart().
contains( hostEntity ) )
73 wrappedHandle_.scatter( buffer, hostEntity,
size );
77 for (
size_t i=0;i<
size;++i)
83 const GridPart &gridPart ()
const
89 const GridPart &gridPart_;
90 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
DataTypeImp DataType
data type of data to communicate
Definition: datahandleif.hh:82
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