Base class for statistical measurements.
More...
#include <statistics_utilities.h>
|
| KRATOS_CLASS_POINTER_DEFINITION (StatisticsSampler) |
|
| StatisticsSampler (std::size_t NumValues) |
| Define a new StatisticsSampler instance. More...
|
|
virtual | ~StatisticsSampler () |
| Destructor. More...
|
|
virtual void | SampleDataPoint (const Geometry< Node > &rGeometry, const Vector &rShapeFunctions, const Matrix &rShapeDerivatives, std::vector< double >::iterator &BufferIterator) |
| For first-order statistics: read data directly. More...
|
|
virtual void | SampleDataPoint (std::vector< double >::iterator &BufferIterator, const StatisticsSampler::IntegrationPointDataView &rCurrentStatistics, const std::vector< double > &rNewMeasurement, const std::size_t NumberOfMeasurements) |
| For higher-order statistics: operate on lower order data. More...
|
|
std::size_t | GetSize () const |
| Number of quantities managed by this statistic. More...
|
|
virtual std::size_t | GetComponentOffset (std::size_t i) const |
| Offset (from the start of the space allocated to this statistic) for the storage of component i. More...
|
|
virtual std::size_t | ComponentIndex (std::size_t i, std::size_t j) const |
| Helper returning the correct argument in calls to GetComponentOffset for matrix quantities. More...
|
|
std::size_t | GetOffset () const |
| Offset (from the start of the statistics container) to the first component stored by this statistic. More...
|
|
void | SetOffset (std::size_t Offset) |
| Assign a new offset (from the start of the statistics container) to the first component stored by this statistic. More...
|
|
virtual void | OutputResult (std::ofstream &rOutStream, IntegrationPointDataViewIterator &rDataBuffer, std::size_t SampleSize, const std::string &rSeparator) const |
| Write results managed by this class to output buffer. More...
|
|
virtual void | OutputHeader (std::ofstream &rOutStream, const std::string &rSeparator) const |
| Write header for the output file. More...
|
|
virtual double | Finalize (double Value, std::size_t SampleSize) const |
| Post-process internal data to produce the final value of the statistical result. More...
|
|
std::string | GetTag (std::size_t ComponentIndex) const |
| Get the string associated one of the components of this statistic. More...
|
|
Base class for statistical measurements.
◆ IntegrationPointDataView
◆ IntegrationPointDataViewIterator
◆ StatisticsSampler()
Kratos::StatisticsSampler::StatisticsSampler |
( |
std::size_t |
NumValues | ) |
|
|
inline |
Define a new StatisticsSampler instance.
Note that this is the base class, unless you are implementing a new statistic, you should work with derived classes directly.
- Parameters
-
NumValues | Number of different quantities (components) to be managed. |
◆ ~StatisticsSampler()
virtual Kratos::StatisticsSampler::~StatisticsSampler |
( |
| ) |
|
|
inlinevirtual |
◆ AddTag()
void Kratos::StatisticsSampler::AddTag |
( |
std::string |
Tag | ) |
|
|
inlineprotected |
◆ ComponentIndex()
virtual std::size_t Kratos::StatisticsSampler::ComponentIndex |
( |
std::size_t |
i, |
|
|
std::size_t |
j |
|
) |
| const |
|
inlinevirtual |
◆ Finalize()
virtual double Kratos::StatisticsSampler::Finalize |
( |
double |
Value, |
|
|
std::size_t |
SampleSize |
|
) |
| const |
|
inlinevirtual |
Post-process internal data to produce the final value of the statistical result.
In most cases, this corresponds to dividing by sample size.
Reimplemented in Kratos::VarianceSampler.
◆ GetComponentOffset()
virtual std::size_t Kratos::StatisticsSampler::GetComponentOffset |
( |
std::size_t |
i | ) |
const |
|
inlinevirtual |
Offset (from the start of the space allocated to this statistic) for the storage of component i.
◆ GetOffset()
std::size_t Kratos::StatisticsSampler::GetOffset |
( |
| ) |
const |
|
inline |
Offset (from the start of the statistics container) to the first component stored by this statistic.
◆ GetSize()
std::size_t Kratos::StatisticsSampler::GetSize |
( |
| ) |
const |
|
inline |
Number of quantities managed by this statistic.
◆ GetTag()
std::string Kratos::StatisticsSampler::GetTag |
( |
std::size_t |
ComponentIndex | ) |
const |
|
inline |
Get the string associated one of the components of this statistic.
This is used to obtain the "name" for the statistic to be printed in the output file header.
- Parameters
-
[in] | ComponentIndex | index of the required component. |
◆ KRATOS_CLASS_POINTER_DEFINITION()
◆ OutputHeader()
virtual void Kratos::StatisticsSampler::OutputHeader |
( |
std::ofstream & |
rOutStream, |
|
|
const std::string & |
rSeparator |
|
) |
| const |
|
inlinevirtual |
◆ OutputResult()
virtual void Kratos::StatisticsSampler::OutputResult |
( |
std::ofstream & |
rOutStream, |
|
|
IntegrationPointDataViewIterator & |
rDataBuffer, |
|
|
std::size_t |
SampleSize, |
|
|
const std::string & |
rSeparator |
|
) |
| const |
|
inlinevirtual |
Write results managed by this class to output buffer.
This function is called when printing to a file. Note that the rDataBuffer argument will be advanced during the call.
- Parameters
-
rOutStream | stream for the output file. |
rDataBuffer | Iterator pointing to the data managed by this statistic. |
SampleSize | Number of measured realizations for the recorded quantity. |
rSeparator | Separator for the output csv file (for example a comma or semicolon). |
◆ SampleDataPoint() [1/2]
virtual void Kratos::StatisticsSampler::SampleDataPoint |
( |
const Geometry< Node > & |
rGeometry, |
|
|
const Vector & |
rShapeFunctions, |
|
|
const Matrix & |
rShapeDerivatives, |
|
|
std::vector< double >::iterator & |
BufferIterator |
|
) |
| |
|
inlinevirtual |
For first-order statistics: read data directly.
To be implemented in derived classes. Note that the BufferIterator argument will be advanced during the call.
- Parameters
-
[in] | rGeometry | The geometry for the element that contains the point where statistics are sampled. |
[in] | rShapeFunctions | Local values of elemental shape functions at the sampling point. |
[in] | rShapeDerivatives | Local values of elemental shape function gradients at the sampling point. |
| BufferIterator | Iterator pointing to the start of the storage of the statistics managed by this class. |
Reimplemented in Kratos::VectorAverageSampler< VectorType >, and Kratos::ScalarAverageSampler.
◆ SampleDataPoint() [2/2]
For higher-order statistics: operate on lower order data.
To be implemented in derived classes. Note that the BufferIterator argument will be advanced during the call.
- Parameters
-
| BufferIterator | Iterator pointing to the start of the storage of the statistics managed by this class. |
[in] | rCurrentStatistics | Container of last known values for recorded quantities at this sampling point. |
[in] | rNewMeasurement | Container of new measurements for recorded quantities at this sampling point. |
[in] | NumberOfMeasurements | Total number of realizations measured at the sampling point (including the current one). |
Reimplemented in Kratos::ThirdOrderCorrelationSampler, Kratos::ComponentwiseVarianceSampler, Kratos::SymmetricVarianceSampler, and Kratos::VarianceSampler.
◆ SetOffset()
void Kratos::StatisticsSampler::SetOffset |
( |
std::size_t |
Offset | ) |
|
|
inline |
Assign a new offset (from the start of the statistics container) to the first component stored by this statistic.
◆ Serializer
The documentation for this class was generated from the following file:
- /home/runner/work/Documentation/Documentation/master/applications/FluidDynamicsApplication/custom_utilities/statistics_utilities.h