Dune Core Modules (2.9.1)

Dune::CommDataHandleIF< DataHandleImp, DataTypeImp > Class Template Reference

CommDataHandleIF describes the features of a data handle for communication in parallel runs using the Grid::communicate methods. Here the Barton-Nackman trick is used to interprete data handle objects as its interface. Therefore usable data handle classes need to be derived from this class. More...

#include <dune/grid/common/datahandleif.hh>

Public Types

typedef DataTypeImp DataType
 data type of data to communicate
 

Public Member Functions

bool contains (int dim, int codim) const
 returns true if data for given valid codim should be communicated More...
 
int fixedsize (int dim, int codim) const
 returns true if size of data per entity of given dim and codim is a constant More...
 
bool fixedSize (int dim, int codim) const
 returns true if size of data per entity of given dim and codim is a constant More...
 
template<class EntityType >
size_t size (const EntityType &e) const
 how many objects of type DataType have to be sent for a given entity More...
 
template<class MessageBufferImp , class EntityType >
void gather (MessageBufferImp &buff, const EntityType &e) const
 pack data from user to message buffer More...
 
template<class MessageBufferImp , class EntityType >
void scatter (MessageBufferImp &buff, const EntityType &e, size_t n)
 unpack data from message buffer to user. More...
 

Detailed Description

template<class DataHandleImp, class DataTypeImp>
class Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >

CommDataHandleIF describes the features of a data handle for communication in parallel runs using the Grid::communicate methods. Here the Barton-Nackman trick is used to interprete data handle objects as its interface. Therefore usable data handle classes need to be derived from this class.

Template Parameters
DataHandleImpimplementation of the users data handle
DataTypeImptype of data that are going to be communicated which is exported as DataType (for example double)

Member Function Documentation

◆ contains()

template<class DataHandleImp , class DataTypeImp >
bool Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::contains ( int  dim,
int  codim 
) const
inline

returns true if data for given valid codim should be communicated

Parameters
dimvalid dimension (i.e. the grids dimension)
codimvalid codimension of the entity set for which data should be communicated

◆ fixedsize()

template<class DataHandleImp , class DataTypeImp >
int Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::fixedsize ( int  dim,
int  codim 
) const
inline

returns true if size of data per entity of given dim and codim is a constant

Parameters
dimvalid dimension (i.e. the grids dimension)
codimvalid codimension of the entity set for which data should be communicated

This method calls 'fixedSize' (with a capital S) of the derived class, if it exists in the derived class. Otherwise, it calls 'fixedsize'.

Deprecated:
This method (with the lower-case 's') is deprecated. Use 'fixedSize' instead!

References Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::fixedSize().

◆ fixedSize()

template<class DataHandleImp , class DataTypeImp >
bool Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::fixedSize ( int  dim,
int  codim 
) const
inline

returns true if size of data per entity of given dim and codim is a constant

Parameters
dimvalid dimension (i.e. the grids dimension)
codimvalid codimension of the entity set for which data should be communicated

This method calls 'fixedSize' of the derived class.

References Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::fixedSize().

Referenced by Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::fixedsize(), and Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::fixedSize().

◆ gather()

template<class DataHandleImp , class DataTypeImp >
template<class MessageBufferImp , class EntityType >
void Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::gather ( MessageBufferImp &  buff,
const EntityType &  e 
) const
inline

pack data from user to message buffer

Parameters
buffmessage buffer provided by the grid
eentity for which date should be packed to buffer

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::gather().

Referenced by Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::gather().

◆ scatter()

template<class DataHandleImp , class DataTypeImp >
template<class MessageBufferImp , class EntityType >
void Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::scatter ( MessageBufferImp &  buff,
const EntityType &  e,
size_t  n 
)
inline

unpack data from message buffer to user.

Parameters
buffmessage buffer provided by the grid. This is not const, because the buffer has an internal iterator that gets advanced when reading from the buffer.
eentity for which date should be unpacked from buffer
nnumber of data written to buffer for this entity before

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::scatter().

Referenced by Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::scatter().

◆ size()

template<class DataHandleImp , class DataTypeImp >
template<class EntityType >
size_t Dune::CommDataHandleIF< DataHandleImp, DataTypeImp >::size ( const EntityType &  e) const
inline

how many objects of type DataType have to be sent for a given entity

Note
Only the sender side needs to know this size.
Parameters
eentity for which the size should be determined

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)