RDKit
Open-source cheminformatics and machine learning.
UFF/BondStretch.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #ifndef __RD_BONDSTRETCH_H__
11 #define __RD_BONDSTRETCH_H__
12 #include <ForceField/Contrib.h>
13 
14 namespace ForceFields {
15 namespace UFF {
16 class AtomicParams;
17 
18 //! The bond-stretch term for the Universal Force Field
20  public:
21  BondStretchContrib() : d_end1Idx(-1), d_end2Idx(-1){};
22  //! Constructor
23  /*!
24  \param owner pointer to the owning ForceField
25  \param idx1 index of end1 in the ForceField's positions
26  \param idx2 index of end2 in the ForceField's positions
27  \param bondOrder order of the bond (as a double)
28  \param end1Params pointer to the parameters for end1
29  \param end2Params pointer to the parameters for end2
30 
31  */
32  BondStretchContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
33  double bondOrder, const AtomicParams *end1Params,
34  const AtomicParams *end2Params);
35 
36  double getEnergy(double *pos) const;
37 
38  void getGrad(double *pos, double *grad) const;
39 
40  virtual BondStretchContrib *copy() const {
41  return new BondStretchContrib(*this);
42  };
43 
44  private:
45  int d_end1Idx, d_end2Idx; //!< indices of end points
46  double d_restLen; //!< rest length of the bond
47  double d_forceConstant; //!< force constant of the bond
48 };
49 
50 namespace Utils {
51 //! calculates and returns the UFF rest length for a bond
52 /*!
53 
54  \param bondOrder the order of the bond (as a double)
55  \param end1Params pointer to the parameters for end1
56  \param end2Params pointer to the parameters for end2
57 
58  \return the rest length
59 
60 */
61 double calcBondRestLength(double bondOrder, const AtomicParams *end1Params,
62  const AtomicParams *end2Params);
63 
64 //! calculates and returns the UFF force constant for a bond
65 /*!
66 
67  \param restLength the rest length of the bond
68  \param end1Params pointer to the parameters for end1
69  \param end2Params pointer to the parameters for end2
70 
71  \return the force constant
72 
73 */
74 double calcBondForceConstant(double restLength, const AtomicParams *end1Params,
75  const AtomicParams *end2Params);
76 }
77 }
78 }
79 #endif
class to store atomic parameters for the Universal Force Field
Definition: UFF/Params.h:71
The bond-stretch term for the Universal Force Field.
double calcBondRestLength(double bondOrder, const AtomicParams *end1Params, const AtomicParams *end2Params)
calculates and returns the UFF rest length for a bond
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
virtual BondStretchContrib * copy() const
return a copy
double getEnergy(double *pos) const
returns our contribution to the energy of a position
A class to store forcefields and handle minimization.
Definition: ForceField.h:57
double calcBondForceConstant(double restLength, const AtomicParams *end1Params, const AtomicParams *end2Params)
calculates and returns the UFF force constant for a bond