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)
double getRcovalent(UINT atomicNumber) const
returns the atom's covalent radius
int getDefaultValence(const std::string &elementSymbol) const
double getAbundanceForIsotope(UINT atomicNumber, UINT isotope) const
double getRcovalent(const std::string &elementSymbol) const
int getMostCommonIsotope(const char *elementSymbol) const
const INT_VECT & getValenceList(UINT atomicNumber) const
double getMassForIsotope(const char *elementSymbol, UINT isotope) const
double getMostCommonIsotopeMass(const std::string &elementSymbol) const
double getRb0(UINT atomicNumber) const
returns the atom's bond radius
bool moreElectroNegative(UINT anum1, UINT anum2) const
convenience function to determine which atom is more electronegative
double getAtomicWeight(const std::string &elementSymbol) const
int getDefaultValence(const char *elementSymbol) const
double getMostCommonIsotopeMass(UINT atomicNumber) const
returns the mass of the most common isotope
double getRb0(const std::string &elementSymbol) const
double getAtomicWeight(const char *elementSymbol) const
No user-serviceable parts inside.
double getRvdw(UINT atomicNumber) const
returns the atom's van der Waals radius
double getRcovalent(const char *elementSymbol) const
std::string getElementSymbol(UINT atomicNumber) const
returns the atomic symbol
#define RDKIT_GRAPHMOL_EXPORT
double getAbundanceForIsotope(const std::string &elementSymbol, UINT isotope) const
double getMassForIsotope(UINT atomicNumber, UINT isotope) const
std::map< std::string, UINT > STR_UINT_MAP
std::vector< int > INT_VECT
double getAtomicWeight(UINT atomicNumber) const
returns the atomic weight
double getRvdw(const char *elementSymbol) const
const INT_VECT & getValenceList(const char *elementSymbol) const
int getDefaultValence(UINT atomicNumber) const
returns the atom's default valence
double getRb0(const char *elementSymbol) const
double getAbundanceForIsotope(const char *elementSymbol, UINT isotope) const
const INT_VECT & getValenceList(const std::string &elementSymbol) const
singleton class for retrieving information about atoms
int getNouterElecs(const char *elementSymbol) const
int getNouterElecs(const std::string &elementSymbol) const
#define PRECONDITION(expr, mess)
int getMostCommonIsotope(UINT atomicNumber) const
returns the number of the most common isotope
double getRvdw(const std::string &elementSymbol) const
double getMassForIsotope(const std::string &elementSymbol, UINT isotope) const
RDKIT_STRUCTCHECKER_EXPORT unsigned getAtomicNumber(const std::string symbol)
int getNouterElecs(UINT atomicNumber) const
returns the number of outer shell electrons
int getMostCommonIsotope(const std::string &elementSymbol) const
int getAtomicNumber(const char *elementSymbol) const
returns the atomic number
double getMostCommonIsotopeMass(const char *elementSymbol) const
int getAtomicNumber(const std::string &elementSymbol) const
overload