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