KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Public Member Functions | List of all members
Kratos::ThirdOrderCorrelationSampler Class Reference

This class manages the computation of third order moments of scalars or vector components. More...

#include <statistics_utilities.h>

Inheritance diagram for Kratos::ThirdOrderCorrelationSampler:
Collaboration diagram for Kratos::ThirdOrderCorrelationSampler:

Public Member Functions

 ThirdOrderCorrelationSampler (const StatisticsSampler::Pointer pQuantity1, const std::size_t QuantityComponent1, const StatisticsSampler::Pointer pQuantity2, const std::size_t QuantityComponent2, const StatisticsSampler::Pointer pQuantity3, const std::size_t QuantityComponent3, const StatisticsSampler::Pointer pVariance12, const std::size_t VarianceComponent12, const StatisticsSampler::Pointer pVariance13, const std::size_t VarianceComponent13, const StatisticsSampler::Pointer pVariance23, const std::size_t VarianceComponent23)
 Initialize a sampler for the third order moment involving three given quantities. More...
 
void SampleDataPoint (std::vector< double >::iterator &BufferIterator, const StatisticsSampler::IntegrationPointDataView &rCurrentStatistics, const std::vector< double > &rNewMeasurement, const std::size_t NumberOfMeasurements) override
 For higher-order statistics: operate on lower order data. More...
 
virtual void OutputHeader (std::ofstream &rOutStream, const std::string &rSeparator) const override
 Write header for the output file. More...
 
- Public Member Functions inherited from Kratos::StatisticsSampler
 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...
 
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 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...
 

Additional Inherited Members

- Public Types inherited from Kratos::StatisticsSampler
typedef Matrix::iterator1 IntegrationPointDataView
 
typedef Matrix::const_iterator2 IntegrationPointDataViewIterator
 
- Protected Member Functions inherited from Kratos::StatisticsSampler
void AddTag (std::string Tag)
 

Detailed Description

This class manages the computation of third order moments of scalars or vector components.

Note that, since vector correlations quickly involve a lot of cross-components (up to 27 in 3D), support is only provided for single-valued quantities (that is, combinations of scalars or vector components).

Constructor & Destructor Documentation

◆ ThirdOrderCorrelationSampler()

Kratos::ThirdOrderCorrelationSampler::ThirdOrderCorrelationSampler ( const StatisticsSampler::Pointer  pQuantity1,
const std::size_t  QuantityComponent1,
const StatisticsSampler::Pointer  pQuantity2,
const std::size_t  QuantityComponent2,
const StatisticsSampler::Pointer  pQuantity3,
const std::size_t  QuantityComponent3,
const StatisticsSampler::Pointer  pVariance12,
const std::size_t  VarianceComponent12,
const StatisticsSampler::Pointer  pVariance13,
const std::size_t  VarianceComponent13,
const StatisticsSampler::Pointer  pVariance23,
const std::size_t  VarianceComponent23 
)
inline

Initialize a sampler for the third order moment involving three given quantities.

Note that online recording of a third order statistic requires recording the averages of each quantity and the covariances for each pair. When using this class with a scalar quantity, pass 0 as its ComponentIndex. For variances, use pVarianceij->GetComponentIndex() to obtain the corresponding VarianceComponent argument.

Parameters
pQuantity1Sampler for the average of the first quantity of the third order moment.
ComponentIndex1Index of the component of pQuantity1 to be used in calculation.
pQuantity2Sampler for the average of the second quantity of the third order moment.
ComponentIndex2Index of the component of pQuantity2 to be used in calculation.
pQuantity3Sampler for the average of the third quantity of the third order moment.
ComponentIndex3Index of the component of pQuantity3 to be used in calculation.
pVariance12Sampler for the covariance of the first and second quantities.
VarianceComponent12Index of the component of pVariance12 to be used in calculation.
pVariance13Sampler for the covariance of the first and third quantities.
VarianceComponent13Index of the component of pVariance13 to be used in calculation.
pVariance23Sampler for the covariance of the second and third quantities.
VarianceComponent23Index of the component of pVariance23 to be used in calculation.

Member Function Documentation

◆ OutputHeader()

virtual void Kratos::ThirdOrderCorrelationSampler::OutputHeader ( std::ofstream &  rOutStream,
const std::string &  rSeparator 
) const
inlineoverridevirtual

Write header for the output file.

This function is called when printing to a file.

Parameters
rOutStreamstream for the output file.
rSeparatorSeparator for the output csv file (for example a comma or semicolon).

Reimplemented from Kratos::StatisticsSampler.

◆ SampleDataPoint()

void Kratos::ThirdOrderCorrelationSampler::SampleDataPoint ( std::vector< double >::iterator &  BufferIterator,
const StatisticsSampler::IntegrationPointDataView rCurrentStatistics,
const std::vector< double > &  rNewMeasurement,
const std::size_t  NumberOfMeasurements 
)
inlineoverridevirtual

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
BufferIteratorIterator pointing to the start of the storage of the statistics managed by this class.
[in]rCurrentStatisticsContainer of last known values for recorded quantities at this sampling point.
[in]rNewMeasurementContainer of new measurements for recorded quantities at this sampling point.
[in]NumberOfMeasurementsTotal number of realizations measured at the sampling point (including the current one).

Reimplemented from Kratos::StatisticsSampler.


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