1#ifndef RP_AVERAGE_ANALYZER_H
2#define RP_AVERAGE_ANALYZER_H
11#include <util/accumulators/Average.h>
39 template <
int D,
class T>
71 virtual void sample(
long iStep);
110 typename T::System& system);
133 int nSamplePerOutput_;
135 using AnalyzerT =
typename T::Analyzer;
142 template <
int D,
class T>
inline
144 {
return nSamplePerOutput_; }
int nSamplePerOutput() const
Get value of nSamplePerOutput.
~AverageAnalyzer()=default
Destructor.
virtual void outputValue(int step, double value)
Output a sampled or block average value.
virtual void sample(long iStep)
Compute a sampled value and update the accumulator.
virtual void readParameters(std::istream &in)
Read interval, outputFileName and (optionally) nSamplePerOutput.
Average accumulator_
Average object.
AverageAnalyzer(typename T::Simulator &simulator, typename T::System &system)
Constructor.
virtual void output()
Write final results to file after a simulation.
std::ofstream outputFile_
Output file stream.
virtual void setup()
Setup before loop.
virtual double compute()=0
Compute value of sampled quantity.
Calculates the average and variance of a sampled property.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.