MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::sendrecv::DataExchangeFromMD2Macro< dim > Class Template Reference

data exchange from the MD solver to the macroscopic solver. Derived from the class coupling::sendrecv::DataExchange More...

#include <DataExchangeFromMD2Macro.h>

Inheritance diagram for coupling::sendrecv::DataExchangeFromMD2Macro< dim >:
Collaboration diagram for coupling::sendrecv::DataExchangeFromMD2Macro< dim >:

Public Member Functions

 DataExchangeFromMD2Macro (coupling::interface::MacroscopicSolverInterface< dim > *interface, unsigned int topologyOffset, unsigned int tagoffset=0)
 
virtual ~DataExchangeFromMD2Macro ()
 
std::vector< unsigned int > getTargetRanks (I01 idx) override
 
std::vector< unsigned int > getSourceRanks (I01 idx) override
 
void readFromCell (double *const buffer, const coupling::datastructures::CouplingCell< dim > &cell) override
 
void writeToCell (const double *const buffer, coupling::datastructures::CouplingCell< dim > &cell) override
 
unsigned int getDoublesPerCell () const override
 
- Public Member Functions inherited from coupling::sendrecv::DataExchange< coupling::datastructures::CouplingCell< dim >, dim >
 DataExchange (unsigned int tag)
 
virtual ~DataExchange ()
 
unsigned int getTag () const
 

Private Attributes

coupling::interface::MacroscopicSolverInterface< dim > * _msi
 
unsigned int _topologyOffset
 

Detailed Description

template<unsigned int dim>
class coupling::sendrecv::DataExchangeFromMD2Macro< dim >

data exchange from the MD solver to the macroscopic solver. Derived from the class coupling::sendrecv::DataExchange

data exchange from MD, that is the coupling tool, to the macroscopic solver. We transfer the buffers macroscopicMass and macroscopicMomentum of the CouplingCell. The target ranks are determined by the getRanks()-method of the macroscopic solver interface: the macroscopic solver interface thus needs to know on which ranks information from the MD simulation are required as input. The source ranks arise from the unique rank determination within the IndexConversion. We only allow transfer of non-ghost coupling cells to the macroscopic solver, i.e. cells which are completely embedded into the MD domain.

Template Parameters
dimNumber of dimensions; it can be 1, 2 or 3
See also
DataExchangeFromMacro2MD
Author
Philipp Neumann

Constructor & Destructor Documentation

◆ DataExchangeFromMD2Macro()

template<unsigned int dim>
coupling::sendrecv::DataExchangeFromMD2Macro< dim >::DataExchangeFromMD2Macro ( coupling::interface::MacroscopicSolverInterface< dim > * interface,
unsigned int topologyOffset,
unsigned int tagoffset = 0 )
inline

Constructor

Parameters
interfacemacroscopic solver interface
tagoffset0 per default

◆ ~DataExchangeFromMD2Macro()

template<unsigned int dim>
virtual coupling::sendrecv::DataExchangeFromMD2Macro< dim >::~DataExchangeFromMD2Macro ( )
inlinevirtual

Destructor

Member Function Documentation

◆ getDoublesPerCell()

template<unsigned int dim>
unsigned int coupling::sendrecv::DataExchangeFromMD2Macro< dim >::getDoublesPerCell ( ) const
inlineoverridevirtual

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

Returns
1+dim

Implements coupling::sendrecv::DataExchange< coupling::datastructures::CouplingCell< dim >, dim >.

◆ getSourceRanks()

template<unsigned int dim>
std::vector< unsigned int > coupling::sendrecv::DataExchangeFromMD2Macro< dim >::getSourceRanks ( I01 idx)
inlineoverridevirtual

returns all ranks from which a particular cell (at index idx) is sent.

Parameters
idx
Returns
the corresponding ranks via MacroscopicSolverInterface, if we need information on MD side, otherwise empty vector

Implements coupling::sendrecv::DataExchange< coupling::datastructures::CouplingCell< dim >, dim >.

◆ getTargetRanks()

template<unsigned int dim>
std::vector< unsigned int > coupling::sendrecv::DataExchangeFromMD2Macro< dim >::getTargetRanks ( I01 idx)
inlineoverridevirtual

returns the ranks to which a particular cell (at index idx) should be sent.

Parameters
idx
Returns
the corresponding ranks via IndexConversion, if we need information on MD side, otherwise empty vector

Implements coupling::sendrecv::DataExchange< coupling::datastructures::CouplingCell< dim >, dim >.

◆ readFromCell()

template<unsigned int dim>
void coupling::sendrecv::DataExchangeFromMD2Macro< dim >::readFromCell ( double *const buffer,
const coupling::datastructures::CouplingCell< dim > & cell )
inlineoverridevirtual

local rule to read from coupling cell and write data to (e.g. send) buffer. We only send the macroscopic mass and macroscopic momentum from MD to the macroscopic solver.

Parameters
buffer
cell

Implements coupling::sendrecv::DataExchange< coupling::datastructures::CouplingCell< dim >, dim >.

◆ writeToCell()

template<unsigned int dim>
void coupling::sendrecv::DataExchangeFromMD2Macro< dim >::writeToCell ( const double *const buffer,
coupling::datastructures::CouplingCell< dim > & cell )
inlineoverridevirtual

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

Parameters
buffer
cell

Implements coupling::sendrecv::DataExchange< coupling::datastructures::CouplingCell< dim >, dim >.


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