MaMiCo 1.2
Loading...
Searching...
No Matches
DataExchange.h
1// Copyright (C) 2015 Technische Universitaet Muenchen
2// This file is part of the Mamico project. For conditions of distribution
3// and use, please see the copyright notice in Mamico's main folder, or at
4// www5.in.tum.de/mamico
5#ifndef _MOLECULARDYNAMICS_COUPLING_SENDRECV_DATAEXCHANGE_H_
6#define _MOLECULARDYNAMICS_COUPLING_SENDRECV_DATAEXCHANGE_H_
7
8#include "coupling/datastructures/CouplingCell.h"
9#include "tarch/la/Vector.h"
10
11namespace coupling {
12namespace sendrecv {
13template <class Cell_T, unsigned int dim> class DataExchange;
14}
15} // namespace coupling
16
27template <class Cell_T, unsigned int dim> class coupling::sendrecv::DataExchange {
28public:
32 DataExchange(unsigned int tag) : _tag(tag) {}
34 virtual ~DataExchange() {}
35
38 unsigned int getTag() const { return _tag; }
39
45 virtual std::vector<unsigned int> getTargetRanks(I01 idx) = 0;
46
52 virtual std::vector<unsigned int> getSourceRanks(I01 idx) = 0;
53
59 virtual void readFromCell(double* const buffer, const Cell_T& cell) = 0;
60
65 virtual void writeToCell(const double* const buffer, Cell_T& cell) = 0;
66
68 virtual unsigned int getDoublesPerCell() const = 0;
69
70private:
73 const unsigned int _tag;
74};
75
76#endif // _MOLECULARDYNAMICS_COUPLING_SENDRECV_DATAEXCHANGE_H_
generic class for the the data exchange purposes.
Definition DataExchange.h:27
const unsigned int _tag
Definition DataExchange.h:73
virtual std::vector< unsigned int > getSourceRanks(I01 idx)=0
virtual std::vector< unsigned int > getTargetRanks(I01 idx)=0
unsigned int getTag() const
Definition DataExchange.h:38
DataExchange(unsigned int tag)
Definition DataExchange.h:32
virtual void readFromCell(double *const buffer, const Cell_T &cell)=0
virtual ~DataExchange()
Definition DataExchange.h:34
virtual unsigned int getDoublesPerCell() const =0
virtual void writeToCell(const double *const buffer, Cell_T &cell)=0
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15