12 #include <mcMd/simulation/Simulation.h> 13 #include <simp/species/Species.h> 14 #include <mcMd/chemistry/Molecule.h> 15 #include <mcMd/chemistry/Atom.h> 16 #include <simp/boundary/Boundary.h> 17 #include <util/misc/FileMaster.h> 37 read<int>(in,
"nSamplePerBlock", nSamplePerBlock_);
46 read<int>(in,
"speciesId", speciesId_);
51 if (speciesId_ >=
system().simulation().nSpecies()) {
56 nAtom_ = speciesPtr_->
nAtom();
59 positions_.allocate(nAtom_);
66 { accumulator_.
clear(); }
85 for (j = 1 ; j < nAtom_; j++) {
89 positions_[j] = positions_[j-1];
93 dR.
subtract(positions_[0], positions_[nAtom_-1]);
98 dRSq /= double(nMolecule);
100 accumulator_.
sample(dRSq, outputFile_);
123 accumulator_.
output(outputFile_);
void clear()
Clear all accumulators, set to empty initial state.
A Vector is a Cartesian vector.
int nAtom() const
Get number of atoms per molecule for this Species.
double distanceSq(const Vector &r1, const Vector &r2) const
Return square distance between positions r1 and r2.
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.
virtual void output()
Output results at end of simulation.
Classes used by all simpatico molecular simulations.
void readOutputFileName(std::istream &in)
Read outputFileName from file.
EndtoEnd(System &system)
Constructor.
Molecule & molecule(int speciesId, int moleculeId)
Get a specific Molecule in this System, by integer index.
int nMolecule(int speciesId) const
Get the number of molecules of one Species in this System.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Simulation & simulation() const
Get the parent Simulation by reference.
virtual void writeParam(std::ostream &out)
Write all parameters to an output stream.
virtual void sample(long iStep)
Evaluate squared radii of gyration for all molecules, add to ensemble.
void readInterval(std::istream &in)
Read interval from file, with error checking.
virtual void readParameters(std::istream &in)
Read parameters from file, and allocate data array.
Utility classes for scientific computation.
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.
Boundary & boundary() const
Get the Boundary by reference.
void sample(double value)
Add a sampled value to the ensemble.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
int nSamplePerBlock() const
Get number of samples per block average.
Vector & subtract(const Vector &v1, const Vector &v2)
Subtract vector v2 from v1.
virtual void setup()
Clear accumulator.
void setClassName(const char *className)
Set class name string.
const Atom & atom(int localId) const
Get a specific Atom in this Molecule.
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).
const Vector & position() const
Get the position Vector by const reference.
Species & species(int i)
Get a specific Species by reference.
double square() const
Return square magnitude of this vector.