11 #ifndef _RD_PERIODIC_TABLE_H
12 #define _RD_PERIODIC_TABLE_H
54 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
55 double mass = byanum[atomicNumber].Mass();
60 PRECONDITION(byname.count(elementSymbol),
"Element not found");
61 int anum = byname.find(elementSymbol)->second;
62 double mass = byanum[anum].Mass();
67 return getAtomicWeight(std::string(elementSymbol));
72 std::string symb(elementSymbol);
81 if (elementSymbol ==
"C")
83 else if (elementSymbol ==
"N")
85 else if (elementSymbol ==
"O")
88 STR_UINT_MAP::const_iterator iter = byname.find(elementSymbol);
89 if (iter != byname.end()) anum = iter->second;
91 POSTCONDITION(anum > -1,
"Element '" + elementSymbol +
"' not found");
97 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
98 return byanum[atomicNumber].Symbol();
103 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
104 return byanum[atomicNumber].Rvdw();
107 double getRvdw(
const std::string &elementSymbol)
const {
109 "Element '" + elementSymbol +
"' not found");
110 return getRvdw(byname.find(elementSymbol)->second);
113 double getRvdw(
const char *elementSymbol)
const {
114 return getRvdw(std::string(elementSymbol));
119 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
120 return byanum[atomicNumber].Rcov();
125 "Element '" + elementSymbol +
"' not found");
126 return getRcovalent(byname.find(elementSymbol)->second);
130 return getRcovalent(std::string(elementSymbol));
135 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
136 return byanum[atomicNumber].Rb0();
139 double getRb0(
const std::string &elementSymbol)
const {
141 "Element '" + elementSymbol +
"' not found");
142 return getRb0(byname.find(elementSymbol)->second);
145 double getRb0(
const char *elementSymbol)
const {
146 return getRb0(std::string(elementSymbol));
151 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
152 return byanum[atomicNumber].DefaultValence();
157 "Element '" + elementSymbol +
"' not found");
158 return getDefaultValence(byname.find(elementSymbol)->second);
162 return getDefaultValence(std::string(elementSymbol));
169 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
170 return byanum[atomicNumber].ValenceList();
175 "Element '" + elementSymbol +
"' not found");
176 return getValenceList(byname.find(elementSymbol)->second);
180 return getValenceList(std::string(elementSymbol));
185 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
186 return byanum[atomicNumber].NumOuterShellElec();
191 "Element '" + elementSymbol +
"' not found");
192 return getNouterElecs(byname.find(elementSymbol)->second);
196 return getNouterElecs(std::string(elementSymbol));
201 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
202 return byanum[atomicNumber].MostCommonIsotope();
207 "Element '" + elementSymbol +
"' not found");
208 return getMostCommonIsotope(byname.find(elementSymbol)->second);
212 return getMostCommonIsotope(std::string(elementSymbol));
217 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
218 return byanum[atomicNumber].MostCommonIsotopeMass();
223 "Element '" + elementSymbol +
"' not found");
224 return getMostCommonIsotopeMass(byname.find(elementSymbol)->second);
228 return getMostCommonIsotopeMass(std::string(elementSymbol));
234 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
235 const std::map<unsigned int, std::pair<double, double>> &m =
236 byanum[atomicNumber].d_isotopeInfoMap;
237 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
239 if (item == m.end()) {
242 return item->second.first;
247 UINT isotope)
const {
249 "Element '" + elementSymbol +
"' not found");
250 return getMassForIsotope(byname.find(elementSymbol)->second, isotope);
254 return getMassForIsotope(std::string(elementSymbol), isotope);
259 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
260 const std::map<unsigned int, std::pair<double, double>> &m =
261 byanum[atomicNumber].d_isotopeInfoMap;
262 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
264 if (item == m.end()) {
267 return item->second.second;
272 UINT isotope)
const {
274 "Element '" + elementSymbol +
"' not found");
275 return getAbundanceForIsotope(byname.find(elementSymbol)->second, isotope);
279 return getAbundanceForIsotope(std::string(elementSymbol), isotope);
295 PRECONDITION(anum1 < byanum.size(),
"Atomic number not found");
296 PRECONDITION(anum2 < byanum.size(),
"Atomic number not found");
298 UINT ne1 = getNouterElecs(anum1);
299 UINT ne2 = getNouterElecs(anum2);
314 static void initInstance();
318 std::vector<atomicData> byanum;
#define POSTCONDITION(expr, mess)
#define PRECONDITION(expr, mess)
No user-serviceable parts inside.
singleton class for retrieving information about atoms
int getMostCommonIsotope(UINT atomicNumber) const
returns the number of the most common isotope
int getMostCommonIsotope(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getRb0(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getMostCommonIsotopeMass(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getRcovalent(UINT atomicNumber) const
returns the atom's covalent radius
double getAbundanceForIsotope(UINT atomicNumber, UINT isotope) const
double getRb0(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getAtomicWeight(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getNouterElecs(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getAtomicWeight(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getAtomicNumber(const std::string &elementSymbol) const
overload
double getRvdw(UINT atomicNumber) const
returns the atom's van der Waals radius
int getAtomicNumber(const char *elementSymbol) const
returns the atomic number
int getNouterElecs(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getRvdw(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getMostCommonIsotopeMass(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getRb0(UINT atomicNumber) const
returns the atom's bond radius
static PeriodicTable * getTable()
returns a pointer to the singleton PeriodicTable
double getMostCommonIsotopeMass(UINT atomicNumber) const
returns the mass of the most common isotope
int getDefaultValence(UINT atomicNumber) const
returns the atom's default valence
double getMassForIsotope(UINT atomicNumber, UINT isotope) const
double getRcovalent(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getMostCommonIsotope(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string getElementSymbol(UINT atomicNumber) const
returns the atomic symbol
int getNouterElecs(UINT atomicNumber) const
returns the number of outer shell electrons
double getRvdw(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getRcovalent(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getMassForIsotope(const char *elementSymbol, UINT isotope) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getAtomicWeight(UINT atomicNumber) const
returns the atomic weight
const INT_VECT & getValenceList(UINT atomicNumber) const
bool moreElectroNegative(UINT anum1, UINT anum2) const
convenience function to determine which atom is more electronegative
double getMassForIsotope(const std::string &elementSymbol, UINT isotope) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getAbundanceForIsotope(const std::string &elementSymbol, UINT isotope) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getDefaultValence(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const INT_VECT & getValenceList(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int getDefaultValence(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getAbundanceForIsotope(const char *elementSymbol, UINT isotope) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const INT_VECT & getValenceList(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
#define RDKIT_GRAPHMOL_EXPORT
RDKIT_STRUCTCHECKER_EXPORT unsigned getAtomicNumber(const std::string symbol)
std::vector< int > INT_VECT
std::map< std::string, UINT > STR_UINT_MAP