RDKit
Open-source cheminformatics and machine learning.
UFF/Nonbonded.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_NONBONDED_H__
11 #define __RD_NONBONDED_H__
12 #include <ForceField/Contrib.h>
13 
14 namespace ForceFields {
15 namespace UFF {
16 class AtomicParams;
17 
18 //! the van der Waals term for the Universal Force Field
19 /*!
20  <b>The Distance Threshold</b>
21  For the sake of efficiency, each vdwContrib maintains a threshold
22  distance. When the distance between the two atoms exceeds this
23  threshold, the vdwContrib makes no contribution to either the
24  energy or the gradient.
25 
26  The threshold is set to a multiple of the vdW distance's preferred
27  length. This multiplier can be supplied to the constructor.
28 
29  */
30 class vdWContrib : public ForceFieldContrib {
31  public:
32  vdWContrib() : d_at1Idx(-1), d_at2Idx(-1){};
33 
34  //! Constructor
35  /*!
36  \param owner pointer to the owning ForceField
37  \param idx1 index of end1 in the ForceField's positions
38  \param idx2 index of end2 in the ForceField's positions
39  \param at1Params pointer to the parameters for end1
40  \param at2Params pointer to the parameters for end2
41  \param threshMultiplier (optional) multiplier for the threshold
42  calculation. See class documentation for details.
43 
44  */
45  vdWContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
46  const AtomicParams *at1Params, const AtomicParams *at2Params,
47  double threshMultiplier = 10.0);
48  double getEnergy(double *pos) const;
49  void getGrad(double *pos, double *grad) const;
50  virtual vdWContrib *copy() const { return new vdWContrib(*this); };
51 
52  private:
53  int d_at1Idx, d_at2Idx;
54  double d_xij; //!< the preferred length of the contact
55  double d_wellDepth; //!< the vdW well depth (strength of the interaction)
56  double d_thresh; //!< the distance threshold
57 };
58 namespace Utils {
59 //! calculates and returns the UFF minimum position for a vdW contact
60 /*!
61 
62  \param at1Params pointer to the parameters for end1
63  \param at2Params pointer to the parameters for end2
64 
65  \return the position of the minimum
66 
67 */
68 double calcNonbondedMinimum(const AtomicParams *at1Params,
69  const AtomicParams *at2Params);
70 
71 //! calculates and returns the UFF well depth for a vdW contact
72 /*!
73 
74  \param at1Params pointer to the parameters for end1
75  \param at2Params pointer to the parameters for end2
76 
77  \return the depth of the well
78 
79 */
80 double calcNonbondedDepth(const AtomicParams *at1Params,
81  const AtomicParams *at2Params);
82 }
83 }
84 }
85 #endif
class to store atomic parameters for the Universal Force Field
Definition: UFF/Params.h:71
the van der Waals term for the Universal Force Field
Definition: UFF/Nonbonded.h:30
double calcNonbondedDepth(const AtomicParams *at1Params, const AtomicParams *at2Params)
calculates and returns the UFF well depth for a vdW contact
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
double getEnergy(double *pos) const
returns our contribution to the energy of a position
virtual vdWContrib * copy() const
return a copy
Definition: UFF/Nonbonded.h:50
double calcNonbondedMinimum(const AtomicParams *at1Params, const AtomicParams *at2Params)
calculates and returns the UFF minimum position for a vdW contact
void getGrad(double *pos, double *grad) const
calculates our contribution to the gradients of a position
A class to store forcefields and handle minimization.
Definition: ForceField.h:57