1 #ifndef SIMP_COSINE_ANGLE_H 2 #define SIMP_COSINE_ANGLE_H 12 #include <util/space/Vector.h> 13 #include <util/param/ParamComposite.h> 16 namespace Util{
class Random;}
97 void set(std::string name,
int type,
double value);
105 double energy(
double cosTheta,
int type)
const;
161 double get(std::string name,
int type)
const;
171 static const int MaxNAngleType = 4;
173 double kappa_[MaxNAngleType];
184 {
return kappa_[type]*(1.0-cosTheta); }
198 double r1 = R1.
abs();
199 double r2 = R2.
abs();
204 cosTheta = u1.
dot(u2);
208 F1 *= kappa_[type]/r1;
212 F2 *= kappa_[type]/r2;
std::string className() const
Return name string "CosineAngle" for this evaluator class.
CosineAngle & operator=(const CosineAngle &other)
Assignment.
A Vector is a Cartesian vector.
void setNAngleType(int nAngleType)
Set the number of angle types.
double randomAngle(Random *random, double beta, int type) const
Return bond angle chosen from equilibrium distribution.
double dot(const Vector &v) const
Return dot product of this vector and vector v.
Vector & multiply(const Vector &v, double s)
Multiply a vector v by a scalar s.
A three body angle potential, as a function of angle cosine.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
void force(const Vector &R1, const Vector &R2, Vector &F1, Vector &F2, int type) const
Returns angle forces.
double energy(double cosTheta, int type) const
Returns potential energy for one angle.
Saving / output archive for binary ostream.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
Utility classes for scientific computation.
double randomCosineAngle(Random *random, double beta, int type) const
Return bond angle cosine chosen from equilibrium distribution.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
~CosineAngle()
Destructor.
Saving archive for binary istream.
CosineAngle()
Default constructor.
double abs() const
Return absolute magnitude of this vector.
void readParameters(std::istream &in)
Read angle interaction parameters from input stream.
An object that can read multiple parameters from file.