Alsvinn  0.5.3
The fast FVM simulator with UQ support
Public Member Functions | Protected Member Functions | List of all members
alsuq::stats::TimeIntegratedWriter Class Reference

#include <alsuq/stats/TimeIntegratedWriter.hpp>

Inheritance diagram for alsuq::stats::TimeIntegratedWriter:
alsuq::stats::Statistics alsfvm::io::Writer

Public Member Functions

 TimeIntegratedWriter (alsfvm::shared_ptr< Statistics > &writer, real time, real timeRadius)
 
virtual void combineStatistics () override
 To be called when the statistics should be combined. More...
 
virtual void addWriter (const std::string &name, std::shared_ptr< alsfvm::io::Writer > &writer) override
 
virtual std::vector< std::string > getStatisticsNames () const override
 
void writeStatistics (const alsfvm::grid::Grid &grid) override
 
virtual void finalizeStatistics () override
 
- Public Member Functions inherited from alsuq::stats::Statistics
virtual ~Statistics ()
 
virtual void write (const alsfvm::volume::Volume &conservedVariables, const alsfvm::grid::Grid &grid, const alsfvm::simulator::TimestepInformation &timestepInformation) override
 
- Public Member Functions inherited from alsfvm::io::Writer
virtual ~Writer ()
 
virtual void finalize (const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation)
 This method should be called at the end of the simulation. More...
 
void addAttributes (const std::string &nameOfAttributes, const boost::property_tree::ptree &attributes)
 

Protected Member Functions

virtual void computeStatistics (const alsfvm::volume::Volume &conservedVariables, const alsfvm::grid::Grid &grid, const alsfvm::simulator::TimestepInformation &timestepInformation) override
 

Additional Inherited Members

- Static Public Member Functions inherited from alsfvm::io::Writer
static std::string getClassName ()
 
- Protected Attributes inherited from alsfvm::io::Writer
std::map< std::string, boost::property_tree::ptree > attributesMap
 

Detailed Description

Decorator to compute time averaged statistics. This will roughly work in the following way:

It will call the underlying statistics class for each time tau where |tau-time|<timeRadius.

Constructor & Destructor Documentation

◆ TimeIntegratedWriter()

alsuq::stats::TimeIntegratedWriter::TimeIntegratedWriter ( alsfvm::shared_ptr< Statistics > &  writer,
real  time,
real  timeRadius 
)
Parameters
writerthe underlying writer to actually use.
timethe time for which to write the statistics
timeRadiusthe radius of the time interval

Member Function Documentation

◆ addWriter()

void alsuq::stats::TimeIntegratedWriter::addWriter ( const std::string &  name,
std::shared_ptr< alsfvm::io::Writer > &  writer 
)
overridevirtual

Adds a write for the given statistics name

Parameters
namethe name of the statitics (one of the names returned in getStatiticsNames()
writerthe writer to use

Implements alsuq::stats::Statistics.

◆ combineStatistics()

void alsuq::stats::TimeIntegratedWriter::combineStatistics ( )
overridevirtual

To be called when the statistics should be combined.

Implements alsuq::stats::Statistics.

◆ computeStatistics()

void alsuq::stats::TimeIntegratedWriter::computeStatistics ( const alsfvm::volume::Volume conservedVariables,
const alsfvm::grid::Grid grid,
const alsfvm::simulator::TimestepInformation timestepInformation 
)
overrideprotectedvirtual

◆ finalizeStatistics()

void alsuq::stats::TimeIntegratedWriter::finalizeStatistics ( )
overridevirtual

To be called in the end, this could be to eg compute the variance through M_2-mean^2 or any other postprocessing needed

Implements alsuq::stats::Statistics.

◆ getStatisticsNames()

std::vector< std::string > alsuq::stats::TimeIntegratedWriter::getStatisticsNames ( ) const
overridevirtual

Returns a list of the names of the statistics being computed, typically this could be ['mean', 'variance']

Implements alsuq::stats::Statistics.

◆ writeStatistics()

void alsuq::stats::TimeIntegratedWriter::writeStatistics ( const alsfvm::grid::Grid grid)
overridevirtual

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