RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MMFF/Nonbonded.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_MMFFNONBONDED_H__
14#define __RD_MMFFNONBONDED_H__
15#include <ForceField/Contrib.h>
16#include <GraphMol/RDKitBase.h>
18
19namespace ForceFields {
20namespace MMFF {
21class MMFFVdWCollection;
22class MMFFVdW;
23//! the van der Waals term for MMFF
25 public:
27
28 //! Constructor
29 /*!
30 \param owner pointer to the owning ForceField
31 \param idx1 index of end1 in the ForceField's positions
32 \param idx2 index of end2 in the ForceField's positions
33
34 */
35 VdWContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
36 const MMFFVdWRijstarEps *mmffVdWConstants);
37 double getEnergy(double *pos) const override;
38 void getGrad(double *pos, double *grad) const override;
39 VdWContrib *copy() const override { return new VdWContrib(*this); }
40
41 private:
42 int d_at1Idx{-1}, d_at2Idx{-1};
43 double d_R_ij_star; //!< the preferred length of the contact
44 double d_wellDepth; //!< the vdW well depth (strength of the interaction)
45};
46
47//! the electrostatic term for MMFF
49 public:
51
52 //! Constructor
53 /*!
54 \param owner pointer to the owning ForceField
55 \param idx1 index of end1 in the ForceField's positions
56 \param idx2 index of end2 in the ForceField's positions
57
58 */
59 EleContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
60 double chargeTerm, std::uint8_t dielModel, bool is1_4);
61 double getEnergy(double *pos) const override;
62 void getGrad(double *pos, double *grad) const override;
63
64 EleContrib *copy() const override { return new EleContrib(*this); }
65
66 private:
67 int d_at1Idx{-1}, d_at2Idx{-1};
68 double d_chargeTerm; //!< q1 * q2 / D
69 std::uint8_t
70 d_dielModel; //!< dielectric model (1: constant; 2: distance-dependent)
71 bool d_is1_4; //!< flag set for atoms in a 1,4 relationship
72};
73
74namespace Utils {
75//! calculates and returns the unscaled minimum distance (R*ij) for a MMFF VdW
76/// contact
77RDKIT_FORCEFIELD_EXPORT double calcUnscaledVdWMinimum(
78 const MMFFVdWCollection *mmffVdW, const MMFFVdW *mmffVdWParamsAtom1,
79 const MMFFVdW *mmffVdWParamsAtom2);
80//! calculates and returns the unscaled well depth (epsilon) for a MMFF VdW
81/// contact
82RDKIT_FORCEFIELD_EXPORT double calcUnscaledVdWWellDepth(
83 double R_star_ij, const MMFFVdW *mmffVdWParamsIAtom,
84 const MMFFVdW *mmffVdWParamsJAtom);
85//! scales the VdW parameters
86RDKIT_FORCEFIELD_EXPORT void scaleVdWParams(double &R_star_ij,
87 double &wellDepth,
88 const MMFFVdWCollection *mmffVdW,
89 const MMFFVdW *mmffVdWParamsIAtom,
90 const MMFFVdW *mmffVdWParamsJAtom);
91//! calculates and returns the Van der Waals MMFF energy
92RDKIT_FORCEFIELD_EXPORT double calcVdWEnergy(const double dist,
93 const double R_star_ij,
94 const double wellDepth);
95//! calculates and returns the electrostatic MMFF energy
96// FIX: idx1 and idx2 are not used
97RDKIT_FORCEFIELD_EXPORT double calcEleEnergy(unsigned int idx1,
98 unsigned int idx2, double dist,
99 double chargeTerm,
100 std::uint8_t dielModel,
101 bool is1_4);
102} // namespace Utils
103} // namespace MMFF
104} // namespace ForceFields
105#endif
pulls in the core RDKit functionality
abstract base class for contributions to ForceFields
Definition Contrib.h:18
A class to store forcefields and handle minimization.
Definition ForceField.h:79
the electrostatic term for MMFF
EleContrib * copy() const override
return a copy
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
EleContrib(ForceField *owner, unsigned int idx1, unsigned int idx2, double chargeTerm, std::uint8_t dielModel, bool is1_4)
Constructor.
the van der Waals term for MMFF
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
VdWContrib * copy() const override
return a copy
VdWContrib(ForceField *owner, unsigned int idx1, unsigned int idx2, const MMFFVdWRijstarEps *mmffVdWConstants)
Constructor.
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
#define RDKIT_FORCEFIELD_EXPORT
Definition export.h:185