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