11#ifndef _RD_PERIODIC_TABLE_H
12#define _RD_PERIODIC_TABLE_H
56 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
57 double mass = byanum[atomicNumber].Mass();
62 PRECONDITION(byname.count(elementSymbol),
"Element not found");
63 int anum = byname.find(elementSymbol)->second;
64 double mass = byanum[anum].Mass();
74 std::string symb(elementSymbol);
83 if (elementSymbol ==
"C") {
85 }
else if (elementSymbol ==
"N") {
87 }
else if (elementSymbol ==
"O") {
90 auto iter = byname.find(elementSymbol);
91 if (iter != byname.end()) {
95 POSTCONDITION(anum > -1,
"Element '" + elementSymbol +
"' not found");
101 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
102 return byanum[atomicNumber].Symbol();
107 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
108 return byanum[atomicNumber].Name();
113 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
114 return byanum[atomicNumber].Rvdw();
117 double getRvdw(
const std::string &elementSymbol)
const {
119 "Element '" + elementSymbol +
"' not found");
120 return getRvdw(byname.find(elementSymbol)->second);
123 double getRvdw(
const char *elementSymbol)
const {
124 return getRvdw(std::string(elementSymbol));
129 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
130 return byanum[atomicNumber].Rcov();
135 "Element '" + elementSymbol +
"' not found");
136 return getRcovalent(byname.find(elementSymbol)->second);
145 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
146 return byanum[atomicNumber].Rb0();
149 double getRb0(
const std::string &elementSymbol)
const {
151 "Element '" + elementSymbol +
"' not found");
152 return getRb0(byname.find(elementSymbol)->second);
155 double getRb0(
const char *elementSymbol)
const {
156 return getRb0(std::string(elementSymbol));
161 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
162 return byanum[atomicNumber].DefaultValence();
167 "Element '" + elementSymbol +
"' not found");
179 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
180 return byanum[atomicNumber].ValenceList();
185 "Element '" + elementSymbol +
"' not found");
195 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
196 return byanum[atomicNumber].NumOuterShellElec();
201 "Element '" + elementSymbol +
"' not found");
211 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
212 return byanum[atomicNumber].MostCommonIsotope();
217 "Element '" + elementSymbol +
"' not found");
227 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
228 return byanum[atomicNumber].MostCommonIsotopeMass();
233 "Element '" + elementSymbol +
"' not found");
244 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
245 const std::map<unsigned int, std::pair<double, double>> &m =
246 byanum[atomicNumber].d_isotopeInfoMap;
247 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
249 if (item == m.end()) {
252 return item->second.first;
257 UINT isotope)
const {
259 "Element '" + elementSymbol +
"' not found");
269 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
270 const std::map<unsigned int, std::pair<double, double>> &m =
271 byanum[atomicNumber].d_isotopeInfoMap;
272 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
274 if (item == m.end()) {
277 return item->second.second;
282 UINT isotope)
const {
284 "Element '" + elementSymbol +
"' not found");
305 PRECONDITION(anum1 < byanum.size(),
"Atomic number not found");
306 PRECONDITION(anum2 < byanum.size(),
"Atomic number not found");
325 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
326 return byanum[atomicNumber].Row();
331 "Element '" + elementSymbol +
"' not found");
332 return getRow(byname.find(elementSymbol)->second);
336 return getRow(std::string(elementSymbol));
341 static void initInstance();
345 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...
PeriodicTable(const PeriodicTable &)=delete
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
PeriodicTable & operator=(const PeriodicTable &)=delete
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