MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::sendrecv::DataExchange< Cell_T, dim > Class Template Referenceabstract

generic class for the the data exchange purposes. More...

#include <DataExchange.h>

Public Member Functions

 DataExchange (unsigned int tag)
 
virtual ~DataExchange ()
 
unsigned int getTag () const
 
virtual std::vector< unsigned int > getTargetRanks (I01 idx)=0
 
virtual std::vector< unsigned int > getSourceRanks (I01 idx)=0
 
virtual void readFromCell (double *const buffer, const Cell_T &cell)=0
 
virtual void writeToCell (const double *const buffer, Cell_T &cell)=0
 
virtual unsigned int getDoublesPerCell () const =0
 

Private Attributes

const unsigned int _tag
 

Detailed Description

template<class Cell_T, unsigned int dim>
class coupling::sendrecv::DataExchange< Cell_T, dim >

generic class for the the data exchange purposes.

This class holds information on the data exchange between processes. In contrast to the SendReceiveBuffer which solely handles the technical part of sending and receiving, this class needs to guarantee the validity in communication, e.g. make sure that each source rank matches to a target rank etc.

Template Parameters
CouplingCellcell type
dimNumber of dimensions; it can be 1, 2 or 3
Author
Philipp Neumann

Constructor & Destructor Documentation

◆ DataExchange()

template<class Cell_T, unsigned int dim>
coupling::sendrecv::DataExchange< Cell_T, dim >::DataExchange ( unsigned int tag)
inline

Constructor: assign an tag (_tag) to the DataExchange.

Parameters
tag

◆ ~DataExchange()

template<class Cell_T, unsigned int dim>
virtual coupling::sendrecv::DataExchange< Cell_T, dim >::~DataExchange ( )
inlinevirtual

Destructor

Member Function Documentation

◆ getDoublesPerCell()

template<class Cell_T, unsigned int dim>
virtual unsigned int coupling::sendrecv::DataExchange< Cell_T, dim >::getDoublesPerCell ( ) const
pure virtual

returns the number of doubles that are sent per coupling cell.

Implemented in coupling::sendrecv::DataExchangeFromMacro2MD< dim >, and coupling::sendrecv::DataExchangeFromMD2Macro< dim >.

◆ getSourceRanks()

template<class Cell_T, unsigned int dim>
virtual std::vector< unsigned int > coupling::sendrecv::DataExchange< Cell_T, dim >::getSourceRanks ( I01 idx)
pure virtual

returns all ranks from which a particular cell (at index idx) is sent. This method should globally define the source ranks for each global cell index of a coupling cell.

Parameters
idxunique global cell index

Implemented in coupling::sendrecv::DataExchangeFromMacro2MD< dim >, and coupling::sendrecv::DataExchangeFromMD2Macro< dim >.

◆ getTag()

template<class Cell_T, unsigned int dim>
unsigned int coupling::sendrecv::DataExchange< Cell_T, dim >::getTag ( ) const
inline

returns the tag associated to messages for this DataExchange.

Returns
_tag

◆ getTargetRanks()

template<class Cell_T, unsigned int dim>
virtual std::vector< unsigned int > coupling::sendrecv::DataExchange< Cell_T, dim >::getTargetRanks ( I01 idx)
pure virtual

returns the ranks to which a particular cell (at index idx) should be sent. This method should globally define the target ranks for each global cell index of a coupling cell.

Parameters
idxunique global cell index

Implemented in coupling::sendrecv::DataExchangeFromMacro2MD< dim >, and coupling::sendrecv::DataExchangeFromMD2Macro< dim >.

◆ readFromCell()

template<class Cell_T, unsigned int dim>
virtual void coupling::sendrecv::DataExchange< Cell_T, dim >::readFromCell ( double *const buffer,
const Cell_T & cell )
pure virtual

local rule to read from a coupling cell and write data to (e.g. send) buffer

Parameters
buffer
cell

Implemented in coupling::sendrecv::DataExchangeFromMacro2MD< dim >, and coupling::sendrecv::DataExchangeFromMD2Macro< dim >.

◆ writeToCell()

template<class Cell_T, unsigned int dim>
virtual void coupling::sendrecv::DataExchange< Cell_T, dim >::writeToCell ( const double *const buffer,
Cell_T & cell )
pure virtual

local rule to read from receive buffer and write data to coupling cell

Parameters
buffer
cell

Implemented in coupling::sendrecv::DataExchangeFromMacro2MD< dim >, and coupling::sendrecv::DataExchangeFromMD2Macro< dim >.

Member Data Documentation

◆ _tag

template<class Cell_T, unsigned int dim>
const unsigned int coupling::sendrecv::DataExchange< Cell_T, dim >::_tag
private

tag to uniquely determine these kinds of messages that are sent between processes.


The documentation for this class was generated from the following file: