RDKit
Open-source cheminformatics and machine learning.
MMFF/BondStretch.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_MMFFBONDSTRETCH_H__
13 #define __RD_MMFFBONDSTRETCH_H__
14 #include <ForceField/Contrib.h>
15 
16 namespace ForceFields {
17 namespace MMFF {
18 class MMFFBond;
19 class MMFFBondStretchEmpiricalRule;
20 
21 //! The bond-stretch term for MMFF
23  public:
24  BondStretchContrib() : d_at1Idx(-1), d_at2Idx(-1){};
25  //! Constructor
26  /*!
27  \param owner pointer to the owning ForceField
28  \param idx1 index of end1 in the ForceField's positions
29  \param idx2 index of end2 in the ForceField's positions
30  \param bondType MMFF94 type of the bond (as an unsigned int)
31  \param end1Params pointer to the parameters for end1
32  \param end2Params pointer to the parameters for end2
33 
34  */
35  BondStretchContrib(ForceField *owner, const unsigned int idx1,
36  const unsigned int idx2, const MMFFBond *mmffBondParams);
37 
38  double getEnergy(double *pos) const;
39 
40  void getGrad(double *pos, double *grad) const;
41 
42  virtual BondStretchContrib *copy() const {
43  return new BondStretchContrib(*this);
44  };
45 
46  private:
47  int d_at1Idx, d_at2Idx; //!< indices of end points
48  double d_r0; //!< rest length of the bond
49  double d_kb; //!< force constant of the bond
50 };
51 
52 namespace Utils {
53 //! returns the MMFF rest length for a bond
54 double calcBondRestLength(const MMFFBond *mmffBondParams);
55 //! returns the MMFF force constant for a bond
56 double calcBondForceConstant(const MMFFBond *mmffBondParams);
57 //! calculates and returns the bond stretching MMFF energy
58 double calcBondStretchEnergy(const double r0, const double kb,
59  const double distance);
60 }
61 }
62 }
63 #endif
double getEnergy(double *pos) const
returns our contribution to the energy of a position
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
double calcBondRestLength(const MMFFBond *mmffBondParams)
returns the MMFF rest length for a bond
double calcBondForceConstant(const MMFFBond *mmffBondParams)
returns the MMFF force constant for a bond
double calcBondStretchEnergy(const double r0, const double kb, const double distance)
calculates and returns the bond stretching MMFF energy
class to store MMFF parameters for bond stretching
Definition: MMFF/Params.h:86
virtual BondStretchContrib * copy() const
return a copy
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
The bond-stretch term for MMFF.
A class to store forcefields and handle minimization.
Definition: ForceField.h:57