RDKit: AngleBend.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MMFF/AngleBend.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2013 Paolo Tosco
3 //
4 // Copyright (C) 2004-2006 Rational Discovery LLC
5 //
6 // @@ All Rights Reserved @@
7 // This file is part of the RDKit.
8 // The contents are covered by the terms of the BSD license
9 // which is included in the file license.txt, found at the root
10 // of the RDKit source tree.
11 //
12 #ifndef __RD_MMFFANGLEBEND_H__
13 #define __RD_MMFFANGLEBEND_H__
14
15 #include <ForceField/ForceField.h>
16 #include <ForceField/Contrib.h>
17
18 namespace ForceFields {
19 namespace MMFF {
20 class MMFFBond;
21 class MMFFAngle;
22 class MMFFProp;
23
24 //! The angle-bend term for MMFF
25 class AngleBendContrib : public ForceFieldContrib {
26 public:
27 AngleBendContrib() : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1){};
28 //! Constructor
29 /*!
30 The angle is between atom1 - atom2 - atom3
31
32 \param owner pointer to the owning ForceField
33 \param idx1 index of atom1 in the ForceField's positions
34 \param idx2 index of atom2 in the ForceField's positions
35 \param idx3 index of atom3 in the ForceField's positions
36 \param angleType MMFF type of the angle (as an unsigned int)
37
38 */
39 AngleBendContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
40 unsigned int idx3, const MMFFAngle *mmffAngleParams,
41 const MMFFProp *mmffPropParamsCentralAtom);
42 double getEnergy(double *pos) const;
43 void getGrad(double *pos, double *grad) const;
44 virtual AngleBendContrib *copy() const {
45 return new AngleBendContrib(*this);
46 };
47
48 private:
49 bool d_isLinear;
50 int d_at1Idx, d_at2Idx, d_at3Idx;
51 double d_ka, d_theta0;
52 };
53 namespace Utils {
54 //! returns the MMFF rest value for an angle
55 double calcAngleRestValue(const MMFFAngle *mmffAngleParams);
56 //! returns the MMFF force constant for an angle
57 double calcAngleForceConstant(const MMFFAngle *mmffAngleParams);
58 //! calculates and returns the cosine of the angle between points p1, p2, p3
59 double calcCosTheta(RDGeom::Point3D p1, RDGeom::Point3D p2, RDGeom::Point3D p3,
60 double dist1, double dist2);
61 //! calculates and returns the angle bending MMFF energy
62 double calcAngleBendEnergy(const double theta0, const double ka, bool isLinear,
63 const double cosTheta);
64 void calcAngleBendGrad(RDGeom::Point3D *r, double *dist, double **g,
65 double &dE_dTheta, double &cosTheta, double &sinTheta);
66 }
67 }
68 }
69 #endif
ForceFields::MMFF::AngleBendContrib::copy
virtual AngleBendContrib * copy() const
return a copy
Definition: MMFF/AngleBend.h:44
ForceFields::MMFF::MMFFAngle
class to store MMFF parameters for angle bending
Definition: MMFF/Params.h:110
ForceField.h
ForceFields::MMFF::AngleBendContrib
The angle-bend term for MMFF.
Definition: MMFF/AngleBend.h:25
ForceFields::MMFF::AngleBendContrib::getEnergy
double getEnergy(double *pos) const
returns our contribution to the energy of a position
ForceFields::ForceFieldContrib
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
ForceFields::MMFF::Utils::calcAngleRestValue
double calcAngleRestValue(const MMFFAngle *mmffAngleParams)
returns the MMFF rest value for an angle
ForceFields::MMFF::Utils::calcAngleBendEnergy
double calcAngleBendEnergy(const double theta0, const double ka, bool isLinear, const double cosTheta)
calculates and returns the angle bending MMFF energy
ForceFields::MMFF::Utils::calcAngleForceConstant
double calcAngleForceConstant(const MMFFAngle *mmffAngleParams)
returns the MMFF force constant for an angle
Contrib.h
ForceFields
Definition: TorsionAngleM6.h:23
ForceFields::MMFF::AngleBendContrib::getGrad
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
ForceFields::MMFF::MMFFBond
class to store MMFF parameters for bond stretching
Definition: MMFF/Params.h:86
RDGeom::Point3D
Definition: point.h:45
ForceFields::MMFF::Utils::calcCosTheta
double calcCosTheta(RDGeom::Point3D p1, RDGeom::Point3D p2, RDGeom::Point3D p3, double dist1, double dist2)
calculates and returns the cosine of the angle between points p1, p2, p3
ForceFields::MMFF::AngleBendContrib::AngleBendContrib
AngleBendContrib()
Definition: MMFF/AngleBend.h:27
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition: ForceField.h:57
ForceFields::MMFF::Utils::calcAngleBendGrad
void calcAngleBendGrad(RDGeom::Point3D *r, double *dist, double **g, double &dE_dTheta, double &cosTheta, double &sinTheta)
ForceFields::MMFF::MMFFProp
class to store MMFF Properties
Definition: MMFF/Params.h:59