8 #include "HomopolymerSemiGrandMove.h" 9 #include <mcMd/simulation/Simulation.h> 10 #include <mcMd/mcSimulation/McSystem.h> 12 #include <mcMd/potentials/pair/McPairPotential.h> 14 #include <mcMd/species/HomopolymerSG.h> 42 UTIL_THROW(
"Error: Species must be HomopolymerSG");
53 loadParameter<int>(ar,
"speciesId",
speciesId_);
86 int newStateId = (oldStateId == 0) ? 1 : 0;
93 #else // ifndef SIMP_NOPAIR 101 double ratio =
boltzmann(newEnergy - oldEnergy)*newWeight/oldWeight;
A System for use in a Markov chain Monte Carlo simulation.
void incrementNAttempt()
Increment the number of attempted moves.
virtual void save(Serializable::OArchive &ar)
Save state to an archive.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
double stateWeight(int stateId) const
Get the statistical weight for a specfic molecular state.
A Homopolymer with a mutable type, for semigrand ensemble.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
File containing preprocessor macros for error handling.
int moleculeStateId(const Molecule &molecule) const
Get the state id for a specific molecule.
virtual bool move()
Generate and accept or reject configuration bias move.
Saving / output archive for binary ostream.
double boltzmann(double energy)
Boltzmann weight associated with an energy difference.
virtual void readParameters(std::istream &in)
Read species to which displacement is applied.
#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.
virtual double moleculeEnergy(const Molecule &molecule) const =0
Calculate the nonbonded pair energy for an entire Molecule.
Utility classes for scientific computation.
An McMove that acts on one McSystem.
virtual void setMoleculeState(Molecule &molecule, int stateId)=0
Change the state of a specific molecule.
HomopolymerSemiGrandMove(McSystem &system)
Constructor.
HomopolymerSG * speciesPtr_
Pointer to instance of HomopolymerSG.
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.
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.
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).
McMd::SpeciesMutator & mutator()
Return the species mutator object by reference.
Species & species(int i)
Get a specific Species by reference.
int speciesId_
Integer index for molecular species.