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

#include <alsuq/stats/FixedIntervalStatistics.hpp>

Inheritance diagram for alsuq::stats::FixedIntervalStatistics:
alsuq::stats::Statistics alsfvm::integrator::TimestepAdjuster alsfvm::io::Writer

Public Member Functions

 FixedIntervalStatistics (alsfvm::shared_ptr< Statistics > &writer, real timeInterval, real endTime, bool writeInitialTimestep=true)
 
virtual real adjustTimestep (real dt, const alsfvm::simulator::TimestepInformation &timestepInformation) const override
 adjustTimestep returns the new timestep that the simulator should use More...
 
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 for the statistics class to only write a given interval, this mimics the use of alsfvm::io::FixedIntervalWriter

Constructor & Destructor Documentation

◆ FixedIntervalStatistics()

alsuq::stats::FixedIntervalStatistics::FixedIntervalStatistics ( alsfvm::shared_ptr< Statistics > &  writer,
real  timeInterval,
real  endTime,
bool  writeInitialTimestep = true 
)
Parameters
writerthe underlying writer to actually use.
timeIntervalthe time interval (will save for every time n*timeInterval)
endTimethe final time for the simulation.
writeInitialTimestepwrite the first timestep

Member Function Documentation

◆ addWriter()

void alsuq::stats::FixedIntervalStatistics::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.

◆ adjustTimestep()

real alsuq::stats::FixedIntervalStatistics::adjustTimestep ( real  dt,
const alsfvm::simulator::TimestepInformation timestepInformation 
) const
overridevirtual

adjustTimestep returns the new timestep that the simulator should use

Parameters
dtthe current timestep being used
timestepInformationtimesteps information
Returns
the new timestep

Implements alsfvm::integrator::TimestepAdjuster.

◆ combineStatistics()

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

To be called when the statistics should be combined.

Implements alsuq::stats::Statistics.

◆ computeStatistics()

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

◆ finalizeStatistics()

void alsuq::stats::FixedIntervalStatistics::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::FixedIntervalStatistics::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::FixedIntervalStatistics::writeStatistics ( const alsfvm::grid::Grid grid)
overridevirtual

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