12 #include <mcMd/simulation/Simulation.h> 13 #include <mcMd/chemistry/Molecule.h> 14 #include <mcMd/chemistry/Atom.h> 15 #include <simp/species/Species.h> 16 #include <simp/boundary/Boundary.h> 17 #include <util/misc/FileMaster.h> 37 read<int>(in,
"capacity", capacity_);
38 read<int>(in,
"linkCapacity", linkCapacity_);
41 accumulator_.allocate(capacity_);
44 int nle = 2*linkCapacity_;
51 for (i=0; i < capacity_; ++i){
52 accumulator_[i].setNSamplePerBlock(nSamplePerBlock_);
55 if (nSamplePerBlock_ != 0) {
67 int nle = 2*linkCapacity_;
70 for (i=0; i < capacity_; ++i){
71 accumulator_[i].clear();
73 for (i=0; i < nle; ++i){
85 int idLink, dt, dr, dr2, le, le1, i, t;
88 for (idLink=0; idLink < nLink; ++idLink){
90 le = (linkPtr->
tag())*2;
100 if (dt < capacity_) {
101 accumulator_[dt].sample(
double(dr2), outputFile_);
111 if (t0_[le1] != -1) {
119 if (dt < capacity_) {
120 accumulator_[dt].sample(
double(dr2), outputFile_);
137 int le = (
event.get()->tag())*2;
148 int le = (
event.get()->tag())*2;
163 if (nSamplePerBlock_ != 0) {
175 accumulator_[0].sample(0, outputFile_);;
176 accumulator_[0].output(outputFile_);
177 for(i=1; i<capacity_; ++i){
178 accumulator_[i].output(outputFile_);
int nLink() const
Get the total number of active Links.
LinkMSD(System &system)
Constructor.
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 setup()
Empty.
A set of interacting Molecules enclosed by a Boundary.
System & system()
Return reference to parent system.
A Link represents a crosslink between two Atoms.
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.
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 readParameters(std::istream &in)
Read parameters from file, and allocate data arrays.
Event signalling addition of Link to the LinkMaster.
Template for Analyzer associated with one System.
virtual void sample(long iStep)
Evaluate.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
int tag() const
Get a permanent integer identifier for this object.
virtual void output()
Output param file at end of simulation.
const Atom & atom1() const
Get Atom1 connected to a Link.
void setClassName(const char *className)
Set class name string.
int indexInMolecule() const
Get local index for this Atom within the parent molecule;.
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.
void allocate(int capacity)
Allocate the underlying C array.
int interval() const
Get interval value.
const Atom & atom0() const
Get Atom0 connected to a Link.
LinkMaster & linkMaster() const
Get the LinkMaster by reference.