8 #include "RingOctaRebridgeMove.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/Ring.h> 18 #include <simp/boundary/Boundary.h> 62 loadParameter<int>(ar,
"speciesId",
speciesId_);
101 int nAtom, im, in, molId2;
109 nAtom = molPtr1->
nAtom();
116 if (!found)
return false;
119 mPtr = &(molPtr1->
atom(im));
121 nPtr = &(molPtr2->
atom(in));
180 Vector aPos, bPos, cPos, dPos, mPos, nPos;
181 int nAtom, ia, ib, ic, id, dmn, dnm;
182 int nNeighbor, j, *idList, *molIdList;
183 int molId1, choice, nGroup;
184 double lenSq, minSq, maxSq;
185 bool validIndex, found;
188 nAtom = molPtr1->
nAtom();
191 ia =
modId(im-1, nAtom);
192 ib =
modId(im+1, nAtom);
205 if (lenSq >= maxSq || lenSq <= minSq) {
213 if (lenSq >= maxSq || lenSq <= minSq) {
223 idList =
new int[nNeighbor];
224 molIdList =
new int[nNeighbor];
228 molId1 = molPtr1->
id();
229 for (j = 0; j < nNeighbor; ++j) {
236 if (molId2 == molId1) {
239 if (dmn < 0) dmn += nAtom;
242 if (dnm < 0) dnm += nAtom;
244 if (dmn <= 2 && dnm <= 2) validIndex =
false;
254 ic =
modId(in-1, nAtom);
255 id =
modId(in+1, nAtom);
263 if (lenSq > minSq && lenSq < maxSq) {
266 if (lenSq > minSq && lenSq < maxSq) {
269 if (lenSq > minSq && lenSq < maxSq) {
272 if (lenSq > minSq && lenSq < maxSq) {
275 if (lenSq > minSq && lenSq < maxSq) {
278 if (lenSq > minSq && lenSq < maxSq) {
281 molIdList[nGroup] = molId2;
295 molId2 = molIdList[choice];
int speciesId_
Integer index for molecular species.
Molecule & molecule() const
Get the parent Molecule by reference.
A System for use in a Markov chain Monte Carlo simulation.
A Vector is a Cartesian vector.
void incrementNAttempt()
Increment the number of attempted moves.
void getNeighbors(const Vector &pos, NeighborArray &neighbors) const
Fill a NeighborArray with pointers to atoms near a specified position.
double distanceSq(const Vector &r1, const Vector &r2) const
Return square distance between positions r1 and r2.
const CellList & cellList() const
Get the cellList by const reference.
double lowerBridge_
Lower bounds for trial length of a bridge.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
double atomPotentialEnergy(const Atom &atom) const
Calculate the total potential energy for one Atom.
Species & species() const
Get the molecular Species by reference.
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.
int id() const
Get the index for this Molecule (unique in species).
double upperBridge_
Upper bounds for trial length of a bridge.
virtual void save(Serializable::OArchive &ar)
Save state to an archive.
A Species of ring polymers (abstract).
Saving / output archive for binary ostream.
Molecule & molecule(int speciesId, int moleculeId)
Get a specific Molecule in this System, by integer index.
double boltzmann(double energy)
Boltzmann weight associated with an energy difference.
bool scanBridge(Molecule *molPtr, int mId, int &molId2, int &nId)
Scan potential rebridging sites.
#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.
A point particle within a Molecule.
Utility classes for scientific computation.
int modId(int id, int n)
Shift Atom index along a Ring.
long uniformInt(long range1, long range2)
Return random long int x uniformly distributed in range1 <= x < range2.
CellList::NeighborArray neighbors_
Neighbor list around test atom.
Random & random()
Get Random number generator of parent Simulation.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
virtual void loadParameters(Serializable::IArchive &ar)
Load state from an archive.
int id() const
Get integer id of this Species.
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.
int indexInMolecule() const
Get local index for this Atom within the parent molecule;.
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.
virtual bool move()
Generate and accept or reject configuration bias move.
Species & species(int i)
Get a specific Species by reference.
int size() const
Return logical size of this array (i.e., number of elements).
void updateAtomCell(Atom &atom)
Update the cell list to reflect a new position.
int nAtom() const
Get the number of Atoms in this Molecule.
Boundary & boundary()
Get Boundary object of parent McSystem.
RingOctaRebridgeMove(McSystem &system)
Constructor.
virtual void readParameters(std::istream &in)
Read species to which displacement is applied.
Base class for rebridging a group of atoms forming a tetrahedron.