5#ifndef _MOLECULARDYNAMICS_COUPLING_SENDRECV_DATAEXCHANGEFROMMACRO2MD_H_
6#define _MOLECULARDYNAMICS_COUPLING_SENDRECV_DATAEXCHANGEFROMMACRO2MD_H_
8#include "coupling/CouplingMDDefinitions.h"
9#include "coupling/datastructures/CouplingCell.h"
10#include "coupling/indexing/IndexingService.h"
11#include "coupling/interface/MacroscopicSolverInterface.h"
12#include "coupling/sendrecv/DataExchange.h"
35template <
unsigned int dim>
45 _topologyOffset(topologyOffset) {
46#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
47 std::cout <<
"DataExchangeFromMacro2MD initialised..." << std::endl;
62 return IDXS.getRanksForGlobalIndex(idx, _topologyOffset);
65 return std::vector<unsigned int>();
76 return _msi->getSourceRanks(idx);
78 return std::vector<unsigned int>();
89 for (
unsigned int d = 0; d < dim; d++) {
100 for (
unsigned int d = 0; d < dim; d++) {
101 microscopicMomentum[d] = buffer[1 + d];
116 unsigned int _topologyOffset;
defines the cell type with cell-averaged quantities only (no linked cells).
Definition CouplingCell.h:29
const tarch::la::Vector< dim, double > & getMicroscopicMomentum() const
Definition CouplingCell.h:51
void setMicroscopicMass(const double &mass)
Definition CouplingCell.h:42
const double & getMicroscopicMass() const
Definition CouplingCell.h:45
void setMicroscopicMomentum(const tarch::la::Vector< dim, double > &momentum)
Definition CouplingCell.h:48
static bool contains(const coupling::indexing::BaseIndex< dim > &index)
Definition CellIndex.h:227
interface for the macroscopic, i.e. continuum solver
Definition MacroscopicSolverInterface.h:23
data exchange from the macroscopic solver to the MD solver. Derived from the class coupling::sendrecv...
Definition DataExchangeFromMacro2MD.h:36
std::vector< unsigned int > getSourceRanks(I01 idx) override
Definition DataExchangeFromMacro2MD.h:74
void readFromCell(double *const buffer, const coupling::datastructures::CouplingCell< dim > &cell) override
Definition DataExchangeFromMacro2MD.h:87
unsigned int getDoublesPerCell() const override
Definition DataExchangeFromMacro2MD.h:109
DataExchangeFromMacro2MD(coupling::interface::MacroscopicSolverInterface< dim > *interface, unsigned int topologyOffset, unsigned int tagoffset=0)
Definition DataExchangeFromMacro2MD.h:43
void writeToCell(const double *const buffer, coupling::datastructures::CouplingCell< dim > &cell) override
Definition DataExchangeFromMacro2MD.h:98
std::vector< unsigned int > getTargetRanks(I01 idx) override
Definition DataExchangeFromMacro2MD.h:59
virtual ~DataExchangeFromMacro2MD()
Definition DataExchangeFromMacro2MD.h:51
generic class for the the data exchange purposes.
Definition DataExchange.h:27
DataExchange(unsigned int tag)
Definition DataExchange.h:32
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15