RDKit
Open-source cheminformatics and machine learning.
MMFF/TorsionAngle.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_MMFFTORSIONANGLE_H__
14 #define __RD_MMFFTORSIONANGLE_H__
15 
16 #include <ForceField/Contrib.h>
17 #include <boost/tuple/tuple.hpp>
18 
19 namespace RDGeom {
20 class Point3D;
21 }
22 
23 namespace ForceFields {
24 namespace MMFF {
25 class MMFFTor;
26 
27 //! the torsion term for MMFF
29  public:
31  : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1), d_at4Idx(-1){};
32  //! Constructor
33  /*!
34  The torsion is between atom1 - atom2 - atom3 - atom4
35  (i.e the angle between bond atom1-atom2 and bond atom3-atom4
36  while looking down bond atom2-atom3)
37 
38  \param owner pointer to the owning ForceField
39  \param idx1 index of atom1 in the ForceField's positions
40  \param idx2 index of atom2 in the ForceField's positions
41  \param idx3 index of atom3 in the ForceField's positions
42  \param idx4 index of atom4 in the ForceField's positions
43  \param torsionType MMFF type of the torsional bond between atoms 2 and 3
44  */
45  TorsionAngleContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
46  unsigned int idx3, unsigned int idx4,
47  const MMFFTor *mmffTorParams);
48  double getEnergy(double *pos) const;
49  void getGrad(double *pos, double *grad) const;
50  virtual TorsionAngleContrib *copy() const {
51  return new TorsionAngleContrib(*this);
52  };
53 
54  private:
55  int d_at1Idx, d_at2Idx, d_at3Idx, d_at4Idx;
56  double d_V1, d_V2, d_V3;
57 };
58 
59 namespace Utils {
60 //! calculates and returns the cosine of a torsion angle
62  const RDGeom::Point3D &jPoint,
63  const RDGeom::Point3D &kPoint,
64  const RDGeom::Point3D &lPoint);
65 //! returns the 3-tuple of a torsion angle force constants
66 RDKIT_FORCEFIELD_EXPORT boost::tuple<double, double, double> calcTorsionForceConstant(
67  const MMFFTor *mmffTorParams);
68 //! calculates and returns the torsional MMFF energy
69 RDKIT_FORCEFIELD_EXPORT double calcTorsionEnergy(const double V1, const double V2, const double V3,
70  const double cosPhi);
72  double **g, double &sinTerm, double &cosPhi);
73 }
74 }
75 }
76 #endif
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
RDKIT_FORCEFIELD_EXPORT double calcTorsionCosPhi(const RDGeom::Point3D &iPoint, const RDGeom::Point3D &jPoint, const RDGeom::Point3D &kPoint, const RDGeom::Point3D &lPoint)
calculates and returns the cosine of a torsion angle
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:242
RDKIT_FORCEFIELD_EXPORT double calcTorsionEnergy(const double V1, const double V2, const double V3, const double cosPhi)
calculates and returns the torsional MMFF energy
RDKIT_FORCEFIELD_EXPORT boost::tuple< double, double, double > calcTorsionForceConstant(const MMFFTor *mmffTorParams)
returns the 3-tuple of a torsion angle force constants
RDKIT_FORCEFIELD_EXPORT void calcTorsionGrad(RDGeom::Point3D *r, RDGeom::Point3D *t, double *d, double **g, double &sinTerm, double &cosPhi)
virtual TorsionAngleContrib * copy() const
return a copy
class to store MMFF parameters for torsions
Definition: MMFF/Params.h:131
A class to store forcefields and handle minimization.
Definition: ForceField.h:58