Packs data of a field along a curve.
#include <CurveGatherPackInfo.h>
Classes | |
struct | Compare |
Helper class for sorting the receivedData array according to t-value. More... | |
struct | Samples |
Public Types | |
typedef Vector3< real_t > | RealVec3 |
typedef std::function< RealVec3(real_t t) > | CurveCallback |
Public Member Functions | |
Construction & Destruction | |
CurveGatherPackInfo (const shared_ptr< StructuredBlockStorage > &bs, ConstBlockDataID fieldID, CurveCallback curveCallback, real_t tStart, real_t tEnd, uint_t numSamples, const shared_ptr< DataProcessor > &dp) | |
Construction using a callback function. More... | |
CurveGatherPackInfo (const shared_ptr< StructuredBlockStorage > &bs, ConstBlockDataID field, const std::string &curveX, const std::string &curveY, const std::string &curveZ, real_t tStart, real_t tEnd, uint_t numSamples, const shared_ptr< DataProcessor > &dp) | |
Construction using curve definition as string. More... | |
CurveGatherPackInfo (const shared_ptr< StructuredBlockStorage > &bs, ConstBlockDataID field, const std::vector< RealVec3 > &samplePoints, const shared_ptr< DataProcessor > &dp) | |
Construction using vector of sample points. More... | |
~CurveGatherPackInfo () override | |
Packing Interface | |
| |
void | packData (const IBlock *sender, mpi::SendBuffer &outBuffer) override |
Packs all data to be gathered into the given buffer. More... | |
void | unpackData (mpi::RecvBuffer &buffer) override |
Unpacks the data, packed by the packData() function. More... | |
void | gatherFinished () override |
Called after a timestep has finished, and unpackData was called for each sending block. More... | |
Public Member Functions inherited from walberla::gather::GatherPackInfo | |
virtual | ~GatherPackInfo ()=default |
Protected Member Functions | |
Helper Functions | |
void | addSample (real_t t, const RealVec3 &p) |
Helper function needed by all constructors Computes conversion of world coordinates to local cell coordinates. More... | |
void | sortReceivedData () |
Sorts received data according to the free curve parameter t necessary because a curve may cross a block multiple times for multiple non connected t intervals. More... | |
Protected Attributes | |
Members for Sending | |
| |
shared_ptr< StructuredBlockStorage > | blocks_ |
ConstBlockDataID | fieldID_ |
DataInterpolator acting as source, for the data that has to be packed. More... | |
std::map< const IBlock *, Samples > | localSamplePoints_ |
For every LOCAL block, where data has to be packed, a vector of sample points is stored. More... | |
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< DataProcessor > | dataProcessor_ |
Channel for output of gathered data. More... | |
typedef std::function<RealVec3 (real_t t) > walberla::gather::CurveGatherPackInfo< GhostLayerField_T, Interpolator >::CurveCallback |
typedef Vector3<real_t> walberla::gather::CurveGatherPackInfo< GhostLayerField_T, Interpolator >::RealVec3 |
walberla::gather::CurveGatherPackInfo< GlF, IP >::CurveGatherPackInfo | ( | const shared_ptr< StructuredBlockStorage > & | bs, |
ConstBlockDataID | fieldID, | ||
CurveCallback | curveCallback, | ||
real_t | tStart, | ||
real_t | tEnd, | ||
uint_t | numSamples, | ||
const shared_ptr< DataProcessor > & | dp | ||
) |
Construction using a callback function.
bs | structured block storage, needed to map global to local coordinates |
fieldID | BlockdataID pointing to a GhostLayerField of type GhostLayerField_T |
curveCallback | curve defining function, taking one real_t parameter, returning a point in "world" coordinates. Same coordinates as AABB of blockfield |
tStart | Start value of free curve parameter t |
tEnd | End value of free curve parameter t |
numSamples | number of subdivisions of interval [tStart,tEnd] |
dp | The data processor acts as output of gathered data. When gathered data is available the process() method is called, with an array containing data points. The first element of the data point is the free curve parameter t, followed by the elements given by the data interpolator |
walberla::gather::CurveGatherPackInfo< GlF, IP >::CurveGatherPackInfo | ( | const shared_ptr< StructuredBlockStorage > & | bs, |
ConstBlockDataID | field, | ||
const std::string & | curveX, | ||
const std::string & | curveY, | ||
const std::string & | curveZ, | ||
real_t | tStart, | ||
real_t | tEnd, | ||
uint_t | numSamples, | ||
const shared_ptr< DataProcessor > & | dp | ||
) |
Construction using curve definition as string.
see constructor above
curveX | string containing the function that defines the x value of the curve the name of the free parameter is 't' example: cos(t)+2*t+exp(t) |
walberla::gather::CurveGatherPackInfo< GhostLayerField_T, Interpolator >::CurveGatherPackInfo | ( | const shared_ptr< StructuredBlockStorage > & | bs, |
ConstBlockDataID | field, | ||
const std::vector< RealVec3 > & | samplePoints, | ||
const shared_ptr< DataProcessor > & | dp | ||
) |
Construction using vector of sample points.
samplePoints | Curve definition using a vector of points in R^3. The points are expected to be in "world" coordinates |
|
inlineoverride |
|
protected |
Helper function needed by all constructors Computes conversion of world coordinates to local cell coordinates.
If sampled point lies
in a locally allocated block, it is added to localSamplePoints_ . Initializes also the totalNumberOfSamples_ member.
|
overridevirtual |
Called after a timestep has finished, and unpackData was called for each sending block.
Reimplemented from walberla::gather::GatherPackInfo.
|
overridevirtual |
Packs all data to be gathered into the given buffer.
Restrictions:
Implements walberla::gather::GatherPackInfo.
|
protected |
Sorts received data according to the free curve parameter t necessary because a curve may cross a block multiple times for multiple non connected t intervals.
|
overridevirtual |
Unpacks the data, packed by the packData() function.
Implements walberla::gather::GatherPackInfo.
|
protected |
|
protected |
Channel for output of gathered data.
|
protected |
DataInterpolator acting as source, for the data that has to be packed.
|
protected |
For every LOCAL block, where data has to be packed, a vector of sample points is stored.
Points are stored in local cell coordinates
|
protected |
Two dimensional array of received data: the outer vector has one entry for every sample point the inner vector represents one sample point.