Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
Statistics Class Reference

Running time averages per owned cell: means of fields and covariances <a'b'> of pairs of them, updated on the device every interval steps once t > t_start. A sample at time t has weight t - t_prev (the previous sample's time, or t_start), and with a = w / W over the total weight W the update is (West 1979) d_a = a_new - mean_a, mean_a += a d_a, cov_ab += a (d_a (b_new - mean_b,new) - cov_ab), so each output field is the current average itself. Restart files carry the averages and the weights, so a restarted run continues them bitwise. More...

#include <statistics.h>

Public Member Functions

void init (const toml::value &input, const std::vector< std::string > &species_names, uint32_t n_cells)
 Read [statistics] (if any) and allocate n_cells.
 
bool enabled () const
 
bool due (uint64_t step, rtype t) const
 
void sample (rtype t, const CellSampler &sampler, uint32_t n_owned)
 Add the sample of time t of cells [0, n_owned).
 
std::vector< std::string > variables () const
 Output variables: MEAN_<field>..., COV__...
 
void register_data (std::vector< Data > &data) const
 
void copy_device_to_host ()
 
void restore (const RestartData &restart, const std::string &file, rtype t)
 Continue the averages of a restart file, or start afresh at time t if it holds none (or with reset); throws if it holds only some of them.
 
void start (rtype t)
 Start afresh at time t (first sample weighted from max(t, t_start)).
 
RestartAttributes attributes () const
 
std::string summary () const
 
uint64_t samples () const
 
const auto & host_means () const
 Host copies (see copy_device_to_host): (cell, field) means, (cell, product) covariances.
 
const auto & host_covariances () const
 

Detailed Description

Running time averages per owned cell: means of fields and covariances <a'b'> of pairs of them, updated on the device every interval steps once t > t_start. A sample at time t has weight t - t_prev (the previous sample's time, or t_start), and with a = w / W over the total weight W the update is (West 1979) d_a = a_new - mean_a, mean_a += a d_a, cov_ab += a (d_a (b_new - mean_b,new) - cov_ab), so each output field is the current average itself. Restart files carry the averages and the weights, so a restarted run continues them bitwise.

Member Function Documentation

◆ attributes()

RestartAttributes Statistics::attributes ( ) const

◆ copy_device_to_host()

void Statistics::copy_device_to_host ( )

◆ due()

bool Statistics::due ( uint64_t  step,
rtype  t 
) const
inline

◆ enabled()

bool Statistics::enabled ( ) const
inline

◆ host_covariances()

const auto & Statistics::host_covariances ( ) const
inline

◆ host_means()

const auto & Statistics::host_means ( ) const
inline

Host copies (see copy_device_to_host): (cell, field) means, (cell, product) covariances.

◆ init()

void Statistics::init ( const toml::value &  input,
const std::vector< std::string > &  species_names,
uint32_t  n_cells 
)

Read [statistics] (if any) and allocate n_cells.

◆ register_data()

void Statistics::register_data ( std::vector< Data > &  data) const

◆ restore()

void Statistics::restore ( const RestartData &  restart,
const std::string &  file,
rtype  t 
)

Continue the averages of a restart file, or start afresh at time t if it holds none (or with reset); throws if it holds only some of them.

◆ sample()

void Statistics::sample ( rtype  t,
const CellSampler &  sampler,
uint32_t  n_owned 
)

Add the sample of time t of cells [0, n_owned).

◆ samples()

uint64_t Statistics::samples ( ) const
inline

◆ start()

void Statistics::start ( rtype  t)

Start afresh at time t (first sample weighted from max(t, t_start)).

◆ summary()

std::string Statistics::summary ( ) const

◆ variables()

std::vector< std::string > Statistics::variables ( ) const

Output variables: MEAN_<field>..., COV__...


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