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