8 #include "InterIntraLink.h" 9 #include <mcMd/simulation/Simulation.h> 10 #include <mcMd/links/LinkMaster.h> 11 #include <util/misc/FileMaster.h> 12 #include <mcMd/chemistry/Molecule.h> 13 #include <mcMd/chemistry/Atom.h> 38 if (nSamplePerBlock_ != 0) {
48 { accumulatorInter_.
clear();
49 accumulatorIntra_.
clear();
55 int interLink, intraLink;
56 int nLink, iLink, iMol0, iMol1;
58 Atom *atom0Ptr, *atom1Ptr;
67 for (iLink = 0; iLink < nLink ; ++iLink) {
69 atom0Ptr = &(linkPtr->
atom0());
70 atom1Ptr = &(linkPtr->
atom1());
82 accumulatorInter_.
sample(interLink, outputFile_);
83 accumulatorIntra_.
sample(intraLink, outputFile_);
93 if (nSamplePerBlock_ != 0) {
104 outputFile_ <<
"Average number of intermolecular links: " << std::endl;
105 accumulatorInter_.
output(outputFile_);
106 outputFile_ << std::endl;
107 outputFile_ <<
"Average number of intramolecular links: " << std::endl;
108 accumulatorIntra_.
output(outputFile_);
int nLink() const
Get the total number of active Links.
Molecule & molecule() const
Get the parent Molecule by reference.
void clear()
Clear all accumulators, set to empty initial state.
void openOutputFile(const std::string &filename, std::ofstream &out, std::ios_base::openmode mode=std::ios_base::out) const
Open an output file.
A set of interacting Molecules enclosed by a Boundary.
System & system()
Return reference to parent system.
A Link represents a crosslink between two Atoms.
void readOutputFileName(std::istream &in)
Read outputFileName from file.
virtual void setup()
Clear accumulator.
virtual void writeParam(std::ostream &out)
Write all parameters to an output stream.
virtual void output()
Output results at end of simulation.
void readInterval(std::istream &in)
Read interval from file, with error checking.
A point particle within a Molecule.
Utility classes for scientific computation.
virtual void sample(long iStep)
Evaluate inter and intramolecule number of links, add to ensemble.
Template for Analyzer associated with one System.
void output(std::ostream &out) const
Output final statistical properties to file.
void setNSamplePerBlock(int nSamplePerBlock)
Set nSamplePerBlock.
virtual void readParameters(std::istream &in)
Read parameters from file, and allocate data array.
void sample(double value)
Add a sampled value to the ensemble.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
const Atom & atom1() const
Get Atom1 connected to a Link.
void setClassName(const char *className)
Set class name string.
Link & link(int id) const
Return an active link by an internal set index.
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.
A physical molecule (a set of covalently bonded Atoms).
InterIntraLink(System &system)
Constructor.
const Atom & atom0() const
Get Atom0 connected to a Link.
int moleculeId(const Molecule &molecule) const
Get the index of a Molecule within its Species in this System.
LinkMaster & linkMaster() const
Get the LinkMaster by reference.