8 #include "BoundaryAverage.h" 9 #include <mcMd/simulation/Simulation.h> 10 #include <simp/species/Species.h> 11 #include <simp/boundary/Boundary.h> 12 #include <util/space/Dimension.h> 13 #include <util/space/Vector.h> 14 #include <util/archives/Serializable_includes.h> 42 read<int>(in,
"nSamplePerBlock", nSamplePerBlock_);
47 accumulators_[i].setNSamplePerBlock(nSamplePerBlock_);
51 if (accumulators_[0].nSamplePerBlock()) {
55 isInitialized_ =
true;
64 loadParameter<int>(ar,
"nSamplePerBlock", nSamplePerBlock_);
68 if (accumulators_[0].nSamplePerBlock()) {
71 isInitialized_ =
true;
85 if (!isInitialized_) {
86 UTIL_THROW(
"Error: object is not initialized");
89 accumulators_[i].clear();
108 accumulators_[i].sample(lengths[i], outputFile_);
110 accumulators_[3].sample(volume, outputFile_);
118 if (accumulators_[0].nSamplePerBlock()) {
130 accumulators_[i].output(outputFile_);
131 outputFile_ << std::endl;
const int Dimension
Dimensionality of space.
A Vector is a Cartesian vector.
BoundaryAverage(System &system)
Constructor.
double volume() const
Return unit cell volume.
const Vector & lengths() const
Get Vector of unit cell lengths by const reference.
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 loadParameters(Serializable::IArchive &ar)
Load parameters from archive.
A set of interacting Molecules enclosed by a Boundary.
System & system()
Return reference to parent system.
virtual void sample(long iStep)
Evaluate volume and lengths of simulation cell, and add to ensemble.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
void readOutputFileName(std::istream &in)
Read outputFileName from file.
Saving / output archive for binary ostream.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
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.
virtual void save(Serializable::OArchive &ar)
Save state to archive.
virtual void readParameters(std::istream &in)
Read parameters from file.
Template for Analyzer associated with one System.
virtual void output()
Output results to file after simulation is completed.
Boundary & boundary() const
Get the Boundary by reference.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
virtual void loadParameters(Serializable::IArchive &ar)
Load state from an archive.
virtual void setup()
Clear accumulator.
void setClassName(const char *className)
Set class name string.
FileMaster & fileMaster()
Get the FileMaster by reference.
bool isAtInterval(long counter) const
Return true iff counter is a multiple of the interval.
const std::string & outputFileName() const
Return outputFileName string.