RDKit
Open-source cheminformatics and machine learning.
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 
19 namespace ForceFields {
20 namespace MMFF {
21 class MMFFVdWCollection;
22 class MMFFVdW;
23 //! the van der Waals term for MMFF
25  public:
26  VdWContrib() : d_at1Idx(-1), d_at2Idx(-1){};
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;
38  void getGrad(double *pos, double *grad) const;
39  virtual VdWContrib *copy() const { return new VdWContrib(*this); };
40 
41  private:
42  int d_at1Idx, d_at2Idx;
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:
50  EleContrib() : d_at1Idx(-1), d_at2Idx(-1){};
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, boost::uint8_t dielModel, bool is1_4);
61  double getEnergy(double *pos) const;
62  void getGrad(double *pos, double *grad) const;
63 
64  virtual EleContrib *copy() const { return new EleContrib(*this); };
65 
66  private:
67  int d_at1Idx, d_at2Idx;
68  double d_chargeTerm; //!< q1 * q2 / D
69  boost::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 
74 namespace Utils {
75 //! calculates and returns the unscaled minimum distance (R*ij) for a MMFF VdW
76 //contact
78  const MMFFVdW *mmffVdWParamsAtom1,
79  const MMFFVdW *mmffVdWParamsAtom2);
80 //! calculates and returns the unscaled well depth (epsilon) for a MMFF VdW
81 //contact
83  const MMFFVdW *mmffVdWParamsIAtom,
84  const MMFFVdW *mmffVdWParamsJAtom);
85 //! scales the VdW parameters
86 RDKIT_FORCEFIELD_EXPORT void scaleVdWParams(double &R_star_ij, double &wellDepth,
87  MMFFVdWCollection *mmffVdW,
88  const MMFFVdW *mmffVdWParamsIAtom,
89  const MMFFVdW *mmffVdWParamsJAtom);
90 //! calculates and returns the Van der Waals MMFF energy
91 RDKIT_FORCEFIELD_EXPORT double calcVdWEnergy(const double dist, const double R_star_ij,
92  const double wellDepth);
93 //! calculates and returns the electrostatic MMFF energy
94 RDKIT_FORCEFIELD_EXPORT double calcEleEnergy(unsigned int idx1, unsigned int idx2, double dist,
95  double chargeTerm, boost::uint8_t dielModel, bool is1_4);
96 }
97 }
98 }
99 #endif
RDKIT_FORCEFIELD_EXPORT double calcUnscaledVdWWellDepth(double R_star_ij, const MMFFVdW *mmffVdWParamsIAtom, const MMFFVdW *mmffVdWParamsJAtom)
calculates and returns the unscaled well depth (epsilon) for a MMFF VdW
virtual VdWContrib * copy() const
return a copy
virtual EleContrib * copy() const
return a copy
the electrostatic term for MMFF
RDKIT_FORCEFIELD_EXPORT double calcUnscaledVdWMinimum(MMFFVdWCollection *mmffVdW, const MMFFVdW *mmffVdWParamsAtom1, const MMFFVdW *mmffVdWParamsAtom2)
calculates and returns the unscaled minimum distance (R*ij) for a MMFF VdW
RDKIT_FORCEFIELD_EXPORT double calcEleEnergy(unsigned int idx1, unsigned int idx2, double dist, double chargeTerm, boost::uint8_t dielModel, bool is1_4)
calculates and returns the electrostatic MMFF energy
class to store MMFF parameters for non-bonded Van der Waals
Definition: MMFF/Params.h:139
abstract base class for contributions to ForceFields
Definition: Contrib.h:18
RDKIT_FORCEFIELD_EXPORT double calcVdWEnergy(const double dist, const double R_star_ij, const double wellDepth)
calculates and returns the Van der Waals MMFF energy
pulls in the core RDKit functionality
#define RDKIT_FORCEFIELD_EXPORT
Definition: export.h:242
the van der Waals term for MMFF
RDKIT_FORCEFIELD_EXPORT void scaleVdWParams(double &R_star_ij, double &wellDepth, MMFFVdWCollection *mmffVdW, const MMFFVdW *mmffVdWParamsIAtom, const MMFFVdW *mmffVdWParamsJAtom)
scales the VdW parameters
A class to store forcefields and handle minimization.
Definition: ForceField.h:58