1 #ifndef SIMP_FENE_BOND_H 2 #define SIMP_FENE_BOND_H 12 #include <util/param/ParamComposite.h> 13 #include <util/random/Random.h> 103 void set(std::string name,
int type,
double value);
111 double energy(
double rSq,
int type)
const;
122 double forceOverR(
double rSq,
int type)
const;
145 double get(std::string name,
int type)
const;
150 static const int MaxNBondType = 2;
153 double kappa_[MaxNBondType];
156 double r0_[MaxNBondType];
159 double r0Sq_[MaxNBondType];
162 double r0SqInv_[MaxNBondType];
165 double ce_[MaxNBondType];
168 double rlSq_[MaxNBondType];
171 double rl_[MaxNBondType];
174 double energyCutoff_[MaxNBondType];
194 if (rSq < rlSq_[type]){
195 double g = 1.0 - rSq*r0SqInv_[type];
196 return ce_[type]*log(g);
199 return energyCutoff_[type] + forceCutoff_*(sqrt(rSq) - rl_[type]);
209 if (rSq < rlSq_[type]){
210 double g = 1.0 - rSq*r0SqInv_[type];
211 return -kappa_[type]/g;
213 if (rSq > r0Sq_[type]) {
214 std::cout <<
"Warning: Long FENE bond: Rsq = " << rSq << std::endl;
217 return -forceCutoff_/sqrt(rSq);
void readParameters(std::istream &in)
Read bond interaction parameters from input stream.
double energy(double rSq, int type) const
Returns potential energy for one bond.
A finitely-extensible nonlinear element (FENE) bond potential.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
void setNBondType(int nBondType)
Set the number of bond types.
Saving / output archive for binary ostream.
Utility classes for scientific computation.
double randomBondLength(Random *random, double beta, int type) const
Return bond length chosen from equilibrium distribution.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
double forceOverR(double rSq, int type) const
Returns force/distance for one bond, for use in MD.
Saving archive for binary istream.
FeneBond()
Default constructor.
FeneBond & operator=(const FeneBond &other)
Assignment.
An object that can read multiple parameters from file.