5#ifndef _MOLECULARDYNAMICS_COUPLING_SENDRECV_DATAEXCHANGEFROMMD2MACRO_H_
6#define _MOLECULARDYNAMICS_COUPLING_SENDRECV_DATAEXCHANGEFROMMD2MACRO_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 <<
"DataExchangeFromMD2Macro initialised..." << std::endl;
63 return _msi->getTargetRanks(idx);
66 return std::vector<unsigned int>();
77 std::vector<unsigned int> sourceRanks;
79 sourceRanks.push_back(IDXS.getUniqueRankForCouplingCell(idx, _topologyOffset));
92 for (
unsigned int d = 0; d < dim; d++) {
103 for (
unsigned int d = 0; d < dim; d++) {
104 macroscopicMomentum[d] = buffer[1 + d];
119 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 > & getMacroscopicMomentum() const
Definition CouplingCell.h:64
void setMacroscopicMomentum(const tarch::la::Vector< dim, double > &momentum)
Definition CouplingCell.h:61
const double & getMacroscopicMass() const
Definition CouplingCell.h:58
void setMacroscopicMass(const double &mass)
Definition CouplingCell.h:55
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 MD solver to the macroscopic solver. Derived from the class coupling::sendrecv...
Definition DataExchangeFromMD2Macro.h:36
virtual ~DataExchangeFromMD2Macro()
Definition DataExchangeFromMD2Macro.h:51
void writeToCell(const double *const buffer, coupling::datastructures::CouplingCell< dim > &cell) override
Definition DataExchangeFromMD2Macro.h:101
DataExchangeFromMD2Macro(coupling::interface::MacroscopicSolverInterface< dim > *interface, unsigned int topologyOffset, unsigned int tagoffset=0)
Definition DataExchangeFromMD2Macro.h:43
std::vector< unsigned int > getSourceRanks(I01 idx) override
Definition DataExchangeFromMD2Macro.h:76
void readFromCell(double *const buffer, const coupling::datastructures::CouplingCell< dim > &cell) override
Definition DataExchangeFromMD2Macro.h:90
unsigned int getDoublesPerCell() const override
Definition DataExchangeFromMD2Macro.h:112
std::vector< unsigned int > getTargetRanks(I01 idx) override
Definition DataExchangeFromMD2Macro.h:59
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