RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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
15namespace ForceFields {
16namespace UFF {
17class AtomicParams;
18
19//! The bond-stretch term for the Universal Force Field
21 public:
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 override;
38
39 void getGrad(double *pos, double *grad) const override;
40
41 BondStretchContrib *copy() const override {
42 return new BondStretchContrib(*this);
43 }
44
45 private:
46 int d_end1Idx{-1}; //!< indices of end points
47 int d_end2Idx{-1}; //!< indices of end points
48 double d_restLen; //!< rest length of the bond
49 double d_forceConstant; //!< force constant of the bond
50};
51
52namespace Utils {
53//! calculates and returns the UFF rest length for a bond
54/*!
55
56 \param bondOrder the order of the bond (as a double)
57 \param end1Params pointer to the parameters for end1
58 \param end2Params pointer to the parameters for end2
59
60 \return the rest length
61
62*/
63RDKIT_FORCEFIELD_EXPORT double calcBondRestLength(
64 double bondOrder, const AtomicParams *end1Params,
65 const AtomicParams *end2Params);
66
67//! calculates and returns the UFF force constant for a bond
68/*!
69
70 \param restLength the rest length of the bond
71 \param end1Params pointer to the parameters for end1
72 \param end2Params pointer to the parameters for end2
73
74 \return the force constant
75
76*/
77RDKIT_FORCEFIELD_EXPORT double calcBondForceConstant(
78 double restLength, const AtomicParams *end1Params,
79 const AtomicParams *end2Params);
80} // namespace Utils
81} // namespace UFF
82} // namespace ForceFields
83#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 bond-stretch term for the Universal Force Field.
BondStretchContrib(ForceField *owner, unsigned int idx1, unsigned int idx2, double bondOrder, const AtomicParams *end1Params, const AtomicParams *end2Params)
Constructor.
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
BondStretchContrib * copy() const override
return a copy
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
#define RDKIT_FORCEFIELD_EXPORT
Definition export.h:185