RDKit
Open-source cheminformatics and machine learning.
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 #include <RDGeneral/export.h>
13 #ifndef __RD_MMFFANGLEBEND_H__
14 #define __RD_MMFFANGLEBEND_H__
15 
16 #include <ForceField/ForceField.h>
17 #include <ForceField/Contrib.h>
18 
19 namespace ForceFields {
20 namespace MMFF {
21 class MMFFBond;
22 class MMFFAngle;
23 class MMFFProp;
24 
25 //! The angle-bend term for MMFF
27  public:
28  AngleBendContrib() : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1){};
29  //! Constructor
30  /*!
31  The angle is between atom1 - atom2 - atom3
32 
33  \param owner pointer to the owning ForceField
34  \param idx1 index of atom1 in the ForceField's positions
35  \param idx2 index of atom2 in the ForceField's positions
36  \param idx3 index of atom3 in the ForceField's positions
37  \param angleType MMFF type of the angle (as an unsigned int)
38 
39  */
40  AngleBendContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
41  unsigned int idx3, const MMFFAngle *mmffAngleParams,
42  const MMFFProp *mmffPropParamsCentralAtom);
43  double getEnergy(double *pos) const;
44  void getGrad(double *pos, double *grad) const;
45  virtual AngleBendContrib *copy() const {
46  return new AngleBendContrib(*this);
47  };
48 
49  private:
50  bool d_isLinear;
51  int d_at1Idx, d_at2Idx, d_at3Idx;
52  double d_ka, d_theta0;
53 };
54 namespace Utils {
55 //! returns the MMFF rest value for an angle
56 RDKIT_FORCEFIELD_EXPORT double calcAngleRestValue(const MMFFAngle *mmffAngleParams);
57 //! returns the MMFF force constant for an angle
58 RDKIT_FORCEFIELD_EXPORT double calcAngleForceConstant(const MMFFAngle *mmffAngleParams);
59 //! calculates and returns the cosine of the angle between points p1, p2, p3
61  double dist1, double dist2);
62 //! calculates and returns the angle bending MMFF energy
63 RDKIT_FORCEFIELD_EXPORT double calcAngleBendEnergy(const double theta0, const double ka, bool isLinear,
64  const double cosTheta);
65 RDKIT_FORCEFIELD_EXPORT void calcAngleBendGrad(RDGeom::Point3D *r, double *dist, double **g,
66  double &dE_dTheta, double &cosTheta, double &sinTheta);
67 }
68 }
69 }
70 #endif
RDKIT_FORCEFIELD_EXPORT 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
RDKIT_FORCEFIELD_EXPORT void calcAngleBendGrad(RDGeom::Point3D *r, double *dist, double **g, double &dE_dTheta, double &cosTheta, double &sinTheta)
class to store MMFF parameters for angle bending
Definition: MMFF/Params.h:111
The angle-bend term for MMFF.
virtual AngleBendContrib * copy() const
return a copy
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
RDKIT_FORCEFIELD_EXPORT double calcAngleRestValue(const MMFFAngle *mmffAngleParams)
returns the MMFF rest value for an angle
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:242
class to store MMFF parameters for bond stretching
Definition: MMFF/Params.h:87
RDKIT_FORCEFIELD_EXPORT double calcAngleBendEnergy(const double theta0, const double ka, bool isLinear, const double cosTheta)
calculates and returns the angle bending MMFF energy
A class to store forcefields and handle minimization.
Definition: ForceField.h:58
RDKIT_FORCEFIELD_EXPORT double calcAngleForceConstant(const MMFFAngle *mmffAngleParams)
returns the MMFF force constant for an angle
class to store MMFF Properties
Definition: MMFF/Params.h:60