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);
74 return getAtomicNumber(symb);
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()) {
93 POSTCONDITION(anum > -1,
"Element '" + elementSymbol +
"' not found");
99 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
100 return byanum[atomicNumber].Symbol();
105 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
106 return byanum[atomicNumber].Name();
111 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
112 return byanum[atomicNumber].Rvdw();
115 double getRvdw(
const std::string &elementSymbol)
const {
117 "Element '" + elementSymbol +
"' not found");
118 return getRvdw(byname.find(elementSymbol)->second);
121 double getRvdw(
const char *elementSymbol)
const {
122 return getRvdw(std::string(elementSymbol));
127 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
128 return byanum[atomicNumber].Rcov();
133 "Element '" + elementSymbol +
"' not found");
134 return getRcovalent(byname.find(elementSymbol)->second);
138 return getRcovalent(std::string(elementSymbol));
143 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
144 return byanum[atomicNumber].Rb0();
147 double getRb0(
const std::string &elementSymbol)
const {
149 "Element '" + elementSymbol +
"' not found");
150 return getRb0(byname.find(elementSymbol)->second);
153 double getRb0(
const char *elementSymbol)
const {
154 return getRb0(std::string(elementSymbol));
159 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
160 return byanum[atomicNumber].DefaultValence();
165 "Element '" + elementSymbol +
"' not found");
166 return getDefaultValence(byname.find(elementSymbol)->second);
170 return getDefaultValence(std::string(elementSymbol));
177 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
178 return byanum[atomicNumber].ValenceList();
183 "Element '" + elementSymbol +
"' not found");
184 return getValenceList(byname.find(elementSymbol)->second);
188 return getValenceList(std::string(elementSymbol));
193 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
194 return byanum[atomicNumber].NumOuterShellElec();
199 "Element '" + elementSymbol +
"' not found");
200 return getNouterElecs(byname.find(elementSymbol)->second);
204 return getNouterElecs(std::string(elementSymbol));
209 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
210 return byanum[atomicNumber].MostCommonIsotope();
215 "Element '" + elementSymbol +
"' not found");
216 return getMostCommonIsotope(byname.find(elementSymbol)->second);
220 return getMostCommonIsotope(std::string(elementSymbol));
225 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
226 return byanum[atomicNumber].MostCommonIsotopeMass();
231 "Element '" + elementSymbol +
"' not found");
232 return getMostCommonIsotopeMass(byname.find(elementSymbol)->second);
236 return getMostCommonIsotopeMass(std::string(elementSymbol));
242 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
243 const std::map<unsigned int, std::pair<double, double>> &m =
244 byanum[atomicNumber].d_isotopeInfoMap;
245 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
247 if (item == m.end()) {
250 return item->second.first;
255 UINT isotope)
const {
257 "Element '" + elementSymbol +
"' not found");
258 return getMassForIsotope(byname.find(elementSymbol)->second, isotope);
262 return getMassForIsotope(std::string(elementSymbol), isotope);
267 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
268 const std::map<unsigned int, std::pair<double, double>> &m =
269 byanum[atomicNumber].d_isotopeInfoMap;
270 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
272 if (item == m.end()) {
275 return item->second.second;
280 UINT isotope)
const {
282 "Element '" + elementSymbol +
"' not found");
283 return getAbundanceForIsotope(byname.find(elementSymbol)->second, isotope);
287 return getAbundanceForIsotope(std::string(elementSymbol), isotope);
303 PRECONDITION(anum1 < byanum.size(),
"Atomic number not found");
304 PRECONDITION(anum2 < byanum.size(),
"Atomic number not found");
306 UINT ne1 = getNouterElecs(anum1);
307 UINT ne2 = getNouterElecs(anum2);
323 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
324 return byanum[atomicNumber].Row();
329 "Element '" + elementSymbol +
"' not found");
330 return getRow(byname.find(elementSymbol)->second);
334 return getRow(std::string(elementSymbol));
340 static void initInstance();
344 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
const INT_VECT & getValenceList(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
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
const INT_VECT & getValenceList(UINT atomicNumber) const
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...
static PeriodicTable * getTable()
returns a pointer to the singleton PeriodicTable
double getMostCommonIsotopeMass(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
UINT getRow(UINT atomicNumber) const
returns the row of the periodic table
double getRb0(UINT atomicNumber) const
returns the atom's bond radius
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...
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...
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...
UINT getRow(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...
UINT getRow(const char *elementSymbol) 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
bool moreElectroNegative(UINT anum1, UINT anum2) const
convenience function to determine which atom is more electronegative
UINT getMaxAtomicNumber() const
returns the maximum recognized atomic number
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...
std::string getElementName(UINT atomicNumber) const
returns the full element name
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...
#define RDKIT_GRAPHMOL_EXPORT
std::vector< int > INT_VECT
std::map< std::string, UINT > STR_UINT_MAP