walberla::gather::CellGatherPackInfo< Field_T, CellContainer > Class Template Reference

Detailed Description

template<typename Field_T, typename CellContainer>
class walberla::gather::CellGatherPackInfo< Field_T, CellContainer >

Packs data in cells given by a CellContainter ( CellInterval, CellVector..)

Template Parameters:

  • Field_T Field or Field-Adaptor that should be packed
  • CellContainer for example CellInterval, CellVector

#include <CellGatherPackInfo.h>

+ Inheritance diagram for walberla::gather::CellGatherPackInfo< Field_T, CellContainer >:

Classes

struct  Compare
 Helper class for sorting the receivedData array according to t-value. More...
 
struct  Samples
 

Public Member Functions

 CellGatherPackInfo (const shared_ptr< StructuredBlockStorage > &bs, ConstBlockDataID fieldID, const CellContainer &containerOfGlobalCells, const shared_ptr< DataProcessor > &dp)
 Constructor. More...
 
- Public Member Functions inherited from walberla::gather::GatherPackInfo
virtual ~GatherPackInfo ()
 

Protected Attributes

Members for Receiving


std::vector< std::vector< real_t > > receivedData
 Two dimensional array of received data: the outer vector has one entry for every sample point the inner vector represents one sample point. More...
 
shared_ptr< DataProcessordataProcessor_
 Channel for output of gathered data. More...
 

Packing Interface


shared_ptr< StructuredBlockStorageblocks_
 
ConstBlockDataID fieldID_
 DataInterpolator acting as source, for the data that has to be packed. More...
 
std::map< const IBlock *, SampleslocalSamplePoints_
 For every LOCAL block, where data has to be packed, a vector of local cell coordinates is stored. More...
 
virtual void packData (const IBlock *sender, mpi::SendBuffer &outBuffer)
 Packs all data to be gathered into the given buffer. More...
 
virtual void unpackData (mpi::RecvBuffer &buffer)
 Unpacks the data, packed by the packData() function. More...
 
virtual void gatherFinished ()
 Called after a timestep has finished, and unpackData was called for each sending block. More...
 

Constructor & Destructor Documentation

◆ CellGatherPackInfo()

template<typename Field_T , typename CellContainer >
walberla::gather::CellGatherPackInfo< Field_T, CC >::CellGatherPackInfo ( const shared_ptr< StructuredBlockStorage > &  bs,
ConstBlockDataID  fieldID,
const CellContainer &  containerOfGlobalCells,
const shared_ptr< DataProcessor > &  dp 
)

Constructor.

This PackInfo packs data of a field in all cells that are provided by the CellContainer. The output to the DataProcessor contains in first column the cellNr in the container, then the field value(s) in the following columns.

Example: Collect Data along a line through the domain

  • CellContainer would be a CellInterval, that has size 1 in two dimensions, and the length of the line is given by the third size
Parameters
bsStructuredBlockStorage containing the field
fieldIDBlockDataID of the field that should be collected
containerContainer of cells in global coordinates, order of cells is important for output
dpdata processor where gathered data is delivered to

Member Function Documentation

◆ gatherFinished()

template<typename Field_T , typename CC >
void walberla::gather::CellGatherPackInfo< Field_T, CC >::gatherFinished
virtual

Called after a timestep has finished, and unpackData was called for each sending block.

Reimplemented from walberla::gather::GatherPackInfo.

◆ packData()

template<typename Field_T , typename CC >
void walberla::gather::CellGatherPackInfo< Field_T, CC >::packData ( const IBlock sender,
mpi::SendBuffer outBuffer 
)
virtual

Packs all data to be gathered into the given buffer.

Restrictions:

  • The packed amount of data for a given block has to stay constant
  • The packed amount of data for a given block has to be constant for all timesteps (i.e. for all calls of this function)

Implements walberla::gather::GatherPackInfo.

◆ unpackData()

template<typename Field_T , typename CC >
void walberla::gather::CellGatherPackInfo< Field_T, CC >::unpackData ( mpi::RecvBuffer buffer)
virtual

Unpacks the data, packed by the packData() function.

  • function is called on gathering process multiple times per timestep, once for each block that packed a non-zero message. It has to read the same amount as packData() has written. Therefore is usually necessary that packData inserts a header describing how much data the block packed

Implements walberla::gather::GatherPackInfo.

Member Data Documentation

◆ blocks_

template<typename Field_T , typename CellContainer >
shared_ptr<StructuredBlockStorage> walberla::gather::CellGatherPackInfo< Field_T, CellContainer >::blocks_
protected

◆ dataProcessor_

template<typename Field_T , typename CellContainer >
shared_ptr<DataProcessor> walberla::gather::CellGatherPackInfo< Field_T, CellContainer >::dataProcessor_
protected

Channel for output of gathered data.

◆ fieldID_

template<typename Field_T , typename CellContainer >
ConstBlockDataID walberla::gather::CellGatherPackInfo< Field_T, CellContainer >::fieldID_
protected

DataInterpolator acting as source, for the data that has to be packed.

◆ localSamplePoints_

template<typename Field_T , typename CellContainer >
std::map<const IBlock*, Samples > walberla::gather::CellGatherPackInfo< Field_T, CellContainer >::localSamplePoints_
protected

For every LOCAL block, where data has to be packed, a vector of local cell coordinates is stored.

◆ receivedData

template<typename Field_T , typename CellContainer >
std::vector<std::vector<real_t> > walberla::gather::CellGatherPackInfo< Field_T, CellContainer >::receivedData
protected

Two dimensional array of received data: the outer vector has one entry for every sample point the inner vector represents one sample point.

  • the first entry (receivedData[i][0] ) is the t-value
  • subsequent entries are for the f values

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