8 #include "HybridMdMove.h" 9 #include <mcMd/mcSimulation/McSystem.h> 10 #include <mcMd/mdIntegrators/MdIntegrator.h> 11 #include <mcMd/mdSimulation/MdSystem.h> 12 #include <mcMd/simulation/Simulation.h> 13 #include <mcMd/chemistry/Atom.h> 15 #include <mcMd/potentials/pair/MdPairPotential.h> 16 #include <mcMd/potentials/pair/McPairPotential.h> 34 oldPositions_.allocate(
simulation().atomCapacity());
53 read<int>(in,
"nStep", nStep_);
63 loadParameter<int>(ar,
"nStep", nStep_);
84 double oldEnergy, newEnergy;
92 for (iSpec = 0; iSpec < nSpec; ++iSpec) {
93 mdSystemPtr_->
begin(iSpec, molIter);
94 for ( ; molIter.
notEnd(); ++molIter) {
95 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
96 oldPositions_[atomIter->id()] = atomIter->position();
114 for (
int iStep = 0; iStep < nStep_; ++iStep) {
139 for (iSpec = 0; iSpec < nSpec; ++iSpec) {
140 mdSystemPtr_->
begin(iSpec, molIter);
141 for ( ; molIter.
notEnd(); ++molIter) {
142 molIter->begin(atomIter);
143 for ( ; atomIter.
notEnd(); ++atomIter) {
144 atomIter->position() = oldPositions_[atomIter->id()];
A System for use in a Markov chain Monte Carlo simulation.
void buildCellList()
Build the CellList with current configuration.
void calculateForces()
Compute all forces in this System.
void incrementNAttempt()
Increment the number of attempted moves.
void begin(int speciesId, MoleculeIterator &iterator)
Initialize an iterator for molecules of one species in this System.
bool notEnd() const
Is the current pointer not at the end of the array?
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
void loadParamComposite(Serializable::IArchive &ar, ParamComposite &child, bool next=true)
Add and load a required child ParamComposite.
MdIntegrator & mdIntegrator()
Return the MdIntegrator by reference.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
virtual void readParameters(std::istream &in)
Read nStep, dt, skin, maxNPair from file.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
double potentialEnergy()
Compute and return total potential energy.
virtual void setup()
Initialize internal state, if any.
bool move()
Generate, attempt and accept or reject a move.
Saving / output archive for binary ostream.
double boltzmann(double energy)
Boltzmann weight associated with an energy difference.
MdPairPotential & pairPotential() const
Return MdPairPotential by reference.
McSystem & system()
Get parent McSystem.
void incrementNAccept()
Increment the number of accepted moves.
bool notEnd() const
Is the current pointer not at the end of the PArray?
Utility classes for scientific computation.
void setBoltzmannVelocities(double temperature)
Set all velocities to Boltzmann distributed random values.
~HybridMdMove()
Destructor.
An McMove that acts on one McSystem.
Forward iterator for an Array or a C array.
double kineticEnergy() const
Compute and return total kinetic energy.
Forward iterator for a PArray.
Random & random()
Get Random number generator of parent Simulation.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
HybridMdMove(McSystem &system)
Constructor.
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.
void buildPairList()
Build the internal PairList.
void readProbability(std::istream &in)
Read the probability from file.
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.
bool metropolis(double ratio)
Metropolis algorithm for whether to accept a MC move.
A System for Molecular Dynamics simulation.
Simulation & simulation()
Get parent Simulation object.
virtual void step()=0
Take a complete MD integration step.
EnergyEnsemble & energyEnsemble()
Get EnergyEnsemble object of parent McSystem.
virtual void saveParameters(Serializable::OArchive &ar)
Save parameters to an archive, without configuration.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.