RDKit
Open-source cheminformatics and machine learning.
StretchBend.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_MMFFSTRETCHBEND_H__
14 #define __RD_MMFFSTRETCHBEND_H__
15 
16 #include <utility>
17 #include <ForceField/Contrib.h>
18 
19 namespace ForceFields {
20 namespace MMFF {
21 class MMFFBond;
22 class MMFFAngle;
23 class MMFFStbn;
24 class MMFFProp;
25 
26 //! The angle-bend term for MMFF
28  public:
29  StretchBendContrib() : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1){};
30  //! Constructor
31  /*!
32  The angle is between atom1 - atom2 - atom3
33 
34  \param owner pointer to the owning ForceField
35  \param idx1 index of atom1 in the ForceField's positions
36  \param idx2 index of atom2 in the ForceField's positions
37  \param idx3 index of atom3 in the ForceField's positions
38  \param angleType MMFF type of the angle (as an unsigned int)
39 
40  */
41  StretchBendContrib(ForceField *owner, const unsigned int idx1,
42  const unsigned int idx2, const unsigned int idx3,
43  const MMFFStbn *mmffStbnParams,
44  const MMFFAngle *mmffAngleParams,
45  const MMFFBond *mmffBondParams1,
46  const MMFFBond *mmffBondParams2);
47 
48  double getEnergy(double *pos) const;
49  void getGrad(double *pos, double *grad) const;
50  virtual StretchBendContrib *copy() const {
51  return new StretchBendContrib(*this);
52  };
53 
54  private:
55  int d_at1Idx, d_at2Idx, d_at3Idx;
56  double d_restLen1, d_restLen2, d_theta0;
57  std::pair<double, double> d_forceConstants;
58 };
59 namespace Utils {
60 //! returns the std::pair of stretch-bend force constants for an angle
61 RDKIT_FORCEFIELD_EXPORT std::pair<double, double> calcStbnForceConstants(
62  const MMFFStbn *mmffStbnParams);
63 //! calculates and returns the stretch-bending MMFF energy
64 RDKIT_FORCEFIELD_EXPORT std::pair<double, double> calcStretchBendEnergy(
65  const double deltaDist1, const double deltaDist2, const double deltaTheta,
66  const std::pair<double, double> forceConstants);
67 }
68 }
69 }
70 #endif
class to store MMFF parameters for angle bending
Definition: MMFF/Params.h:111
RDKIT_FORCEFIELD_EXPORT std::pair< double, double > calcStretchBendEnergy(const double deltaDist1, const double deltaDist2, const double deltaTheta, const std::pair< double, double > forceConstants)
calculates and returns the stretch-bending MMFF energy
virtual StretchBendContrib * copy() const
return a copy
Definition: StretchBend.h:50
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:242
class to store MMFF parameters for stretch-bending
Definition: MMFF/Params.h:118
class to store MMFF parameters for bond stretching
Definition: MMFF/Params.h:87
The angle-bend term for MMFF.
Definition: StretchBend.h:27
A class to store forcefields and handle minimization.
Definition: ForceField.h:58
RDKIT_FORCEFIELD_EXPORT std::pair< double, double > calcStbnForceConstants(const MMFFStbn *mmffStbnParams)
returns the std::pair of stretch-bend force constants for an angle