RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MMFF/BondStretch.h
Go to the documentation of this file.
1//
2// Copyright (C) 2013 Paolo Tosco
3//
4// Copyright (C) 2004-2006 Rational Discovery LLC
5//
6// @@ All Rights Reserved @@
7// This file is part of the RDKit.
8// The contents are covered by the terms of the BSD license
9// which is included in the file license.txt, found at the root
10// of the RDKit source tree.
11//
12#include <RDGeneral/export.h>
13#ifndef __RD_MMFFBONDSTRETCH_H__
14#define __RD_MMFFBONDSTRETCH_H__
15#include <ForceField/Contrib.h>
16
17namespace ForceFields {
18namespace MMFF {
19class MMFFBond;
20class MMFFBondStretchEmpiricalRule;
21
22//! The bond-stretch term for MMFF
24 public:
26 //! Constructor
27 /*!
28 \param owner pointer to the owning ForceField
29 \param idx1 index of end1 in the ForceField's positions
30 \param idx2 index of end2 in the ForceField's positions
31 \param bondType MMFF94 type of the bond (as an unsigned int)
32 \param end1Params pointer to the parameters for end1
33 \param end2Params pointer to the parameters for end2
34
35 */
36 BondStretchContrib(ForceField *owner, const unsigned int idx1,
37 const unsigned int idx2, const MMFFBond *mmffBondParams);
38
39 double getEnergy(double *pos) const override;
40
41 void getGrad(double *pos, double *grad) const override;
42
43 BondStretchContrib *copy() const override {
44 return new BondStretchContrib(*this);
45 }
46
47 private:
48 int d_at1Idx{-1}, d_at2Idx{-1}; //!< indices of end points
49 double d_r0; //!< rest length of the bond
50 double d_kb; //!< force constant of the bond
51};
52
53namespace Utils {
54//! returns the MMFF rest length for a bond
56 const MMFFBond *mmffBondParams);
57//! returns the MMFF force constant for a bond
59 const MMFFBond *mmffBondParams);
60//! calculates and returns the bond stretching MMFF energy
62 const double kb,
63 const double distance);
64} // namespace Utils
65} // namespace MMFF
66} // namespace ForceFields
67#endif
abstract base class for contributions to ForceFields
Definition Contrib.h:18
A class to store forcefields and handle minimization.
Definition ForceField.h:79
The bond-stretch term for MMFF.
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
BondStretchContrib * copy() const override
return a copy
BondStretchContrib(ForceField *owner, const unsigned int idx1, const unsigned int idx2, const MMFFBond *mmffBondParams)
Constructor.
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
class to store MMFF parameters for bond stretching
Definition MMFF/Params.h:88
#define RDKIT_FORCEFIELD_EXPORT
Definition export.h:185
RDKIT_FORCEFIELD_EXPORT double calcBondForceConstant(const MMFFBond *mmffBondParams)
returns the MMFF force constant for a bond
RDKIT_FORCEFIELD_EXPORT double calcBondStretchEnergy(const double r0, const double kb, const double distance)
calculates and returns the bond stretching MMFF energy
RDKIT_FORCEFIELD_EXPORT double calcBondRestLength(const MMFFBond *mmffBondParams)
returns the MMFF rest length for a bond