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

#include <alsuq/stats/StatisticsHelper.hpp>

Inheritance diagram for alsuq::stats::StatisticsHelper:
alsuq::stats::Statistics alsfvm::io::Writer alsuq::stats::BoundedVariation alsuq::stats::BoundedVariationDirection alsuq::stats::FunctionalStatistics alsuq::stats::MeanVariance alsuq::stats::OnePointMoment alsuq::stats::StructureBasic alsuq::stats::StructureBasicCUDA alsuq::stats::StructureCube alsuq::stats::StructureCubeCUDA alsuq::stats::StructureSurface alsuq::stats::StructureTwoPoints alsuq::stats::TimeIntegratedFunctionalStatistics

Public Member Functions

 StatisticsHelper (const StatisticsParameters &parameters)
 
void addWriter (const std::string &name, std::shared_ptr< alsfvm::io::Writer > &writer) override
 
virtual void combineStatistics () override
 Should be called at the end of the simulation. More...
 
virtual void writeStatistics (const alsfvm::grid::Grid &grid) override
 Writes the statistics to file. More...
 
- 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
 
virtual std::vector< std::string > getStatisticsNames () const =0
 
virtual void computeStatistics (const alsfvm::volume::Volume &conservedVariables, const alsfvm::grid::Grid &grid, const alsfvm::simulator::TimestepInformation &timestepInformation)=0
 
virtual void finalizeStatistics ()=0
 
- 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

StatisticsSnapshotfindOrCreateSnapshot (const std::string &name, const alsfvm::simulator::TimestepInformation &timestepInformation, const alsfvm::volume::Volume &conservedVariables)
 
StatisticsSnapshotfindOrCreateSnapshot (const std::string &name, const alsfvm::simulator::TimestepInformation &timestepInformation, const alsfvm::volume::Volume &conservedVariables, size_t nx, size_t ny, size_t nz, const std::string &platform="default")
 
void makeOwnGrid (size_t nx, size_t ny, size_t nz)
 

Protected Attributes

std::map< real, std::map< std::string, StatisticsSnapshot > > snapshots
 
- Protected Attributes inherited from alsfvm::io::Writer
std::map< std::string, boost::property_tree::ptree > attributesMap
 

Additional Inherited Members

- Static Public Member Functions inherited from alsfvm::io::Writer
static std::string getClassName ()
 

Constructor & Destructor Documentation

◆ StatisticsHelper()

alsuq::stats::StatisticsHelper::StatisticsHelper ( const StatisticsParameters parameters)

Member Function Documentation

◆ addWriter()

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

Add a writer to write the statistics to file

Parameters
writerthe writer to add
namethe name of the statistics (must be unique)

Implements alsuq::stats::Statistics.

◆ combineStatistics()

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

Should be called at the end of the simulation.

Implements alsuq::stats::Statistics.

◆ findOrCreateSnapshot() [1/2]

StatisticsSnapshot & alsuq::stats::StatisticsHelper::findOrCreateSnapshot ( const std::string &  name,
const alsfvm::simulator::TimestepInformation timestepInformation,
const alsfvm::volume::Volume conservedVariables 
)
protected

Utility function.

If the given timstep is already created, return that timestep, otherwise creates a new snapshot

Note
Uses the size of the given volume

◆ findOrCreateSnapshot() [2/2]

StatisticsSnapshot & alsuq::stats::StatisticsHelper::findOrCreateSnapshot ( const std::string &  name,
const alsfvm::simulator::TimestepInformation timestepInformation,
const alsfvm::volume::Volume conservedVariables,
size_t  nx,
size_t  ny,
size_t  nz,
const std::string &  platform = "default" 
)
protected

Utility function.

If the given timstep is already created, return that timestep, otherwise creates a new snapshot

◆ makeOwnGrid()

void alsuq::stats::StatisticsHelper::makeOwnGrid ( size_t  nx,
size_t  ny,
size_t  nz 
)
protected

◆ writeStatistics()

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

Writes the statistics to file.

Implements alsuq::stats::Statistics.

Member Data Documentation

◆ snapshots

std::map<real, std::map<std::string, StatisticsSnapshot> > alsuq::stats::StatisticsHelper::snapshots
protected

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