RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MMFF/AngleBend.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_MMFFANGLEBEND_H__
14#define __RD_MMFFANGLEBEND_H__
15
17#include <ForceField/Contrib.h>
18
19namespace ForceFields {
20namespace MMFF {
21class MMFFBond;
22class MMFFAngle;
23class MMFFProp;
24
25//! The angle-bend term for MMFF
27 public:
29 //! Constructor
30 /*!
31 The angle is between atom1 - atom2 - atom3
32
33 \param owner pointer to the owning ForceField
34 \param idx1 index of atom1 in the ForceField's positions
35 \param idx2 index of atom2 in the ForceField's positions
36 \param idx3 index of atom3 in the ForceField's positions
37 \param angleType MMFF type of the angle (as an unsigned int)
38
39 */
40 AngleBendContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
41 unsigned int idx3, const MMFFAngle *mmffAngleParams,
42 const MMFFProp *mmffPropParamsCentralAtom);
43 double getEnergy(double *pos) const override;
44 void getGrad(double *pos, double *grad) const override;
45 AngleBendContrib *copy() const override {
46 return new AngleBendContrib(*this);
47 }
48
49 private:
50 bool d_isLinear;
51 int d_at1Idx{-1}, d_at2Idx{-1}, d_at3Idx{-1};
52 double d_ka, d_theta0;
53};
54namespace Utils {
55//! returns the MMFF rest value for an angle
56RDKIT_FORCEFIELD_EXPORT double calcAngleRestValue(
57 const MMFFAngle *mmffAngleParams);
58//! returns the MMFF force constant for an angle
59RDKIT_FORCEFIELD_EXPORT double calcAngleForceConstant(
60 const MMFFAngle *mmffAngleParams);
61//! calculates and returns the cosine of the angle between points p1, p2, p3
62RDKIT_FORCEFIELD_EXPORT double calcCosTheta(RDGeom::Point3D p1,
64 RDGeom::Point3D p3, double dist1,
65 double dist2);
66//! calculates and returns the angle bending MMFF energy
67RDKIT_FORCEFIELD_EXPORT double calcAngleBendEnergy(const double theta0,
68 const double ka,
69 bool isLinear,
70 const double cosTheta);
71RDKIT_FORCEFIELD_EXPORT void calcAngleBendGrad(RDGeom::Point3D *r, double *dist,
72 double **g, double &dE_dTheta,
73 double &cosTheta,
74 double &sinTheta);
75} // namespace Utils
76} // namespace MMFF
77} // namespace ForceFields
78#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 angle-bend term for MMFF.
AngleBendContrib * copy() const override
return a copy
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
AngleBendContrib(ForceField *owner, unsigned int idx1, unsigned int idx2, unsigned int idx3, const MMFFAngle *mmffAngleParams, const MMFFProp *mmffPropParamsCentralAtom)
Constructor.
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
class to store MMFF parameters for angle bending
class to store MMFF parameters for bond stretching
Definition MMFF/Params.h:81
class to store MMFF Properties
Definition MMFF/Params.h:54
#define RDKIT_FORCEFIELD_EXPORT
Definition export.h:185