8 #include "CfbLinearEndMove.h" 9 #include <mcMd/mcSimulation/McSystem.h> 10 #include <mcMd/simulation/Simulation.h> 12 #include <mcMd/potentials/pair/McPairPotential.h> 14 #include <mcMd/chemistry/Molecule.h> 15 #include <mcMd/chemistry/Bond.h> 16 #include <mcMd/chemistry/Atom.h> 17 #include <simp/species/Linear.h> 18 #include <simp/boundary/Boundary.h> 66 loadParameter<int>(ar,
"nRegrow",
nRegrow_);
96 double rosenbluth, rosen_r, rosen_f;
97 double energy, energy_r, energy_f;
101 int nAtom, sign, beginId, endId, atomId, i;
108 nAtom = molPtr->
nAtom();
116 if (
random().uniform(0.0, 1.0) > 0.5) {
138 deleteAtom(*molPtr, atomId, sign, rosenbluth, energy);
143 rosen_r *= rosenbluth;
147 assert(atomId == beginId - sign);
154 atom0Ptr = &molPtr->
atom(atomId);
155 atom1Ptr = atom0Ptr - sign;
156 addAtom(*molPtr, *atom0Ptr, *atom1Ptr, atomId, sign,
158 rosen_f *= rosenbluth;
166 assert(atomId == endId + sign);
178 atom0Ptr = &(molPtr->
atom(atomId));
A System for use in a Markov chain Monte Carlo simulation.
void addAtom(Molecule &molecule, Atom &atom0, Atom &atom1, int atomId, int sign, double &rosenbluth, double &energy)
Configuration bias algorithm for adding an atom to a Linear molecule.
void incrementNAttempt()
Increment the number of attempted moves.
int nAtom() const
Get number of atoms per molecule for this Species.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
void addAtom(Atom &atom)
Add an Atom to the CellList.
int nRegrow_
Number of particles at end to attempt to regrow.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
virtual void save(Serializable::OArchive &ar)
Save speciesId and nTrial.
DArray< Vector > oldPos_
Array of old positions of temporarily deleted atoms (temporary).
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
virtual void readParameters(std::istream &in)
Read and validate speciesId and nTrial.
Base class for configuration bias (CFB) end regrowth moves.
Saving / output archive for binary ostream.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
McSystem & system()
Get parent McSystem.
Molecule & randomMolecule(int speciesId)
Get a random Molecule of a specified species in this System.
void incrementNAccept()
Increment the number of accepted moves.
Simulation & simulation() const
Get the parent Simulation by reference.
virtual bool move()
Generate and accept or reject configuration bias move.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
A point particle within a Molecule.
Utility classes for scientific computation.
virtual void readParameters(std::istream &in)
Read parameters from file.
int speciesId() const
Get speciesId.
Random & random()
Get Random number generator of parent Simulation.
virtual void loadParameters(Serializable::IArchive &ar)
Load and validate speciesId and nTrial.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
void deleteAtom(Molecule &molecule, int atomId, int sign, double &rosenbluth, double &energy)
CFB algorithm for deleting an end atom from a Linear molecule.
CfbLinearEndMove(McSystem &system)
Constructor.
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.
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 deleteAtom(Atom &atom)
Remove an Atom from the CellList.
void updateAtomCell(Atom &atom)
Update the cell list to reflect a new position.
int nAtom() const
Get the number of Atoms in this Molecule.