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