faunus
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Faunus::analysis::Analysis Class Referenceabstract

Base class for all analysis functions. More...

#include <analysis.h>

Inheritance diagram for Faunus::analysis::Analysis:
Inheritance graph
[legend]
Collaboration diagram for Faunus::analysis::Analysis:
Collaboration graph
[legend]

Public Member Functions

void to_json (json &j) const
 JSON report w. statistics, output etc.
 
void from_json (const json &j)
 configure from json object
 
void to_disk ()
 Save data to disk (if defined) More...
 
void sample ()
 Increase step count and sample. More...
 
int getNumberOfSteps () const
 Number of steps.
 
 Analysis (const Space &spc, std::string_view name)
 
 Analysis (const Space &spc, std::string_view name, int sample_interval, int number_of_skipped_steps)
 

Public Attributes

const std::string name
 descriptive name
 
std::string cite
 url, doi etc. describing the analysis
 

Protected Attributes

const Spacespc
 Instance of Space to analyse.
 
int sample_interval = 0
 Steps in between each sample point (do not modify)
 
int number_of_samples = 0
 counter for number of samples
 

Detailed Description

Base class for all analysis functions.

Analysis classes are used to perform system analysis over the course or a simulations or for post-analysis of an existing trajectory. The base class adds basic functionality such as timing, number of steps, json IO and enforce a common interface.

Member Function Documentation

◆ sample()

void Faunus::analysis::Analysis::sample ( )

Increase step count and sample.

For each call:

  1. increment step count
  2. check if interval and skipped steps matches
  3. if so, call _sample() and increment number of samples

The call to the sampling function is timed.

◆ to_disk()

void Faunus::analysis::Analysis::to_disk ( )

Save data to disk (if defined)

Wrapper function used for non-intrusive future padding around _to_disk().


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