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 */
63  double bondOrder, const AtomicParams *end1Params,
64  const AtomicParams *end2Params);
65 
66 //! calculates and returns the UFF force constant for a bond
67 /*!
68 
69  \param restLength the rest length of the bond
70  \param end1Params pointer to the parameters for end1
71  \param end2Params pointer to the parameters for end2
72 
73  \return the force constant
74 
75 */
77  double restLength, const AtomicParams *end1Params,
78  const AtomicParams *end2Params);
79 } // namespace Utils
80 } // namespace UFF
81 } // namespace ForceFields
82 #endif
ForceFields::UFF::Utils::calcBondForceConstant
RDKIT_FORCEFIELD_EXPORT double calcBondForceConstant(double restLength, const AtomicParams *end1Params, const AtomicParams *end2Params)
calculates and returns the UFF force constant for a bond
ForceFields::UFF::BondStretchContrib::BondStretchContrib
BondStretchContrib()
Definition: UFF/BondStretch.h:22
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition: ForceField.h:79
ForceFields::ForceFieldContrib
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
RDKIT_FORCEFIELD_EXPORT
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:255
ForceFields::UFF::BondStretchContrib
The bond-stretch term for the Universal Force Field.
Definition: UFF/BondStretch.h:20
ForceFields
Definition: TorsionAngleM6.h:24
ForceFields::UFF::BondStretchContrib::copy
virtual BondStretchContrib * copy() const
return a copy
Definition: UFF/BondStretch.h:41
ForceFields::UFF::Utils::calcBondRestLength
RDKIT_FORCEFIELD_EXPORT double calcBondRestLength(double bondOrder, const AtomicParams *end1Params, const AtomicParams *end2Params)
calculates and returns the UFF rest length for a bond
Contrib.h
ForceFields::UFF::AtomicParams
class to store atomic parameters for the Universal Force Field
Definition: UFF/Params.h:73
export.h