1 #ifndef SIMP_HARMONIC_BOND_H 2 #define SIMP_HARMONIC_BOND_H 12 #include <util/param/ParamComposite.h> 14 #include <util/random/Random.h> 97 double energy(
double rSq,
int type)
const;
108 double forceOverR(
double rSq,
int type)
const;
132 void set(std::string name,
int type,
double value);
140 double get(std::string name,
int type)
const;
147 double kappa(
int type)
const;
154 double length(
int type)
const;
159 static const int MaxNBondType = 8;
161 double kappa_[MaxNBondType];
162 double length_[MaxNBondType];
175 assert(type < nBondType_);
184 assert(type < nBondType_);
185 return length_[type];
193 double dl = sqrt(rSq) - length_[type];
194 return 0.5*kappa_[type]*dl*dl;
203 double r = sqrt(rSq);
204 double dl = length_[type] - r;
205 return kappa_[type]*dl/r;
double forceOverR(double rSq, int type) const
Returns force/distance for one bond, for use in MD.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
double kappa(int type) const
Returns bond spring constant kappa.
Saving / output archive for binary ostream.
double energy(double rSq, int type) const
Returns potential energy for one bond.
double length(int type) const
Returns equilibrium bond length.
void setNBondType(int nBondType)
Set the number of bond types.
Utility classes for scientific computation.
HarmonicBond()
Default constructor.
HarmonicBond & operator=(const HarmonicBond &other)
Assignment.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Saving archive for binary istream.
double randomBondLength(Random *random, double beta, int type) const
Return bond length chosen from equilibrium distribution.
A harmonic covalent bond potential.
An object that can read multiple parameters from file.
void readParameters(std::istream &in)
Read bond interaction parameters from input stream.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.