8 #include "DdMdTrajectoryReader.h" 9 #include <mcMd/simulation/System.h> 10 #include <mcMd/simulation/Simulation.h> 11 #include <simp/species/Species.h> 12 #include <mcMd/chemistry/Molecule.h> 13 #include <mcMd/chemistry/Atom.h> 14 #include <util/archives/BinaryFileIArchive.h> 15 #include <util/space/Vector.h> 16 #include <util/space/IntVector.h> 17 #include <util/misc/ioUtil.h> 55 UTIL_THROW(
"Inconsistent values: nAtom != nAtomTotal_");
59 if (!positions_.isAllocated()) {
63 UTIL_THROW(
"Inconsistent values of atom capacity");
74 if (!positions_.isAllocated()) {
75 UTIL_THROW(
"positions_ array is not allocated");
94 double h = 1.0/(double(UINT_MAX) + 1.0);
114 for (iMol = 0; iMol < speciesPtr->
capacity(); ++iMol) {
116 for (molPtr->
begin(atomIter); atomIter.
notEnd(); ++atomIter) {
117 atomIter->position() = positions_[id];
System & system() const
Get a reference to the parent System.
const int Dimension
Dimensionality of space.
A Vector is a Cartesian vector.
void open(std::string filename)
Open trajectory file, read header, and allocate memory.
bool notEnd() const
Is the current pointer not at the end of the array?
virtual void addMolecules()
Add all molecules to system.
void begin(AtomIterator &iterator)
Set an Molecule::AtomIterator to first Atom in this Molecule.
A set of interacting Molecules enclosed by a Boundary.
void openInputFile(const std::string &filename, std::ifstream &in, std::ios_base::openmode mode=std::ios_base::in) const
Open an input file.
Simulation & simulation() const
Get a reference to the parent Simulation.
Molecule & molecule(int speciesId, int moleculeId)
Get a specific Molecule in this System, by integer index.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
bool readFrame()
Read a single frame.
Utility classes for scientific computation.
Trajectory file reader (base class).
Forward iterator for an Array or a C array.
int nAtomTotal_
Total number of atoms (all species)
void transformGenToCart(const Vector &Rg, Vector &Rc) const
Transform Vector of generalized coordinates to Cartesian Vector.
Boundary & boundary() const
Get the Boundary.
void close()
Close trajectory file.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
int nSpecies() const
Get the number of Species in this Simulation.
int capacity() const
Maximum allowed number of molecules for this Species.
virtual ~DdMdTrajectoryReader()
Destructor.
A physical molecule (a set of covalently bonded Atoms).
DdMdTrajectoryReader(System &system)
Constructor.
A Species represents a set of chemically similar molecules.
Species & species(int i)
Get a specific Species by reference.
FileMaster & fileMaster()
Get the FileMaster object.