RDKit
Open-source cheminformatics and machine learning.
UFF/Params.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #ifndef __RD_UFFPARAMS_H__
11 #define __RD_UFFPARAMS_H__
12 
13 #include <string>
14 #include <cmath>
15 #include <map>
16 
17 #ifndef M_PI
18 #define M_PI 3.14159265358979323846
19 #endif
20 
21 namespace ForceFields {
22 namespace UFF {
23 
24 const double DEG2RAD = M_PI / 180.0;
25 const double RAD2DEG = 180.0 / M_PI;
26 inline bool isDoubleZero(const double x) {
27  return ((x < 1.0e-10) && (x > -1.0e-10));
28 }
29 inline void clipToOne(double &x) {
30  if (x > 1.0) {
31  x = 1.0;
32  } else if (x < -1.0) {
33  x = -1.0;
34  }
35 }
36 
37 //! class to store UFF parameters for bond stretching
38 class UFFBond {
39  public:
40  double kb;
41  double r0;
42 };
43 
44 //! class to store UFF parameters for angle bending
45 class UFFAngle {
46  public:
47  double ka;
48  double theta0;
49 };
50 
51 //! class to store UFF parameters for torsions
52 class UFFTor {
53  public:
54  double V;
55 };
56 
57 //! class to store UFF parameters for inversions
58 class UFFInv {
59  public:
60  double K;
61 };
62 
63 //! class to store UFF parameters for van der Waals interactions
64 class UFFVdW {
65  public:
66  double x_ij;
67  double D_ij;
68 };
69 
70 //! class to store atomic parameters for the Universal Force Field
71 class AtomicParams {
72  public:
73  double r1; //!< valence bond radius
74  double theta0; //!< valence angle
75  double x1; //!< vdW characteristic length
76  double D1; //!< vdW atomic energy
77  double zeta; //!< vdW scaling term
78  double Z1; //!< effective charge
79  double V1; //!< sp3 torsional barrier parameter
80  double U1; //!< torsional contribution for sp2-sp3 bonds
81  double GMP_Xi; //!< GMP Electronegativity;
82  double GMP_Hardness; //!< GMP Hardness
83  double GMP_Radius; //!< GMP Radius value
84 };
85 
86 namespace Params {
87 const double lambda = 0.1332; //!< scaling factor for rBO correction
88 const double G = 332.06; //!< bond force constant prefactor
89 const double amideBondOrder =
90  1.41; //!< special case bond order for amide C-N bonds.
91 };
92 
93 //! singleton class for retrieving UFF AtomParams
94 /*!
95  Use the singleton like this:
96 
97  \verbatim
98  ParamCollection *params=ParamCollection::getParams();
99  const AtomParams *ap=params("C_3");
100  \endverbatim
101 
102  If you have your own parameter data, it can be supplied as a string:
103  \verbatim
104  ParamCollection *params=ParamCollection::getParams(myParamData);
105  const AtomParams *ap=params("C_3");
106  \endverbatim
107  You are responsible for making sure that the data is in the correct
108  format (see Params.cpp for an example).
109 
110 */
112  public:
113  //! gets a pointer to the singleton ParamCollection
114  /*!
115  \param paramData (optional) a string with parameter data. See
116  below for more information about this argument
117 
118  \return a pointer to the singleton ParamCollection
119 
120  <b>Notes:</b>
121  - do <b>not</b> delete the pointer returned here
122  - if the singleton ParamCollection has already been instantiated and
123  \c paramData is empty, the singleton will be returned.
124  - if \c paramData is empty and the singleton ParamCollection has
125  not yet been instantiated, the default UFF parameters (from Params.cpp)
126  will be used.
127  - if \c paramData is supplied, a new singleton will be instantiated.
128  The current instantiation (if there is one) will be deleted.
129  */
130  static ParamCollection *getParams(const std::string &paramData = "");
131  //! Looks up the parameters for a particular UFF key and returns them.
132  /*!
133  \return a pointer to the AtomicParams object, NULL on failure.
134  */
135  const AtomicParams *operator()(const std::string &symbol) const {
136  std::map<std::string, AtomicParams>::const_iterator res;
137  res = d_params.find(symbol);
138  if (res != d_params.end()) {
139  return &((*res).second);
140  }
141  return 0;
142  }
143 
144  private:
145  //! to force this to be a singleton, the constructor must be private
146  ParamCollection(std::string paramData);
147  static class ParamCollection *ds_instance; //!< the singleton
148  std::map<std::string, AtomicParams> d_params; //!< the parameter map
149 };
150 }
151 }
152 #endif
class to store atomic parameters for the Universal Force Field
Definition: UFF/Params.h:71
double theta0
valence angle
Definition: UFF/Params.h:74
const double DEG2RAD
Definition: UFF/Params.h:24
const double G
bond force constant prefactor
Definition: UFF/Params.h:88
double r1
valence bond radius
Definition: UFF/Params.h:73
const double amideBondOrder
special case bond order for amide C-N bonds.
Definition: UFF/Params.h:89
const double lambda
scaling factor for rBO correction
Definition: UFF/Params.h:87
bool isDoubleZero(const double x)
Definition: UFF/Params.h:26
const double RAD2DEG
Definition: UFF/Params.h:25
double U1
torsional contribution for sp2-sp3 bonds
Definition: UFF/Params.h:80
#define M_PI
Definition: UFF/Params.h:18
std::string paramData
singleton class for retrieving UFF AtomParams
Definition: UFF/Params.h:111
double V1
sp3 torsional barrier parameter
Definition: UFF/Params.h:79
const AtomicParams * operator()(const std::string &symbol) const
Looks up the parameters for a particular UFF key and returns them.
Definition: UFF/Params.h:135
class to store UFF parameters for van der Waals interactions
Definition: UFF/Params.h:64
double GMP_Xi
GMP Electronegativity;.
Definition: UFF/Params.h:81
class to store UFF parameters for bond stretching
Definition: UFF/Params.h:38
class to store UFF parameters for angle bending
Definition: UFF/Params.h:45
class to store UFF parameters for inversions
Definition: UFF/Params.h:58
double x1
vdW characteristic length
Definition: UFF/Params.h:75
double GMP_Hardness
GMP Hardness.
Definition: UFF/Params.h:82
double Z1
effective charge
Definition: UFF/Params.h:78
class to store UFF parameters for torsions
Definition: UFF/Params.h:52
double GMP_Radius
GMP Radius value.
Definition: UFF/Params.h:83
double D1
vdW atomic energy
Definition: UFF/Params.h:76
void clipToOne(double &x)
Definition: UFF/Params.h:29
double zeta
vdW scaling term
Definition: UFF/Params.h:77