1 #ifndef MCMD_AVERAGE_ANALYZER_H 2 #define MCMD_AVERAGE_ANALYZER_H 11 #include <mcMd/analyzers/SystemAnalyzer.h> 12 #include <util/accumulators/Average.h> 13 #include <util/misc/FileMaster.h> 25 template <
class SystemType>
44 virtual void readParameters(std::istream& in);
66 template <
class Archive>
67 void serialize(Archive& ar,
const unsigned int version);
77 virtual void output();
95 template <
class SystemType>
106 template <
class SystemType>
113 template <
class SystemType>
134 template <
class SystemType>
139 ParamComposite::loadParameter<int>(ar,
"nSamplePerBlock",
144 UTIL_THROW(
"Inconsistent values of nSamplePerBlock_");
148 if (accumulator_.nSamplePerBlock()) {
158 template <
class SystemType>
166 template <
class SystemType>
167 template <
class Archive>
169 const unsigned int version)
179 template <
class SystemType>
186 template <
class SystemType>
void clear()
Clear all accumulators, set to empty initial state.
AverageAnalyzer(SystemType &system)
Constructor.
std::ofstream outputFile_
Output file stream.
Calculates the average and variance of a sampled property.
void openOutputFile(const std::string &filename, std::ofstream &out, std::ios_base::openmode mode=std::ios_base::out) const
Open an output file.
virtual void output()
Output results at end of simulation.
virtual void loadParameters(Serializable::IArchive &ar)
Load parameters from archive.
int nSamplePerBlock_
Number of samples per block average output.
void readOutputFileName(std::istream &in)
Read outputFileName from file.
void serialize(Archive &ar, PairSelector &selector, const unsigned int version)
Serialize a PairSelector.
Saving / output archive for binary ostream.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
~AverageAnalyzer()
Destructor.
virtual void writeParam(std::ostream &out)
Write all parameters to an output stream.
void readInterval(std::istream &in)
Read interval from file, with error checking.
Utility classes for scientific computation.
Average accumulator_
Average object - statistical accumulator.
AverageAnalyzer averages of total potential energy.
Template for Analyzer associated with one System.
void output(std::ostream &out) const
Output final statistical properties to file.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
void setNSamplePerBlock(int nSamplePerBlock)
Set nSamplePerBlock.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
virtual void save(Serializable::OArchive &ar)
Save state to an archive.
int nSamplePerBlock() const
Get number of samples per block average.
virtual void readParameters(std::istream &in)
Read parameters and initialize.
FileMaster & fileMaster()
Get the FileMaster by reference.
const std::string & outputFileName() const
Return outputFileName string.
virtual void setup()
Clear accumulators.
virtual void loadParameters(Serializable::IArchive &ar)
Load state from an archive.