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