8 #include "CfbRebridgeMove.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> 70 loadParameter<int>(ar,
"speciesId",
speciesId_);
71 loadParameter<int>(ar,
"nRegrow",
nRegrow_);
78 UTIL_THROW(
"Species is not a subclass of Linear");
113 int length, sign, beginId, endId, i;
115 double rosen_r, rosen_f;
116 double energy_r, energy_f;
123 length = molPtr->
nAtom();
137 if (
random().uniform(0.0, 1.0) > 0.5) {
147 thisPtr = &(molPtr->
atom(beginId));
149 oldPos_[i] = thisPtr->position();
155 for (i = 0; i < nRegrow_ + 1; ++i)
158 for (i = 0; i < nRegrow_ + 1; ++i)
159 bonds[i] = molPtr->
bond(endId - 1 + i).
typeId();
163 thisPtr = &(molPtr->
atom(endId));
164 deleteSequence(nRegrow_, sign, thisPtr, bonds, rosen_r, energy_r);
167 thisPtr = &(molPtr->
atom(beginId));
168 addSequence(nRegrow_, sign, thisPtr, bonds, rosen_f, energy_f);
185 thisPtr = &(molPtr->
atom(beginId));
188 thisPtr->position() =
oldPos_[i];
virtual void setup()
Initialize the arrays for preferential angle, effective spring constant and normalization factor...
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 loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
void incrementNAttempt()
Increment the number of attempted moves.
CfbRebridgeMove(McSystem &system)
Constructor.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
virtual void readParameters(std::istream &in)
Read species type, nTrial, and parameters needed to evaluate the orientation bias.
int typeId() const
Get the typeId for this covalent group.
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.
Base class configuration bias moves internal segment regrowth moves.
virtual void readParameters(std::istream &in)
Read species to which displacement is applied.
Saving / output archive for binary ostream.
void addSequence(int nActive, int sign, Atom *beginPtr, int *bonds, double &rosenbluth, double &energy)
Configuration bias algorithm for adding a consequtive sequence of atoms.
#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.
int speciesId_
Integer index for molecular species.
A point particle within a Molecule.
Utility classes for scientific computation.
long uniformInt(long range1, long range2)
Return random long int x uniformly distributed in range1 <= x < range2.
Random & random()
Get Random number generator of parent Simulation.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
void deleteSequence(int nActive, int sign, Atom *endPtr, int *bonds, double &rosenbluth, double &energy)
Configuration bias algorithm for deleting a consequtive sequence of atoms.
Saving archive for binary istream.
int nRegrow_
Number of particles at end to attempt to regrow.
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.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Simulation & simulation()
Get parent Simulation object.
A physical molecule (a set of covalently bonded Atoms).
DArray< Vector > oldPos_
Array of old positions of temporarily deleted atoms.
virtual bool move()
Generate and accept or reject configuration bias move.
Species & species(int i)
Get a specific Species by reference.
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.