RDKit: Params.h Source File

| 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
27 constexpr double DEG2RAD = M_PI / 180.0;
28 constexpr double RAD2DEG = 180.0 / M_PI;
29 inline bool isDoubleZero(const double x) {
30 return ((x < 1.0e-10) && (x > -1.0e-10));
31}
32 inline void clipToOne(double &x) { x = std::clamp(x, -1.0, 1.0); }
33
34//! class to store UFF parameters for bond stretching
35 class RDKIT_FORCEFIELD_EXPORT UFFBond {
36 public:
37 double kb;
38 double r0;
39};
40
41//! class to store UFF parameters for angle bending
42 class RDKIT_FORCEFIELD_EXPORT UFFAngle {
43 public:
44 double ka;
45 double theta0;
46};
47
48//! class to store UFF parameters for torsions
49 class RDKIT_FORCEFIELD_EXPORT UFFTor {
50 public:
51 double V;
52};
53
54//! class to store UFF parameters for inversions
55 class RDKIT_FORCEFIELD_EXPORT UFFInv {
56 public:
57 double K;
58};
59
60//! class to store UFF parameters for van der Waals interactions
61 class RDKIT_FORCEFIELD_EXPORT UFFVdW {
62 public:
63 double x_ij;
64 double D_ij;
65};
66
67//! class to store atomic parameters for the Universal Force Field
68 class RDKIT_FORCEFIELD_EXPORT AtomicParams {
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
83 namespace Params {
84 const double lambda = 0.1332; //!< scaling factor for rBO correction
85 const double G = 332.06; //!< bond force constant prefactor
86 const 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*/
108 class RDKIT_FORCEFIELD_EXPORT ParamCollection {
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
M_PI
#define M_PI
Definition MMFF/Params.h:25
ForceFields::UFF::AtomicParams
class to store atomic parameters for the Universal Force Field
Definition UFF/Params.h:68
ForceFields::UFF::AtomicParams::GMP_Xi
double GMP_Xi
GMP Electronegativity;.
Definition UFF/Params.h:78
ForceFields::UFF::AtomicParams::GMP_Hardness
double GMP_Hardness
GMP Hardness.
Definition UFF/Params.h:79
ForceFields::UFF::AtomicParams::GMP_Radius
double GMP_Radius
GMP Radius value.
Definition UFF/Params.h:80
ForceFields::UFF::AtomicParams::r1
double r1
valence bond radius
Definition UFF/Params.h:70
ForceFields::UFF::AtomicParams::x1
double x1
vdW characteristic length
Definition UFF/Params.h:72
ForceFields::UFF::AtomicParams::U1
double U1
torsional contribution for sp2-sp3 bonds
Definition UFF/Params.h:77
ForceFields::UFF::AtomicParams::D1
double D1
vdW atomic energy
Definition UFF/Params.h:73
ForceFields::UFF::AtomicParams::zeta
double zeta
vdW scaling term
Definition UFF/Params.h:74
ForceFields::UFF::AtomicParams::V1
double V1
sp3 torsional barrier parameter
Definition UFF/Params.h:76
ForceFields::UFF::AtomicParams::theta0
double theta0
valence angle
Definition UFF/Params.h:71
ForceFields::UFF::AtomicParams::Z1
double Z1
effective charge
Definition UFF/Params.h:75
ForceFields::UFF::ParamCollection::ParamCollection
ParamCollection(std::string paramData)
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:132
ForceFields::UFF::ParamCollection::getParams
static const ParamCollection * getParams(const std::string &paramData="")
gets a pointer to the singleton ParamCollection
ForceFields::UFF::UFFAngle
class to store UFF parameters for angle bending
Definition UFF/Params.h:42
ForceFields::UFF::UFFAngle::theta0
double theta0
Definition UFF/Params.h:45
ForceFields::UFF::UFFAngle::ka
double ka
Definition UFF/Params.h:44
ForceFields::UFF::UFFBond
class to store UFF parameters for bond stretching
Definition UFF/Params.h:35
ForceFields::UFF::UFFBond::kb
double kb
Definition UFF/Params.h:37
ForceFields::UFF::UFFBond::r0
double r0
Definition UFF/Params.h:38
ForceFields::UFF::UFFInv
class to store UFF parameters for inversions
Definition UFF/Params.h:55
ForceFields::UFF::UFFInv::K
double K
Definition UFF/Params.h:57
ForceFields::UFF::UFFTor
class to store UFF parameters for torsions
Definition UFF/Params.h:49
ForceFields::UFF::UFFTor::V
double V
Definition UFF/Params.h:51
ForceFields::UFF::UFFVdW
class to store UFF parameters for van der Waals interactions
Definition UFF/Params.h:61
ForceFields::UFF::UFFVdW::x_ij
double x_ij
Definition UFF/Params.h:63
ForceFields::UFF::UFFVdW::D_ij
double D_ij
Definition UFF/Params.h:64
export.h
RDKIT_FORCEFIELD_EXPORT
#define RDKIT_FORCEFIELD_EXPORT
Definition export.h:201
symbol
static const char * symbol[119]
Definition mf.h:257
ForceFields::UFF::Params
Definition UFF/Params.h:83
ForceFields::UFF::Params::amideBondOrder
const double amideBondOrder
special case bond order for amide C-N bonds.
Definition UFF/Params.h:86
ForceFields::UFF::Params::lambda
const double lambda
scaling factor for rBO correction
Definition UFF/Params.h:84
ForceFields::UFF::Params::G
const double G
bond force constant prefactor
Definition UFF/Params.h:85
ForceFields::UFF::isDoubleZero
bool isDoubleZero(const double x)
Definition UFF/Params.h:29
ForceFields::UFF::DEG2RAD
constexpr double DEG2RAD
Definition UFF/Params.h:27
ForceFields::UFF::clipToOne
void clipToOne(double &x)
Definition UFF/Params.h:32
ForceFields::UFF::RAD2DEG
constexpr double RAD2DEG
Definition UFF/Params.h:28
ForceFields
Definition TorsionAngleContribs.h:21