8 #include "RigidDisplaceMove.h" 9 #include <mcMd/simulation/Simulation.h> 10 #include <mcMd/mcSimulation/McSystem.h> 12 #include <mcMd/chemistry/Molecule.h> 13 #include <mcMd/chemistry/Atom.h> 15 #include <simp/species/Species.h> 16 #include <simp/boundary/Boundary.h> 18 #include <util/space/Dimension.h> 42 read<int>(in,
"speciesId", speciesId_);
43 read<double>(in,
"delta", delta_);
47 oldPositions_.allocate(nAtom_);
56 loadParameter<int>(ar,
"speciesId", speciesId_);
57 loadParameter<double>(ar,
"delta", delta_);
62 oldPositions_.allocate(nAtom_);
82 double newEnergy, oldEnergy;
95 for (iAtom = 0; iAtom < nAtom_; ++iAtom) {
96 atomPtr = &molPtr->
atom(iAtom);
97 oldPositions_[iAtom] = atomPtr->
position();
102 if (
system().hasExternalPotential()) {
107 oldEnergy +=
system().atomTetherEnergy(*atomPtr);
118 for (iAtom = 0; iAtom < nAtom_; ++iAtom) {
119 atomPtr = &molPtr->
atom(iAtom);
126 if (
system().hasExternalPotential()) {
131 newEnergy +=
system().atomTetherEnergy(*atomPtr);
142 for (iAtom = 0; iAtom < nAtom_; ++iAtom) {
152 for (iAtom = 0; iAtom < nAtom_; ++iAtom) {
const int Dimension
Dimensionality of space.
A System for use in a Markov chain Monte Carlo simulation.
A Vector is a Cartesian vector.
virtual double atomEnergy(const Atom &atom) const =0
Calculate the external energy for one Atom.
void incrementNAttempt()
Increment the number of attempted moves.
int nAtom() const
Get number of atoms per molecule for this Species.
Include this file to include all MC potential energy classes at once.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
double uniform()
Return a random floating point number x, uniformly distributed in the range 0 <= x < 1...
Blank & readBlank(std::istream &in)
Add and read a new Blank object, representing a blank line.
virtual 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.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
McSystem & system()
Get parent McSystem.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Molecule & randomMolecule(int speciesId)
Get a random Molecule of a specified species in this System.
void incrementNAccept()
Increment the number of accepted moves.
ExternalPotential & externalPotential() const
Return ExternalPotential by reference.
A point particle within a Molecule.
Utility classes for scientific computation.
An McMove that acts on one McSystem.
void shift(Vector &r) const
Shift Cartesian Vector r to its primary image.
Random & random()
Get Random number generator of parent Simulation.
RigidDisplaceMove(McSystem &system)
Constructor.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void readProbability(std::istream &in)
Read the probability from file.
void setClassName(const char *className)
Set class name string.
const Atom & atom(int localId) const
Get a specific Atom in this Molecule.
bool metropolis(double ratio)
Metropolis algorithm for whether to accept a MC move.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
Simulation & simulation()
Get parent Simulation object.
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.
void updateAtomCell(Atom &atom)
Update the cell list to reflect a new position.
virtual double atomEnergy(const Atom &atom) const =0
Calculate the nonbonded pair energy for one Atom.
Boundary & boundary()
Get Boundary object of parent McSystem.
virtual void readParameters(std::istream &in)
Read species to which displacement is applied.