$treeview $search $mathjax
Palabos  Version 1.1
$projectbrief
$projectbrief
$searchbox

plb::BlockStatistics Class Reference

Store instances of observables, and compute their statistics. More...

#include <blockStatistics.h>

List of all members.

Public Member Functions

 BlockStatistics ()
 BlockStatistics (BlockStatistics const &rhs)
void swap (BlockStatistics &rhs)
void evaluate ()
 evaluate() must be called after each lattice iteration.
void evaluate (std::vector< double > const &average, std::vector< double > const &sum, std::vector< double > const &max, std::vector< plint > const &intSum, pluint numCells_)
 Attribute a value to the public statistics, and reset running statistics to default.
void gatherAverage (plint whichAverage, double value)
 Contribute the values of the current cell to the statistics of an "average observable".
void gatherSum (plint whichSum, double value)
 Contribute the values of the current cell to the statistics of a "sum observable".
void gatherMax (plint whichMax, double value)
 Contribute the values of the current cell to the statistics of a "max observable".
void gatherIntSum (plint whichSum, plint value)
 Contribute the values of the current cell to the statistics of an integer "sum observable".
void incrementStats ()
 Call this function once all statistics for a cell have been added.
pluint const & getNumCells () const
 Return number of cells for which statistics have been added so far.
double getAverage (plint whichAverage) const
 Get the public value for any "average observable".
double getSum (plint whichSum) const
 Get the public value for any "sum observable".
double getMax (plint whichMax) const
 Get the public value for any "max observable".
plint getIntSum (plint whichSum) const
 Get the public value for any integer "sum observable".
std::vector< double > & getAverageVect ()
 Get a handle to the vector with all "average observables".
std::vector< double > & getSumVect ()
 Get a handle to the vector with all "sum observables".
std::vector< double > & getMaxVect ()
 Get a handle to the vector with all "max observables".
std::vector< plint > & getIntSumVect ()
 Get a handle to the vector with all integer "sum observables".
std::vector< double > getDoubleVect () const
 Get all real-valued statistics, in their order of subscription.
plint subscribeAverage ()
 Subscribe a new observable for which the average value is computed.
plint subscribeSum ()
 Subscribe a new observable for which the sum is computed.
plint subscribeMax ()
 Subscribe a new observable for which the maximum is computed.
plint subscribeIntSum ()
 Subscribe a new integer observable for which the sum is computed.
void rescale (std::vector< double > const &scales)
 Rescale the floating-point values computed so far.

Detailed Description

Store instances of observables, and compute their statistics.

This class is not intended to be inherited from. It is not a template, because statistics should always be in double-precision, even if the simulation is in single-precision. Remember that the statistics makes reductions over large data sets, in which case single-precision arithmetics can rapidly be insufficient.


Constructor & Destructor Documentation

plb::BlockStatistics::BlockStatistics (  ) 
plb::BlockStatistics::BlockStatistics ( BlockStatistics const &  rhs  ) 

Member Function Documentation

void plb::BlockStatistics::evaluate ( std::vector< double > const &  average,
std::vector< double > const &  sum,
std::vector< double > const &  max,
std::vector< plint > const &  intSum,
pluint  numCells_ 
)

Attribute a value to the public statistics, and reset running statistics to default.

References PLB_PRECONDITION.

void plb::BlockStatistics::evaluate (  ) 

evaluate() must be called after each lattice iteration.

In the reset function, running statistics are copied to public statistics, and running statistics are reset to zero.

Referenced by plb::BlockLattice2D< T, Descriptor >::BlockLattice2D(), plb::BlockLattice3D< T, Descriptor >::BlockLattice3D(), plb::CombinedStatistics::combine(), plb::AtomicBlock3D::evaluateStatistics(), and plb::AtomicBlock2D::evaluateStatistics().

std::vector<double>& plb::BlockStatistics::getAverageVect (  )  [inline]

Get a handle to the vector with all "average observables".

Referenced by plb::CombinedStatistics::combine().

std::vector<double> plb::BlockStatistics::getDoubleVect (  )  const

Get all real-valued statistics, in their order of subscription.

std::vector<plint>& plb::BlockStatistics::getIntSumVect (  )  [inline]

Get a handle to the vector with all integer "sum observables".

Referenced by plb::CombinedStatistics::combine().

std::vector<double>& plb::BlockStatistics::getMaxVect (  )  [inline]

Get a handle to the vector with all "max observables".

Referenced by plb::CombinedStatistics::combine().

pluint const& plb::BlockStatistics::getNumCells (  )  const [inline]

Return number of cells for which statistics have been added so far.

std::vector<double>& plb::BlockStatistics::getSumVect (  )  [inline]

Get a handle to the vector with all "sum observables".

Referenced by plb::CombinedStatistics::combine().

void plb::BlockStatistics::rescale ( std::vector< double > const &  scales  ) 

Rescale the floating-point values computed so far.

References PLB_PRECONDITION.

plint plb::BlockStatistics::subscribeIntSum (  ) 
void plb::BlockStatistics::swap ( BlockStatistics rhs  ) 

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