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 #ifndef __RD_MMFFSTRETCHBEND_H__
13 #define __RD_MMFFSTRETCHBEND_H__
14 
15 #include <utility>
16 #include <ForceField/Contrib.h>
17 
18 namespace ForceFields {
19 namespace MMFF {
20 class MMFFBond;
21 class MMFFAngle;
22 class MMFFStbn;
23 class MMFFProp;
24 
25 //! The angle-bend term for MMFF
27  public:
28  StretchBendContrib() : 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  StretchBendContrib(ForceField *owner, const unsigned int idx1,
41  const unsigned int idx2, const unsigned int idx3,
42  const MMFFStbn *mmffStbnParams,
43  const MMFFAngle *mmffAngleParams,
44  const MMFFBond *mmffBondParams1,
45  const MMFFBond *mmffBondParams2);
46 
47  double getEnergy(double *pos) const;
48  void getGrad(double *pos, double *grad) const;
49  virtual StretchBendContrib *copy() const {
50  return new StretchBendContrib(*this);
51  };
52 
53  private:
54  int d_at1Idx, d_at2Idx, d_at3Idx;
55  double d_restLen1, d_restLen2, d_theta0;
56  std::pair<double, double> d_forceConstants;
57 };
58 namespace Utils {
59 //! returns the std::pair of stretch-bend force constants for an angle
60 std::pair<double, double> calcStbnForceConstants(
61  const MMFFStbn *mmffStbnParams);
62 //! calculates and returns the stretch-bending MMFF energy
63 std::pair<double, double> calcStretchBendEnergy(
64  const double deltaDist1, const double deltaDist2, const double deltaTheta,
65  const std::pair<double, double> forceConstants);
66 }
67 }
68 }
69 #endif
double getEnergy(double *pos) const
returns our contribution to the energy of a position
class to store MMFF parameters for angle bending
Definition: MMFF/Params.h:110
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
std::pair< double, double > calcStbnForceConstants(const MMFFStbn *mmffStbnParams)
returns the std::pair of stretch-bend force constants for an angle
class to store MMFF parameters for stretch-bending
Definition: MMFF/Params.h:117
class to store MMFF parameters for bond stretching
Definition: MMFF/Params.h:86
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
The angle-bend term for MMFF.
Definition: StretchBend.h:26
virtual StretchBendContrib * copy() const
return a copy
Definition: StretchBend.h:49
A class to store forcefields and handle minimization.
Definition: ForceField.h:57
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