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 #include <RDGeneral/export.h>
11 #ifndef __RD_BONDSTRETCH_H__
12 #define __RD_BONDSTRETCH_H__
13 #include <ForceField/Contrib.h>
14 
15 namespace ForceFields {
16 namespace UFF {
17 class AtomicParams;
18 
19 //! The bond-stretch term for the Universal Force Field
21  public:
22  BondStretchContrib() : d_end1Idx(-1), d_end2Idx(-1){};
23  //! Constructor
24  /*!
25  \param owner pointer to the owning ForceField
26  \param idx1 index of end1 in the ForceField's positions
27  \param idx2 index of end2 in the ForceField's positions
28  \param bondOrder order of the bond (as a double)
29  \param end1Params pointer to the parameters for end1
30  \param end2Params pointer to the parameters for end2
31 
32  */
33  BondStretchContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
34  double bondOrder, const AtomicParams *end1Params,
35  const AtomicParams *end2Params);
36 
37  double getEnergy(double *pos) const;
38 
39  void getGrad(double *pos, double *grad) const;
40 
41  virtual BondStretchContrib *copy() const {
42  return new BondStretchContrib(*this);
43  };
44 
45  private:
46  int d_end1Idx, d_end2Idx; //!< indices of end points
47  double d_restLen; //!< rest length of the bond
48  double d_forceConstant; //!< force constant of the bond
49 };
50 
51 namespace Utils {
52 //! calculates and returns the UFF rest length for a bond
53 /*!
54 
55  \param bondOrder the order of the bond (as a double)
56  \param end1Params pointer to the parameters for end1
57  \param end2Params pointer to the parameters for end2
58 
59  \return the rest length
60 
61 */
62 RDKIT_FORCEFIELD_EXPORT double calcBondRestLength(double bondOrder, const AtomicParams *end1Params,
63  const AtomicParams *end2Params);
64 
65 //! calculates and returns the UFF force constant for a bond
66 /*!
67 
68  \param restLength the rest length of the bond
69  \param end1Params pointer to the parameters for end1
70  \param end2Params pointer to the parameters for end2
71 
72  \return the force constant
73 
74 */
75 RDKIT_FORCEFIELD_EXPORT double calcBondForceConstant(double restLength, const AtomicParams *end1Params,
76  const AtomicParams *end2Params);
77 }
78 }
79 }
80 #endif
class to store atomic parameters for the Universal Force Field
Definition: UFF/Params.h:72
virtual BondStretchContrib * copy() const
return a copy
RDKIT_FORCEFIELD_EXPORT double calcBondForceConstant(double restLength, const AtomicParams *end1Params, const AtomicParams *end2Params)
calculates and returns the UFF force constant for a bond
The bond-stretch term for the Universal Force Field.
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:242
RDKIT_FORCEFIELD_EXPORT double calcBondRestLength(double bondOrder, const AtomicParams *end1Params, const AtomicParams *end2Params)
calculates and returns the UFF rest length for a bond
A class to store forcefields and handle minimization.
Definition: ForceField.h:58