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:
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{-1}, d_at2Idx{-1}; //!< 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
56  const MMFFBond *mmffBondParams);
57 //! returns the MMFF force constant for a bond
59  const MMFFBond *mmffBondParams);
60 //! calculates and returns the bond stretching MMFF energy
62  const double kb,
63  const double distance);
64 } // namespace Utils
65 } // namespace MMFF
66 } // namespace ForceFields
67 #endif
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
A class to store forcefields and handle minimization.
Definition: ForceField.h:80
The bond-stretch term for MMFF.
BondStretchContrib(ForceField *owner, const unsigned int idx1, const unsigned int idx2, const MMFFBond *mmffBondParams)
Constructor.
double getEnergy(double *pos) const
returns our contribution to the energy of a position
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
virtual BondStretchContrib * copy() const
return a copy
class to store MMFF parameters for bond stretching
Definition: MMFF/Params.h:88
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:294
RDKIT_FORCEFIELD_EXPORT double calcBondForceConstant(const MMFFBond *mmffBondParams)
returns the MMFF force constant for a bond
RDKIT_FORCEFIELD_EXPORT double calcBondStretchEnergy(const double r0, const double kb, const double distance)
calculates and returns the bond stretching MMFF energy
RDKIT_FORCEFIELD_EXPORT double calcBondRestLength(const MMFFBond *mmffBondParams)
returns the MMFF rest length for a bond