RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
StretchBend.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_MMFFSTRETCHBEND_H__
14#define __RD_MMFFSTRETCHBEND_H__
15
16#include <utility>
17#include <ForceField/Contrib.h>
18
19namespace ForceFields {
20namespace MMFF {
21class MMFFBond;
22class MMFFAngle;
23class MMFFStbn;
24class MMFFProp;
25
26//! The angle-bend term for MMFF
28 public:
30 //! Constructor
31 /*!
32 The angle is between atom1 - atom2 - atom3
33
34 \param owner pointer to the owning ForceField
35 \param idx1 index of atom1 in the ForceField's positions
36 \param idx2 index of atom2 in the ForceField's positions
37 \param idx3 index of atom3 in the ForceField's positions
38 \param angleType MMFF type of the angle (as an unsigned int)
39
40 */
41 StretchBendContrib(ForceField *owner, const unsigned int idx1,
42 const unsigned int idx2, const unsigned int idx3,
43 const MMFFStbn *mmffStbnParams,
44 const MMFFAngle *mmffAngleParams,
45 const MMFFBond *mmffBondParams1,
46 const MMFFBond *mmffBondParams2);
47
48 double getEnergy(double *pos) const override;
49 void getGrad(double *pos, double *grad) const override;
50 StretchBendContrib *copy() const override {
51 return new StretchBendContrib(*this);
52 }
53
54 private:
55 int d_at1Idx{-1}, d_at2Idx{-1}, d_at3Idx{-1};
56 double d_restLen1, d_restLen2, d_theta0;
57 std::pair<double, double> d_forceConstants;
58};
59namespace Utils {
60//! returns the std::pair of stretch-bend force constants for an angle
62 const MMFFStbn *mmffStbnParams);
63//! calculates and returns the stretch-bending MMFF energy
65 const double deltaDist1, const double deltaDist2, const double deltaTheta,
66 const std::pair<double, double> forceConstants);
67} // namespace Utils
68} // namespace MMFF
69} // namespace ForceFields
70#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 MMFF parameters for angle bending
class to store MMFF parameters for bond stretching
Definition MMFF/Params.h:88
class to store MMFF parameters for stretch-bending
The angle-bend term for MMFF.
Definition StretchBend.h:27
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
StretchBendContrib * copy() const override
return a copy
Definition StretchBend.h:50
StretchBendContrib(ForceField *owner, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const MMFFStbn *mmffStbnParams, const MMFFAngle *mmffAngleParams, const MMFFBond *mmffBondParams1, const MMFFBond *mmffBondParams2)
Constructor.
#define RDKIT_FORCEFIELD_EXPORT
Definition export.h:185
RDKIT_FORCEFIELD_EXPORT std::pair< double, double > calcStretchBendEnergy(const double deltaDist1, const double deltaDist2, const double deltaTheta, const std::pair< double, double > forceConstants)
calculates and returns the stretch-bending MMFF energy
RDKIT_FORCEFIELD_EXPORT std::pair< double, double > calcStbnForceConstants(const MMFFStbn *mmffStbnParams)
returns the std::pair of stretch-bend force constants for an angle