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