8 #include "NveIntegrator.h" 9 #include <ddMd/simulation/Simulation.h> 10 #include <ddMd/storage/AtomStorage.h> 11 #include <ddMd/storage/AtomIterator.h> 12 #include <ddMd/communicate/Exchanger.h> 13 #include <ddMd/potentials/pair/PairPotential.h> 14 #include <util/space/Vector.h> 41 read<double>(in,
"dt", dt_);
55 loadParameter<double>(ar,
"dt", dt_);
90 double dtHalf = 0.5*dt_;
95 prefactors_[i] = dtHalf/mass;
111 for ( ; atomIter.
notEnd(); ++atomIter) {
112 prefactor = prefactors_[atomIter->typeId()];
114 dv.
multiply(atomIter->force(), prefactor);
115 atomIter->velocity() += dv;
117 dr.
multiply(atomIter->velocity(), dt_);
118 atomIter->position() += dr;
133 for ( ; atomIter.
notEnd(); ++atomIter) {
134 prefactor = prefactors_[atomIter->typeId()];
135 dv.
multiply(atomIter->force(), prefactor);
136 atomIter->velocity() += dv;
void loadParameters(Serializable::IArchive &ar)
Load saveInterval and saveFileName from restart archive.
virtual void integrateStep2()
Execute second step of two-step integrator.
~NveIntegrator()
Destructor.
Signal & velocitySignal()
Signal to indicate change in atomic velocities.
A Vector is a Cartesian vector.
Vector & multiply(const Vector &v, double s)
Multiply a vector v by a scalar s.
void readParameters(std::istream &in)
Read saveInterval and saveFileName.
void setIsSetup()
Mark the integrator as having been setup at least once.
double mass() const
Get the mass.
File containing preprocessor macros for error handling.
Parallel domain decomposition (DD) MD simulation.
Main object for a domain-decomposition MD simulation.
AtomType & atomType(int i)
Get an AtomType descriptor by reference.
virtual void integrateStep1()
Execute first step of two-step integrator.
Saving / output archive for binary ostream.
void setupAtoms()
Setup state of atoms just before integration.
void setup()
Setup state just before main loop.
void notify(const T &t)
Notify all observers.
bool notEnd() const
Is the current pointer not at the end of the PArray?
Utility classes for scientific computation.
void readParameters(std::istream &in)
Read required parameters.
bool isAllocated() const
Return true if the DArray has been allocated, false otherwise.
bool isSetup() const
Has the setup() method been called at least once previously?
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
AtomStorage & atomStorage()
Get the AtomStorage.
void save(Serializable::OArchive &ar)
Save saveInterval and saveFileName from restart archive.
Simulation & simulation()
Get the parent simulation.
int nAtomType()
Get maximum number of atom types.
Saving archive for binary istream.
A two-step velocity-Verlet style integrator.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
void setClassName(const char *className)
Set class name string.
int nAtomType()
Get maximum number of atom types.
int capacity() const
Return allocated size.
void allocate(int capacity)
Allocate the underlying C array.
Iterator for all atoms owned by an AtomStorage.
NveIntegrator(Simulation &simulation)
Constructor.
virtual void clear()
Set integrator to initial state and clears all statistics.
void begin(AtomIterator &iterator)
Set iterator to beginning of the set of atoms.