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.
List of all members
Kratos::StatisticsRecord Class Reference

Main class for online statistics calculation. More...

#include <statistics_record.h>

Collaboration diagram for Kratos::StatisticsRecord:

Public Member Functions

Type Definitions
 KRATOS_CLASS_POINTER_DEFINITION (StatisticsRecord)
 Pointer definition of StatisticsRecord. More...
 
Life Cycle
 StatisticsRecord ()
 Default constructor. More...
 
virtual ~StatisticsRecord ()
 Destructor. More...
 
Operations
void AddResult (StatisticsSampler::Pointer pResult)
 Add one first order statistic to be tracked during the simulation. More...
 
void AddHigherOrderStatistic (StatisticsSampler::Pointer pResult)
 Add one second or higher order statistic to be tracked during the simulation. More...
 
void InitializeStorage (ModelPart::ElementsContainerType &rElements)
 Initialize elemental storage for the tracked statistics. More...
 
void SampleIntegrationPointResults (ModelPart &rModelPart)
 Record a new sample point. More...
 
void UpdateStatistics (Element *pElement)
 Update statistics for a single element. More...
 
void PrintToFile (const ModelPart &rModelPart, const std::string &rOutputFileName) const
 Output recorded statistics to a comma-separated value file. More...
 
std::vector< doubleOutputForTest (ModelPart::ElementsContainerType &rElements) const
 Output current values of all recorded quantities as a vector of doubles. More...
 
Input and output
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Serialization

class Serializer
 

Detailed Description

Main class for online statistics calculation.

This class manages the definition, update and output of statistics calculated during a simulation. It is intended to be stored as a ProcessInfo variable and called at specific points during the simulation procedure.

See also
IntegrationPointStatisticsProcess for an implementation using this to compute statistics at the mesh integration points.

Constructor & Destructor Documentation

◆ StatisticsRecord()

Kratos::StatisticsRecord::StatisticsRecord ( )
inline

Default constructor.

◆ ~StatisticsRecord()

virtual Kratos::StatisticsRecord::~StatisticsRecord ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ AddHigherOrderStatistic()

void Kratos::StatisticsRecord::AddHigherOrderStatistic ( StatisticsSampler::Pointer  pResult)

Add one second or higher order statistic to be tracked during the simulation.

Parameters
[in]pResultpointer to the statistic quantity.

◆ AddResult()

void Kratos::StatisticsRecord::AddResult ( StatisticsSampler::Pointer  pResult)

Add one first order statistic to be tracked during the simulation.

Parameters
[in]pResultpointer to the statistic quantity.

◆ Info()

virtual std::string Kratos::StatisticsRecord::Info ( ) const
inlinevirtual

Turn back information as a string.

◆ InitializeStorage()

void Kratos::StatisticsRecord::InitializeStorage ( ModelPart::ElementsContainerType rElements)

Initialize elemental storage for the tracked statistics.

Note that all results should be added before calling this.

Parameters
rElementsList of elements whose integration points will be used to record statistics.

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::StatisticsRecord::KRATOS_CLASS_POINTER_DEFINITION ( StatisticsRecord  )

Pointer definition of StatisticsRecord.

◆ OutputForTest()

std::vector< double > Kratos::StatisticsRecord::OutputForTest ( ModelPart::ElementsContainerType rElements) const

Output current values of all recorded quantities as a vector of doubles.

Provided for debug and testing purposes ONLY.

◆ PrintData()

virtual void Kratos::StatisticsRecord::PrintData ( std::ostream &  rOStream) const
inlinevirtual

Print object's data.

◆ PrintInfo()

virtual void Kratos::StatisticsRecord::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.

◆ PrintToFile()

void Kratos::StatisticsRecord::PrintToFile ( const ModelPart rModelPart,
const std::string &  rOutputFileName 
) const

Output recorded statistics to a comma-separated value file.

Parameters
[in]rModelPartThe model part instance where statistics are recorded.
[in]rOutputFileNameBase name for the output file. The .csv extension (and in MPI the rank) will be automatically appended to the provided file name.

◆ SampleIntegrationPointResults()

void Kratos::StatisticsRecord::SampleIntegrationPointResults ( ModelPart rModelPart)

Record a new sample point.

This function expects InitializeStorage to have been called in advance. Normal usage will be to call this once for time step (or every time a new measurement is available). It is also assumed that the elements will call the UpdateStatistics method of this class internally.

See also
FluidElement for an example of use.
Parameters
rModelPartModelPart containing the elements where statistics are recorded.

◆ UpdateStatistics()

void Kratos::StatisticsRecord::UpdateStatistics ( Element pElement)

Update statistics for a single element.

This function should be called by elements supporting statistics calculation on integration points.

See also
FluidElement for an example of use.
Parameters
rElementThe element.

Friends And Related Function Documentation

◆ Serializer

friend class Serializer
friend

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