TransFlow  0.1.0
A transient pipeline flow simulation library
BatchTrackingState Class Reference

Contains the state which BatchTracking operates on. More...

#include <batchtrackingstate.hpp>

Classes

struct  Batch
 Contains the information for a single batch. More...
 

Public Member Functions

 BatchTrackingState (const arma::vec &gridPointsIncludingEndPoint, const arma::vec &concentration=Composition::defaultComposition, const arma::uword nBatches=1)
 State constructor from grid points and the same concentration for all batches. More...
 
 BatchTrackingState (const arma::vec &gridPointsIncludingEndPoint, const std::vector< Composition > &composition)
 State constructor from grid points and specified Composition at each grid point. More...
 
std::vector< Compositionsample () const
 sample Samples the composition at locations in m_gridPoints. More...
 
std::vector< Compositionsample (const arma::vec &locations) const
 sample Samples the composition at arbitrary locations. More...
 
std::vector< arma::vec > sampleToVec () const
 sampleToVec Samples the composition at locations in m_gridPoints. More...
 
std::vector< arma::vec > sampleToVec (const arma::vec &locations) const
 sampleToVec Samples the composition at arbitrary locations. More...
 
std::vector< arma::vec > sampleInternal (const arma::vec &locations) const
 sampleInternal Samples the composition at arbitrary locations. This is the main function that does the composition sampling. It simply takes the Composition in the batch each location is contained in. More...
 
const std::vector< Batch > & batches () const
 Get a const reference to the batches. More...
 

Protected Attributes

std::vector< Batchm_batches
 Vector containing all batches.
 
arma::vec m_gridPoints
 Grid points of pipeline.
 

Friends

class BatchTracking
 

Detailed Description

Contains the state which BatchTracking operates on.

This contains the position and concentration of all batches in a pipeline. This class also implements methods for sampling the composition at arbitrary locations.

Constructor & Destructor Documentation

◆ BatchTrackingState() [1/2]

BatchTrackingState::BatchTrackingState ( const arma::vec &  gridPointsIncludingEndPoint,
const arma::vec &  concentration = Composition::defaultComposition,
const arma::uword  nBatches = 1 
)

State constructor from grid points and the same concentration for all batches.

Parameters
gridPointsIncludingEndPointGrid points (including endpoint).
concentrationConcentration of all batches.
nBatchesNumber of Batches.

◆ BatchTrackingState() [2/2]

BatchTrackingState::BatchTrackingState ( const arma::vec &  gridPointsIncludingEndPoint,
const std::vector< Composition > &  composition 
)

State constructor from grid points and specified Composition at each grid point.

Parameters
gridPointsIncludingEndPointGrid points (including endpoint).
compositionComposition at each grid point.

Member Function Documentation

◆ batches()

const std::vector<Batch>& BatchTrackingState::batches ( ) const
inline

Get a const reference to the batches.

Returns
A const reference to the internal std::vector of Batch, m_batches.

◆ sample() [1/2]

std::vector<Composition> BatchTrackingState::sample ( ) const

sample Samples the composition at locations in m_gridPoints.

Returns
Returns a std::vector of the Composition at each grid point.

◆ sample() [2/2]

std::vector<Composition> BatchTrackingState::sample ( const arma::vec &  locations) const

sample Samples the composition at arbitrary locations.

Parameters
locationsWhere to sample the composition.
Returns
Returns a std::vector of the Composition at each grid point.

◆ sampleInternal()

std::vector<arma::vec> BatchTrackingState::sampleInternal ( const arma::vec &  locations) const

sampleInternal Samples the composition at arbitrary locations. This is the main function that does the composition sampling. It simply takes the Composition in the batch each location is contained in.

Parameters
locationsWhere to sample the composition.
Returns
Returns a std::vector of the Composition at each grid point.

◆ sampleToVec() [1/2]

std::vector<arma::vec> BatchTrackingState::sampleToVec ( ) const

sampleToVec Samples the composition at locations in m_gridPoints.

Returns
Returns a std::vector of the composition at each grid point in form of an arma::vec.

◆ sampleToVec() [2/2]

std::vector<arma::vec> BatchTrackingState::sampleToVec ( const arma::vec &  locations) const

sampleToVec Samples the composition at arbitrary locations.

Parameters
locationsWhere to sample the composition.
Returns
Returns a std::vector of the composition at each grid point in form of an arma::vec.

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