1 #ifndef LINK_LIFE_TIME_CPP 2 #define LINK_LIFE_TIME_CPP 11 #include "LinkLifeTime.h" 12 #include <mcMd/simulation/Simulation.h> 13 #include <mcMd/links/LinkMaster.h> 14 #include <simp/species/Species.h> 15 #include <simp/boundary/Boundary.h> 16 #include <mcMd/chemistry/Molecule.h> 17 #include <mcMd/chemistry/Atom.h> 18 #include <util/misc/FileMaster.h> 38 read<int>(in,
"linkCapacity", linkCapacity_);
50 for (
int i=0; i<linkCapacity_; ++i) {
66 int btime, dtime, ltime;
68 btime = birthTimes_[
event.get()->tag()];
72 ltime = dtime - btime;
73 birthTimes_[
event.get()->tag()] = -1;
74 accumulator_.
sample((
double)ltime);
90 accumulator_.
output(outputFile_);
virtual void output()
Output results to output file.
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.
File containing preprocessor macros for error handling.
Event signalling removal of a Link from the LinkMaster.
Classes used by all simpatico molecular simulations.
void readOutputFileName(std::istream &in)
Read outputFileName from file.
void sample(long iStep)
Don't do anything.
Simulation & simulation() const
Get the parent Simulation by reference.
virtual void setup()
Register Observer.
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.
void sample(double value)
Sample a value.
LinkLifeTime(System &system)
Constructor.
Event signalling addition of Link to the LinkMaster.
virtual void readParameters(std::istream &in)
Read parameters from file.
Template for Analyzer associated with one System.
void output(std::ostream &out)
Output the distribution to file.
virtual void clear()
Clear (i.e., zero) previously allocated histogram.
int iStep() const
Get value of step index for main MC or MD loop.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void setClassName(const char *className)
Set class name string.
void readParamComposite(std::istream &in, ParamComposite &child, bool next=true)
Add and read a required child ParamComposite.
FileMaster & fileMaster()
Get the FileMaster by reference.
const std::string & outputFileName() const
Return outputFileName string.
void allocate(int capacity)
Allocate the underlying C array.
LinkMaster & linkMaster() const
Get the LinkMaster by reference.