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

sends coupling cell information from MaMiCo to the macroscopic solver. Derived from the class coupling::sendrecv::SendReceiveBuffer More...

#include <FromMD2Macro.h>

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

Public Types

using Macro_Container_T = coupling::datastructures::FlexibleCellContainer<dim>
 
using Local_Container_T = coupling::datastructures::CellContainer<I02, dim>
 

Public Member Functions

 FromMD2Macro ()
 
virtual ~FromMD2Macro ()
 
void sendFromMD2Macro (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Local_Container_T &src, const Macro_Container_T &dst)
 
template<class Container_T1, class Container_T2>
void reduceFromMD2Macro (std::vector< coupling::sendrecv::DataExchangeFromMD2Macro< dim > * > &dataExchange, const Container_T1 &src, const Container_T2 &dst)
 
void sendFromMD2MacroNonBlocking (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Local_Container_T &src, const Macro_Container_T &dst)
 
void wait4SendFromMD2Macro (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Macro_Container_T &cells)
 
- Public Member Functions inherited from coupling::sendrecv::SendReceiveBuffer< Cell_T, dim >
 SendReceiveBuffer ()
 
virtual ~SendReceiveBuffer ()
 

Private Member Functions

void writeToSendBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Local_Container_T &cells)
 
void writeToReduceBuffer (coupling::sendrecv::DataExchangeFromMD2Macro< dim > &dataExchange, const Local_Container_T &cells)
 
void allocateReceiveBuffers (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Macro_Container_T &cells)
 
template<class Container_T>
void allocateReduceBufferForReceiving (coupling::sendrecv::DataExchangeFromMD2Macro< dim > &dataExchange, const Container_T &cells)
 
void readFromReceiveBuffer (coupling::sendrecv::DataExchange< Cell_T, dim > &dataExchange, const Macro_Container_T &cells)
 
template<class Container_T>
void readFromReduceBuffer (coupling::sendrecv::DataExchangeFromMD2Macro< 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::FromMD2Macro< Cell_T, dim >

sends coupling cell information from MaMiCo to the macroscopic solver. Derived from the class coupling::sendrecv::SendReceiveBuffer

extends the generic SendReceiveBuffer for send coupling cell information from MaMiCo to the macroscopic solver.

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

Constructor & Destructor Documentation

◆ FromMD2Macro()

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

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

◆ ~FromMD2Macro()

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

Destructor

Member Function Documentation

◆ allocateReceiveBuffers()

template<class Cell_T, unsigned int dim>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::allocateReceiveBuffers ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Macro_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

◆ allocateReduceBufferForReceiving()

template<class Cell_T, unsigned int dim>
template<class Container_T>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::allocateReduceBufferForReceiving ( coupling::sendrecv::DataExchangeFromMD2Macro< dim > & dataExchange,
const Container_T & cells )
private

allocates the reduce 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, allocateReduceBufferForReceiving(...) of SendReceiveBuffer is called.

Parameters
dataExchange
cells

◆ readFromReceiveBuffer()

template<class Cell_T, unsigned int dim>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::readFromReceiveBuffer ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Macro_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 coupling cell buffers. For each cell in this list, readFromReceiveBuffer(...) of SendReceiveBuffer is called.

Parameters
dataExchange
cells

◆ readFromReduceBuffer()

template<class Cell_T, unsigned int dim>
template<class Container_T>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::readFromReduceBuffer ( coupling::sendrecv::DataExchangeFromMD2Macro< dim > & dataExchange,
const Container_T & cells )
private

reads information from the reduce 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 coupling cell buffers. For each cell in this list, readFromReduceBuffer(...) of SendReceiveBuffer is called.

Parameters
dataExchange
cells

◆ reduceFromMD2Macro()

template<class Cell_T, unsigned int dim>
template<class Container_T1, class Container_T2>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::reduceFromMD2Macro ( std::vector< coupling::sendrecv::DataExchangeFromMD2Macro< dim > * > & dataExchange,
const Container_T1 & src,
const Container_T2 & dst )

reduces information from the local coupling cells of MaMiCo (only inner non-ghost cells of this process) and sends it to the macroscopic solver.

Parameters
dataExchange
src
dst

◆ sendFromMD2Macro()

template<class Cell_T, unsigned int dim>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::sendFromMD2Macro ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Local_Container_T & src,
const Macro_Container_T & dst )

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. This function basically calls for these purposes sendFromMD2MacroNonBlocking(...) and wait4SendFromMD2Macro(...) in a row.

Parameters
dataExchange
src
dst

◆ sendFromMD2MacroNonBlocking()

template<class Cell_T, unsigned int dim>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::sendFromMD2MacroNonBlocking ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Local_Container_T & src,
const Macro_Container_T & dst )

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
src
dst

◆ wait4SendFromMD2Macro()

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

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

Parameters
dataExchange
cells

◆ writeToReduceBuffer()

template<class Cell_T, unsigned int dim>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::writeToReduceBuffer ( coupling::sendrecv::DataExchangeFromMD2Macro< dim > & dataExchange,
const Local_Container_T & cells )
private

loops over the whole local Cartesian grid (only non-ghost cells!) and writes respective cells to reduce buffer.

Parameters
dataExchange
cells

◆ writeToSendBuffer()

template<class Cell_T, unsigned int dim>
void coupling::sendrecv::FromMD2Macro< Cell_T, dim >::writeToSendBuffer ( coupling::sendrecv::DataExchange< Cell_T, dim > & dataExchange,
const Local_Container_T & cells )
private

loops over the whole local Cartesian grid (only non-ghost cells!) and writes respective cells to send buffer. For each cell, writeToSendBuffer(...) of SendReceiveBuffer is used.

Parameters
dataExchange
cells

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