$treeview $search $mathjax
|
Palabos
Version 1.1
$projectbrief
|
$projectbrief
|
$searchbox |
Store instances of observables, and compute their statistics. More...
#include <blockStatistics.h>
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. | |
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.
| plb::BlockStatistics::BlockStatistics | ( | ) |
| plb::BlockStatistics::BlockStatistics | ( | BlockStatistics const & | rhs | ) |
| 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().
| void plb::BlockStatistics::gatherAverage | ( | plint | whichAverage, | |
| double | value | |||
| ) |
Contribute the values of the current cell to the statistics of an "average observable".
References PLB_PRECONDITION.
Referenced by plb::gatherStatistics(), plb::MaskedBoxScalarAverageFunctional3D< T >::process(), plb::MaskedBoxScalarAverageFunctional2D< T >::process(), plb::FS_AverageHeightFunctional3D< T, Descriptor >::processGenericBlocks(), plb::FS_AverageMomentumFunctional3D< T, Descriptor >::processGenericBlocks(), plb::FS_AverageVolumeFractionFunctional3D< T, Descriptor >::processGenericBlocks(), plb::FS_AverageDensityFunctional3D< T, Descriptor >::processGenericBlocks(), and plb::FS_AverageMassFunctional3D< T, Descriptor >::processGenericBlocks().
Contribute the values of the current cell to the statistics of an integer "sum observable".
References PLB_PRECONDITION.
Referenced by plb::CountTensorElementsFunctional3D< T, nDim, BoolMask >::process(), plb::CountScalarElementsFunctional3D< T, BoolMask >::process(), plb::CountLatticeElementsFunctional3D< T, Descriptor, BoolMask >::process(), plb::CountTensorElementsFunctional2D< T, nDim, BoolMask >::process(), plb::CountScalarElementsFunctional2D< T, BoolMask >::process(), plb::CountLatticeElementsFunctional2D< T, Descriptor, BoolMask >::process(), plb::AllFlagsTrueFunctional3D::processGenericBlocks(), plb::AllFlagsTrueFunctional2D::processGenericBlocks(), plb::ComputeSparsityFunctional3D< T >::processGenericBlocks(), plb::ComputeSparsityFunctional2D< T >::processGenericBlocks(), plb::GetWaterLevelAtxyFunctional3D< T, Descriptor >::processGenericBlocks(), and plb::CountFreeSurfaceElementsFunctional3D< T, Descriptor >::processGenericBlocks().
| void plb::BlockStatistics::gatherMax | ( | plint | whichMax, | |
| double | value | |||
| ) |
Contribute the values of the current cell to the statistics of a "max observable".
References PLB_PRECONDITION.
Referenced by plb::gatherStatistics(), plb::BoxPoissonResidueFunctional3D< T >::process(), plb::GaussSeidelMaxDefectFunctional2D< T >::process(), plb::BoxPoissonResidueFunctional2D< T >::process(), plb::BoxScalarMaxFunctional3D< T >::process(), plb::BoxScalarMinFunctional3D< T >::process(), plb::BoxScalarMaxFunctional2D< T >::process(), plb::BoxScalarMinFunctional2D< T >::process(), plb::StoreDynamicsFunctional3D< T, Descriptor >::processGenericBlocks(), plb::IterateDynamicsFunctional3D::processGenericBlocks(), plb::StoreDynamicsFunctional2D< T, Descriptor >::processGenericBlocks(), and plb::IterateDynamicsFunctional2D::processGenericBlocks().
| void plb::BlockStatistics::gatherSum | ( | plint | whichSum, | |
| double | value | |||
| ) |
Contribute the values of the current cell to the statistics of a "sum observable".
References PLB_PRECONDITION.
Referenced by plb::MomentumExchangeBounceBack< T, Descriptor >::collide(), plb::BoxSumVelocityTemperatureFunctional3D< T, FluidDescriptor, TemperatureDescriptor >::process(), plb::BoxSumVelocityTemperatureFunctional2D< T, FluidDescriptor, TemperatureDescriptor >::process(), plb::BoxScalarSumFunctional3D< T >::process(), plb::VorticitySingleProbe3D< T, Descriptor >::process(), plb::VelocitySingleProbe3D< T, Descriptor >::process(), plb::DensitySingleProbe3D< T, Descriptor >::process(), plb::BoxSumEnergyFunctional3D< T, Descriptor >::process(), plb::BoxSumRhoBarFunctional3D< T, Descriptor >::process(), plb::BoxScalarSumFunctional2D< T >::process(), plb::BoxSumEnergyFunctional2D< T, Descriptor >::process(), plb::BoxSumRhoBarFunctional2D< T, Descriptor >::process(), plb::BoundedBoxScalarSumFunctional3D< T >::processBulk(), plb::BoundedBoxScalarSumFunctional2D< T >::processBulk(), plb::BoundedBoxScalarSumFunctional3D< T >::processCorner(), plb::BoundedBoxScalarSumFunctional2D< T >::processCorner(), plb::BoundedBoxScalarSumFunctional3D< T >::processEdge(), plb::BoundedBoxScalarSumFunctional2D< T >::processEdge(), plb::GetForceOnObjectFunctional3D< T, SurfaceData >::processGenericBlocks(), and plb::BoundedBoxScalarSumFunctional3D< T >::processPlane().
| double plb::BlockStatistics::getAverage | ( | plint | whichAverage | ) | const |
Get the public value for any "average observable".
References PLB_PRECONDITION.
Referenced by plb::ConstRhoBGKdynamics< T, Descriptor >::collide(), plb::FS_AverageDensityFunctional3D< T, Descriptor >::getAverageDensity(), plb::FS_AverageHeightFunctional3D< T, Descriptor >::getAverageHeight(), plb::FS_AverageMassFunctional3D< T, Descriptor >::getAverageMass(), plb::FS_AverageMomentumFunctional3D< T, Descriptor >::getAverageMomentum(), plb::MaskedBoxScalarAverageFunctional3D< T >::getAverageScalar(), plb::MaskedBoxScalarAverageFunctional2D< T >::getAverageScalar(), plb::FS_AverageVolumeFractionFunctional3D< T, Descriptor >::getAverageVolumeFraction(), plb::getStoredAverageDensity(), and plb::getStoredAverageEnergy().
| 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.
Get the public value for any integer "sum observable".
References PLB_PRECONDITION.
Referenced by plb::AllFlagsTrueFunctional3D::allTrue(), plb::AllFlagsTrueFunctional2D::allTrue(), plb::CountTensorElementsFunctional3D< T, nDim, BoolMask >::getCount(), plb::CountScalarElementsFunctional3D< T, BoolMask >::getCount(), plb::CountLatticeElementsFunctional3D< T, Descriptor, BoolMask >::getCount(), plb::CountTensorElementsFunctional2D< T, nDim, BoolMask >::getCount(), plb::CountScalarElementsFunctional2D< T, BoolMask >::getCount(), plb::CountLatticeElementsFunctional2D< T, Descriptor, BoolMask >::getCount(), plb::ComputeSparsityFunctional3D< T >::getNumBlocks(), plb::ComputeSparsityFunctional2D< T >::getNumBlocks(), plb::CheckVoxelizationFunctional3D< T >::getNumErrors(), plb::GetWaterLevelAtxyFunctional3D< T, Descriptor >::getNumFluidCellsAtXY(), and plb::CountFreeSurfaceElementsFunctional3D< T, Descriptor >::getNumInterfaceCells().
| std::vector<plint>& plb::BlockStatistics::getIntSumVect | ( | ) | [inline] |
Get a handle to the vector with all integer "sum observables".
Referenced by plb::CombinedStatistics::combine().
| double plb::BlockStatistics::getMax | ( | plint | whichMax | ) | const |
Get the public value for any "max observable".
References PLB_PRECONDITION.
Referenced by plb::StoreDynamicsFunctional3D< T, Descriptor >::getMaxChainLength(), plb::StoreDynamicsFunctional2D< T, Descriptor >::getMaxChainLength(), plb::GaussSeidelMaxDefectFunctional2D< T >::getMaxResidual(), plb::BoxPoissonResidueFunctional3D< T >::getMaxResidue(), plb::BoxPoissonResidueFunctional2D< T >::getMaxResidue(), plb::BoxScalarMaxFunctional3D< T >::getMaxScalar(), plb::BoxScalarMaxFunctional2D< T >::getMaxScalar(), plb::BoxScalarMinFunctional3D< T >::getMinScalar(), plb::BoxScalarMinFunctional2D< T >::getMinScalar(), plb::IterateDynamicsFunctional3D::getNextMaximum(), plb::IterateDynamicsFunctional2D::getNextMaximum(), and plb::getStoredMaxVelocity().
| 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.
| double plb::BlockStatistics::getSum | ( | plint | whichSum | ) | const |
Get the public value for any "sum observable".
References PLB_PRECONDITION.
Referenced by plb::DensitySingleProbe3D< T, Descriptor >::getDensities(), plb::GetForceOnObjectFunctional3D< T, SurfaceData >::getForce(), plb::BoxSumEnergyFunctional3D< T, Descriptor >::getSumEnergy(), plb::BoxSumEnergyFunctional2D< T, Descriptor >::getSumEnergy(), plb::BoxSumRhoBarFunctional3D< T, Descriptor >::getSumRhoBar(), plb::BoxSumRhoBarFunctional2D< T, Descriptor >::getSumRhoBar(), plb::BoundedBoxScalarSumFunctional3D< T >::getSumScalar(), plb::BoxScalarSumFunctional3D< T >::getSumScalar(), plb::BoundedBoxScalarSumFunctional2D< T >::getSumScalar(), plb::BoxScalarSumFunctional2D< T >::getSumScalar(), plb::BoxSumVelocityTemperatureFunctional3D< T, FluidDescriptor, TemperatureDescriptor >::getSumVelocityTemperature(), plb::BoxSumVelocityTemperatureFunctional2D< T, FluidDescriptor, TemperatureDescriptor >::getSumVelocityTemperature(), plb::VelocitySingleProbe3D< T, Descriptor >::getVelocities(), and plb::VorticitySingleProbe3D< T, Descriptor >::getVorticities().
| 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::incrementStats | ( | ) |
Call this function once all statistics for a cell have been added.
Referenced by plb::gatherStatistics(), plb::MaskedBoxScalarAverageFunctional3D< T >::process(), plb::MaskedBoxScalarAverageFunctional2D< T >::process(), plb::FS_AverageHeightFunctional3D< T, Descriptor >::processGenericBlocks(), plb::FS_AverageMomentumFunctional3D< T, Descriptor >::processGenericBlocks(), plb::FS_AverageVolumeFractionFunctional3D< T, Descriptor >::processGenericBlocks(), plb::FS_AverageDensityFunctional3D< T, Descriptor >::processGenericBlocks(), plb::FS_AverageMassFunctional3D< T, Descriptor >::processGenericBlocks(), plb::MultiGrid3D::reduceStatistics(), and plb::MultiGrid2D::reduceStatistics().
| void plb::BlockStatistics::rescale | ( | std::vector< double > const & | scales | ) |
Rescale the floating-point values computed so far.
References PLB_PRECONDITION.
| plint plb::BlockStatistics::subscribeAverage | ( | ) |
Subscribe a new observable for which the average value is computed.
Referenced by plb::MultiGridStatSubscriber3D::initialize(), plb::MultiGridStatSubscriber2D::initialize(), plb::MultiGridStatSubscriber3D::subscribeAverage(), plb::MultiGridStatSubscriber2D::subscribeAverage(), plb::MultiStatSubscriber3D::subscribeAverage(), plb::MultiStatSubscriber2D::subscribeAverage(), plb::StatSubscriber3D::subscribeAverage(), and plb::StatSubscriber2D::subscribeAverage().
| plint plb::BlockStatistics::subscribeIntSum | ( | ) |
Subscribe a new integer observable for which the sum is computed.
Referenced by plb::MultiGridStatSubscriber3D::subscribeIntSum(), plb::MultiGridStatSubscriber2D::subscribeIntSum(), plb::MultiStatSubscriber3D::subscribeIntSum(), plb::MultiStatSubscriber2D::subscribeIntSum(), plb::StatSubscriber3D::subscribeIntSum(), and plb::StatSubscriber2D::subscribeIntSum().
| plint plb::BlockStatistics::subscribeMax | ( | ) |
Subscribe a new observable for which the maximum is computed.
Referenced by plb::MultiGridStatSubscriber3D::initialize(), plb::MultiGridStatSubscriber2D::initialize(), plb::IterateDynamicsFunctional2D::IterateDynamicsFunctional2D(), plb::IterateDynamicsFunctional3D::IterateDynamicsFunctional3D(), plb::MultiGridStatSubscriber3D::subscribeMax(), plb::MultiGridStatSubscriber2D::subscribeMax(), plb::MultiStatSubscriber3D::subscribeMax(), plb::MultiStatSubscriber2D::subscribeMax(), plb::StatSubscriber3D::subscribeMax(), and plb::StatSubscriber2D::subscribeMax().
| plint plb::BlockStatistics::subscribeSum | ( | ) |
Subscribe a new observable for which the sum is computed.
Referenced by plb::DensitySingleProbe3D< T, Descriptor >::DensitySingleProbe3D(), plb::MultiGridStatSubscriber3D::subscribeSum(), plb::MultiGridStatSubscriber2D::subscribeSum(), plb::MultiStatSubscriber3D::subscribeSum(), plb::MultiStatSubscriber2D::subscribeSum(), plb::StatSubscriber3D::subscribeSum(), plb::StatSubscriber2D::subscribeSum(), plb::VelocitySingleProbe3D< T, Descriptor >::VelocitySingleProbe3D(), and plb::VorticitySingleProbe3D< T, Descriptor >::VorticitySingleProbe3D().
| void plb::BlockStatistics::swap | ( | BlockStatistics & | rhs | ) |
1.6.3
1.6.3