8 #include "McEnergyOutput.h" 10 #include <util/misc/FileMaster.h> 11 #include <util/format/Dbl.h> 59 outputFile_ <<
Dbl(pair);
64 outputFile_ << Dbl(bond);
68 if (
system().hasAnglePotential()) {
70 outputFile_ << Dbl(angle);
75 if (
system().hasDihedralPotential()) {
77 outputFile_ << Dbl(dihedral);
82 if (
system().hasLinkPotential()) {
84 outputFile_ << Dbl(link);
89 if (
system().hasExternalPotential()) {
91 outputFile_ << Dbl(external);
96 double tether =
system().tetherPotential().energy();
97 outputFile_ << Dbl(tether);
100 outputFile_ << Dbl(energy) << std::endl;
115 outputFile_ << std::endl;
116 outputFile_ << std::endl;
118 outputFile_ <<
"File format:" << std::endl;
120 outputFile_ <<
"[pair] ";
123 outputFile_ <<
"[bond] ";
126 if (
system().hasAnglePotential()) {
127 outputFile_ <<
"[angle] ";
131 if (
system().hasDihedralPotential()) {
132 outputFile_ <<
"[dihedral] ";
136 if (
system().hasLinkPotential()) {
137 outputFile_ <<
"[link] ";
141 if (
system().hasExternalPotential()) {
142 outputFile_ <<
"[external] ";
146 outputFile_ <<
"[tether] ";
148 outputFile_ <<
"[potential] ";
149 outputFile_ << std::endl;
A System for use in a Markov chain Monte Carlo simulation.
virtual double energy(double rsq, int iAtomType, int jAtomType) const =0
Return pair energy for a single pair.
Include this file to include all MC potential energy classes at once.
BondPotential & bondPotential() const
Return the BondPotential by 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.
McSystem & system()
Return reference to parent system.
Wrapper for a double precision number, for formatted ostream output.
void readOutputFileName(std::istream &in)
Read outputFileName from file.
virtual void readParameters(std::istream &in)
Read output file and nStepPerSample.
Saving / output archive for binary ostream.
virtual double energy(const Vector &R1, const Vector &R2, const Vector &R3, int type) const =0
Returns potential energy for one dihedral.
virtual double energy(const Vector &position, int i) const =0
Returns external potential energy of a single particle.
virtual void writeParam(std::ostream &out)
Write all parameters to an output stream.
ExternalPotential & externalPotential() const
Return ExternalPotential by reference.
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 an archive.
Template for Analyzer associated with one System.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
virtual double energy(double cosTheta, int type) const =0
Returns potential energy for one angle.
McEnergyOutput(McSystem &system)
Constructor.
virtual double energy(double rSq, int type) const =0
Returns potential energy for one bond.
virtual void output()
Output final summary and file format.
BondPotential & linkPotential() const
Return the McLinkPotential by reference.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
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.
AnglePotential & anglePotential() const
Return AnglePotential by reference.
const std::string & outputFileName() const
Return outputFileName string.
virtual void loadParameters(Serializable::IArchive &ar)
Load state from an archive.
void sample(long iStep)
Evaluate energy and print.
DihedralPotential & dihedralPotential() const
Return the DihedralPotential by reference.