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

sends coupling cell information from MaMiCo to the macroscopic solver. Expects to only receive data from, but will not send any data. Derived from the class coupling::sendrecv::SendReceiveBuffer More...

#include <FromMD2MacroRecvOnly.h>

Inheritance diagram for coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >:
Collaboration diagram for coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >:

Public Member Functions

 FromMD2MacroRecvOnly ()
 
virtual ~FromMD2MacroRecvOnly ()
 
template<class Container_T>
void sendFromMD2Macro (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Container_T &cells)
 
template<class Container_T>
void sendFromMD2MacroNonBlocking (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Container_T &cells)
 
template<class Container_T>
void wait4SendFromMD2Macro (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Container_T &cells)
 
- Public Member Functions inherited from coupling::sendrecv::SendReceiveBuffer< Cell_T, dim >
 SendReceiveBuffer ()
 
virtual ~SendReceiveBuffer ()
 

Private Member Functions

template<class Container_T>
void allocateReceiveBuffers (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Container_T &cells)
 
template<class Container_T>
void readFromReceiveBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Container_T &cells)
 

Additional Inherited Members

- Protected Member Functions inherited from coupling::sendrecv::SendReceiveBuffer< Cell_T, dim >
void deleteBuffers ()
 deletes the buffers
 
template<class Container_T>
void writeToSendBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Container_T &cells)
 fills all information that needs to be sent from a coupling cell into the send-buffer.
 
void writeToBcastBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Cell_T &cell, I01 idx)
 fills all information that needs to be broadcast from a coupling cell into the broadcast-buffer.
 
void writeToReduceBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Cell_T &cell, I01 idx)
 fills all information that needs to be reduced to a coupling cell into the reduce-buffer.
 
template<class Container_T>
void readFromReceiveBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Container_T &cells)
 
void readFromCollectiveBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, Cell_T &couplingCell, I01 idx)
 
void readFromReduceBuffer (coupling::sendrecv::DataExchangeFromMD2Macro< dim > &dataExchange, Cell_T &couplingCell, I01 idx)
 
void allocateReceiveBuffers (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, I01 idx)
 
void allocateBcastBufferForReceiving (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, I01 idx)
 
void allocateReduceBufferForReceiving (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, I01 idx)
 
void triggerSending (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange)
 
void triggerBcasts (unsigned int rank)
 
void triggerReceiving (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange)
 
void triggerReduce (unsigned int rank)
 
void waitAllOperations ()
 
void waitAllCollectiveOperations ()
 
void allocateRequests ()
 
void allocateBcastRequests (unsigned int thisRank)
 
void allocateReduceRequests (unsigned int thisRank)
 

Detailed Description

template<class Cell_T, unsigned int dim>
class coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >

sends coupling cell information from MaMiCo to the macroscopic solver. Expects to only receive data from, but will not send any data. Derived from the class coupling::sendrecv::SendReceiveBuffer

sends coupling cell information from MaMiCo to the macroscopic solver. This version expects to only receive data from, but will not send any data to a macroscopic solver process. This is used for multi-MD simulations where the macroscopic solver process may run on a completely different process than a single MD simulation.

Template Parameters
Cell_Tcell type
dimNumber of dimensions; it can be 1, 2 or 3
Author
Philipp Neumann

Constructor & Destructor Documentation

◆ FromMD2MacroRecvOnly()

template<class Cell_T, unsigned int dim>
coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >::FromMD2MacroRecvOnly ( )
inline

Constructor, just calling the constructor of the coupling::sendrecv::SendReceiveBuffer

◆ ~FromMD2MacroRecvOnly()

template<class Cell_T, unsigned int dim>
virtual coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >::~FromMD2MacroRecvOnly ( )
inlinevirtual

Destructor

Member Function Documentation

◆ allocateReceiveBuffers()

template<class Cell_T, unsigned int dim>
template<class Container_T>
void coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >::allocateReceiveBuffers ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Container_T & cells )
private

allocates the receive buffers for the macroscopic solver. Since we do not know anything about the macroscopic solver, we only have a list of global vector cell indices available for possible cells to be received on this rank. For each global cell which is in the list, allocateReceiveBuffers(...) of SendReceiveBuffer is called.

Parameters
dataExchange
cells

◆ readFromReceiveBuffer()

template<class Cell_T, unsigned int dim>
template<class Container_T>
void coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >::readFromReceiveBuffer ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Container_T & cells )
private

reads information from the receive buffer and stores the result in the list of coupling cells. Since this is a receive for the coupling cells on the side of the macroscopic solver, we just have a list of global cell indices and corresponding macrocsopic cell buffers. For each cell in this list, readFromReceiveBuffer(...) of SendReceiveBuffer is called.

Parameters
dataExchange
cells

◆ sendFromMD2Macro()

template<class Cell_T, unsigned int dim>
template<class Container_T>
void coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >::sendFromMD2Macro ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Container_T & cells )

sends information from the local coupling cells of MaMiCo (only inner non-ghost cells of this process) to the macroscopic solver. Since the macroscopic solver can have an arbitrary distribution of cells on the processes, the buffer for receiving the cell data is provided to this function in terms of an array of coupling cells including the respective global cell indices. Basically calls sendFromMD2MacroNonBlocking(...) and wait4SendFromMD2Macro(...) in a row.

Parameters
dataExchange
cells

◆ sendFromMD2MacroNonBlocking()

template<class Cell_T, unsigned int dim>
template<class Container_T>
void coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >::sendFromMD2MacroNonBlocking ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Container_T & cells )

triggers the send/recv operations for data transfer. After returning, these data transfers do not necessarily need to be finished, according to ISend/IRecv in MPI.

Parameters
dataExchange
cells
See also
class FromMD2Macro.

◆ wait4SendFromMD2Macro()

template<class Cell_T, unsigned int dim>
template<class Container_T>
void coupling::sendrecv::FromMD2MacroRecvOnly< Cell_T, dim >::wait4SendFromMD2Macro ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Container_T & cells )

waits for the send operation–instantiated by sendFromMD2MacroNonBlocking(...)–to be finished and writes the data to couplingCellsFromMacroscopicSolver.

Parameters
dataExchange
cells
See also
class FromMD2Macro

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