1 #ifndef SIMP_MULTI_HARMONIC_DIHEDRAL_H 2 #define SIMP_MULTI_HARMONIC_DIHEDRAL_H 11 #include <util/param/ParamComposite.h> 12 #include <util/containers/DArray.h> 13 #include <util/space/Vector.h> 14 #include <simp/interaction/dihedral/Torsion.h> 15 #include <simp/interaction/dihedral/TorsionForce.h> 104 void set(std::string name,
int type,
double value);
145 double get(std::string name,
int type)
const;
181 a2 = 2.0*k2 - 8.0*k4;
207 const Vector& b3,
int type)
const 213 double c = torsion.
cosPhi;
214 const Parameter* p = ¶meters_[type];
215 return (p->a0 + c*(p->a1 + c*(p->a2 + c*(p->a3 + c*p->a4))));
238 double c = torsion.
cosPhi;
239 const Parameter* p = ¶meters_[type];
240 double dEdC = p->a1 + c*(p->g2 + c*(p->g3 + c*p->g4));
Vector d1
Vector of derivatives d1[i] = d(cosPhi)/d(b1[i])
Vector & zero()
Set all elements of a 3D vector to zero.
A Vector is a Cartesian vector.
bool computeDerivatives(const Vector &b1, const Vector &b2, const Vector &b3)
Compute cosPhi and derivatives.
double cosPhi
Cosine of dihedral angle.
Vector & multiply(const Vector &v, double s)
Multiply a vector v by a scalar s.
double energy(const Vector &b1, const Vector &b2, const Vector &b3, int type) const
Returns potential energy for one dihedral group.
void setNDihedralType(int nDihedralType)
Set the number of dihedral types.
File containing preprocessor macros for error handling.
Classes used by all simpatico molecular simulations.
void readParameters(std::istream &in)
Read dihedral interaction parameters from input stream.
Saving / output archive for binary ostream.
std::string className() const
Return name string "MultiHarmonicDihedral".
Utility classes for scientific computation.
A truncated Fourier series dihedral potential.
Computes derivatives of dihedral angle with respect to bond vectors.
Vector d2
Vector of derivatives d2[i] = d(cosPhi)/d(b2[i])
void force(const Vector &b1, const Vector &b2, const Vector &b3, Vector &f1, Vector &f2, Vector &f3, int type) const
Returns derivatives of energy with respect to bond vectors forming the dihedral group.
Vector d3
Vector of derivatives d3[i] = d(cosPhi)/d(b3[i])
Dynamically allocatable contiguous array template.
Saving archive for binary istream.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
MultiHarmonicDihedral & operator=(const MultiHarmonicDihedral &other)
Assignment.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
bool computeAngle(const Vector &b1, const Vector &b2, const Vector &b3)
Compute cosPhi.
Computes dihedral / torsion angle involving 3 bonds.
void writeParam(std::ostream &out)
Write Fourier coefficients to output stream.
An object that can read multiple parameters from file.
MultiHarmonicDihedral()
Default constructor.