8 #include "CfbEndMove.h" 9 #include <mcMd/mcSimulation/McSystem.h> 10 #include <mcMd/simulation/Simulation.h> 11 #include <mcMd/chemistry/Molecule.h> 12 #include <mcMd/chemistry/Bond.h> 13 #include <mcMd/chemistry/Atom.h> 15 #include <mcMd/potentials/pair/McPairPotential.h> 17 #include <simp/species/Linear.h> 18 #include <simp/boundary/Boundary.h> 45 read<int>(in,
"nTrial",
nTrial_);
54 UTIL_THROW(
"Species is not a subclass of Linear");
68 loadParameter<int>(ar,
"speciesId",
speciesId_);
69 loadParameter<int>(ar,
"nRegrow",
nRegrow_);
70 loadParameter<int>(ar,
"nTrial",
nTrial_);
79 UTIL_THROW(
"Species is not a subclass of Linear");
102 double rosenbluth, rosen_r, rosen_f;
103 double energy, energy_r, energy_f;
107 int length, sign, beginId, endId, bondType, i;
114 length = molPtr->
nAtom();
122 if (
random().uniform(0.0, 1.0) > 0.5) {
133 endPtr = &(molPtr->
atom(beginId));
142 endPtr = &(molPtr->
atom(endId));
144 pvtPtr = endPtr - sign;
146 bondType = molPtr->
bond(endId - 1 - i).
typeId();
154 rosen_r *= rosenbluth;
162 endPtr = &(molPtr->
atom(beginId));
164 pvtPtr = endPtr - sign;
166 bondType = molPtr->
bond(endId - 1 - i).
typeId();
170 addEndAtom(endPtr, pvtPtr, bondType, rosenbluth, energy);
171 rosen_f *= rosenbluth;
194 endPtr = &(molPtr->
atom(beginId));
static const int MaxTrial_
Maximum allowed number of trial positions for a regrown atom.
Bond & bond(int localId)
Get a specific Bond in this Molecule by non-const reference.
A System for use in a Markov chain Monte Carlo simulation.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
void addEndAtom(Atom *endPtr, Atom *pvtPtr, int bondType, double &rosenbluth, double &energy)
Configuration bias algorithm for adding an atom to a chain end.
virtual void readParameters(std::istream &in)
Read species to which displacement is applied.
void incrementNAttempt()
Increment the number of attempted moves.
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.
int typeId() const
Get the typeId for this covalent group.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
CfbEndMove(McSystem &system)
Constructor.
File containing preprocessor macros for error handling.
virtual bool move()
Generate and accept or reject configuration bias move.
Classes used by all simpatico molecular simulations.
DArray< Vector > oldPos_
Array of old positions of temporarily deleted atoms (temporary).
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.
int speciesId_
Integer index for molecular species.
Molecule & randomMolecule(int speciesId)
Get a random Molecule of a specified species in this System.
void incrementNAccept()
Increment the number of accepted moves.
A point particle within a Molecule.
Utility classes for scientific computation.
Random & random()
Get Random number generator of parent Simulation.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
void deleteEndAtom(Atom *endPtr, Atom *pvtPtr, int bondType, double &rosenbluth, double &energy)
CFB algorithm for deleting an end atom from a flexible chain.
Saving archive for binary istream.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
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.
int nTrial_
Actual number of trial positions for each regrown atom.
bool metropolis(double ratio)
Metropolis algorithm for whether to accept a MC move.
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.
Base class for configuration bias (CFB) end regrowth moves.
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.
A Species of linear polymers (abstract).
int nAtom() const
Get the number of Atoms in this Molecule.