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