1 #ifndef SIMP_HARMONIC_ANGLE_H 2 #define SIMP_HARMONIC_ANGLE_H 11 #include <util/param/ParamComposite.h> 12 #include <simp/interaction/angle/BendForce.h> 16 namespace Util {
class Random;}
97 void set(std::string name,
int type,
double value);
105 double energy(
double cosTheta,
int type)
const;
160 double get(std::string name,
int type)
const;
170 static const int MaxNAngleType = 4;
172 double kappa_[MaxNAngleType];
173 double theta0_[MaxNAngleType];
185 double dTheta = std::acos(cosTheta) - theta0_[type];
186 return 0.5*kappa_[type]*dTheta*dTheta;
203 double factor = kappa_[type]*(theta0_[type] - bend.
theta())/s;
Vector d2
Vector of derivatives d2[i] = d(cosTheta)/d(b2[i])
Vector & zero()
Set all elements of a 3D vector to zero.
A BendForce computes derivatives of the angle between two vectors.
A Vector is a Cartesian vector.
Vector d1
Vector of derivatives d1[i] = d(cosTheta)/d(b1[i])
Vector & multiply(const Vector &v, double s)
Multiply a vector v by a scalar s.
void readParameters(std::istream &in)
Read angle interaction parameters from input stream.
HarmonicAngle & operator=(const HarmonicAngle &other)
Assignment.
double randomCosineAngle(Random *random, double beta, int type) const
Return bond angle cosine chosen from equilibrium distribution.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
A angle potential that is harmonic in the angle.
HarmonicAngle()
Default constructor.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
Saving / output archive for binary ostream.
void computeDerivatives(const Vector &b1, const Vector &b2)
Compute cosTheta and its derivatives d1 and d2.
double energy(double cosTheta, int type) const
Returns potential energy for one angle.
Utility classes for scientific computation.
double randomAngle(Random *random, double beta, int type) const
Return bond angle chosen from equilibrium distribution.
double sinTheta() const
Return value of sin(theta) for precomputed cos(theta).
Saving archive for binary istream.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
void force(const Vector &b1, const Vector &b2, Vector &F1, Vector &F2, int type) const
Compute angle forces.
std::string className() const
Return name string "HarmonicAngle" for this evaluator class.
void setNAngleType(int nAngleType)
Set the number of angle types.
An object that can read multiple parameters from file.
double theta() const
Return value of theta in radians for precomputed cos(theta).