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

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

#include <DataExchangeFromMacro2MD.h>

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

Public Member Functions

 DataExchangeFromMacro2MD (coupling::interface::MacroscopicSolverInterface< dim > *interface, unsigned int topologyOffset, unsigned int tagoffset=0)
 
virtual ~DataExchangeFromMacro2MD ()
 
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::DataExchangeFromMacro2MD< dim >

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

data exchange from the macroscopic solver to the MD solver, that is to the coupling tool. We transfer the buffers microscopicMass and microscopicMomentum of the CouplingCell. The target ranks are determined by the getRanksForCouplingCell(): since coupling cells may exist on different ranks (due to ghost layers), this method determines all ranks with a particular coupling cell and returns a vector with all required ranks. The source ranks are determined via the macroscopic solver interface's method getRanks()

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

Constructor & Destructor Documentation

◆ DataExchangeFromMacro2MD()

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

Constructor

Parameters
interfacemacroscopic solver interface
tagoffset0 per default

◆ ~DataExchangeFromMacro2MD()

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

Destructor

Member Function Documentation

◆ getDoublesPerCell()

template<unsigned int dim>
unsigned int coupling::sendrecv::DataExchangeFromMacro2MD< 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::DataExchangeFromMacro2MD< 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::DataExchangeFromMacro2MD< 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, 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::DataExchangeFromMacro2MD< 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::DataExchangeFromMacro2MD< 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: