10 #ifndef _RD_PERIODIC_TABLE_H
11 #define _RD_PERIODIC_TABLE_H
53 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
54 double mass = byanum[atomicNumber].Mass();
59 PRECONDITION(byname.count(elementSymbol),
"Element not found");
60 int anum = byname.find(elementSymbol)->second;
61 double mass = byanum[anum].Mass();
71 std::string symb(elementSymbol);
80 if (elementSymbol ==
"C")
82 else if (elementSymbol ==
"N")
84 else if (elementSymbol ==
"O")
87 STR_UINT_MAP::const_iterator iter = byname.find(elementSymbol);
88 if (iter != byname.end()) anum = iter->second;
90 POSTCONDITION(anum > -1,
"Element '" + elementSymbol +
"' not found");
96 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
97 return byanum[atomicNumber].Symbol();
102 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
103 return byanum[atomicNumber].Rvdw();
106 double getRvdw(
const std::string &elementSymbol)
const {
108 "Element '" + elementSymbol +
"' not found");
109 return getRvdw(byname.find(elementSymbol)->second);
112 double getRvdw(
const char *elementSymbol)
const {
113 return getRvdw(std::string(elementSymbol));
118 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
119 return byanum[atomicNumber].Rcov();
124 "Element '" + elementSymbol +
"' not found");
125 return getRcovalent(byname.find(elementSymbol)->second);
134 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
135 return byanum[atomicNumber].Rb0();
138 double getRb0(
const std::string &elementSymbol)
const {
140 "Element '" + elementSymbol +
"' not found");
141 return getRb0(byname.find(elementSymbol)->second);
144 double getRb0(
const char *elementSymbol)
const {
145 return getRb0(std::string(elementSymbol));
150 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
151 return byanum[atomicNumber].DefaultValence();
156 "Element '" + elementSymbol +
"' not found");
168 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
169 return byanum[atomicNumber].ValenceList();
174 "Element '" + elementSymbol +
"' not found");
184 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
185 return byanum[atomicNumber].NumOuterShellElec();
190 "Element '" + elementSymbol +
"' not found");
200 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
201 return byanum[atomicNumber].MostCommonIsotope();
206 "Element '" + elementSymbol +
"' not found");
216 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
217 return byanum[atomicNumber].MostCommonIsotopeMass();
222 "Element '" + elementSymbol +
"' not found");
233 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
234 const std::map<unsigned int, std::pair<double, double> > &m =
235 byanum[atomicNumber].d_isotopeInfoMap;
236 std::map<unsigned int, std::pair<double, double> >::const_iterator item =
238 if (item == m.end()) {
241 return item->second.first;
246 UINT isotope)
const {
248 "Element '" + elementSymbol +
"' not found");
258 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
259 const std::map<unsigned int, std::pair<double, double> > &m =
260 byanum[atomicNumber].d_isotopeInfoMap;
261 std::map<unsigned int, std::pair<double, double> >::const_iterator item =
263 if (item == m.end()) {
266 return item->second.second;
271 UINT isotope)
const {
273 "Element '" + elementSymbol +
"' not found");
294 PRECONDITION(anum1 < byanum.size(),
"Atomic number not found");
295 PRECONDITION(anum2 < byanum.size(),
"Atomic number not found");
316 std::vector<atomicData> byanum;
#define POSTCONDITION(expr, mess)
double getRvdw(const char *elementSymbol) const
double getRb0(const char *elementSymbol) const
bool moreElectroNegative(UINT anum1, UINT anum2) const
convenience function to determine which atom is more electronegative
int getDefaultValence(UINT atomicNumber) const
returns the atom's default valence
double getAbundanceForIsotope(const char *elementSymbol, UINT isotope) const
int getNouterElecs(UINT atomicNumber) const
returns the number of outer shell electrons
double getAbundanceForIsotope(UINT atomicNumber, UINT isotope) const
int getNouterElecs(const std::string &elementSymbol) const
double getAtomicWeight(const std::string &elementSymbol) const
double getRcovalent(const std::string &elementSymbol) const
int getDefaultValence(const std::string &elementSymbol) const
double getMassForIsotope(const std::string &elementSymbol, UINT isotope) const
int getAtomicNumber(const char *elementSymbol) const
returns the atomic number
double getAtomicWeight(const char *elementSymbol) const
double getRvdw(const std::string &elementSymbol) const
No user-serviceable parts inside.
double getMostCommonIsotopeMass(UINT atomicNumber) const
returns the mass of the most common isotope
double getMostCommonIsotopeMass(const char *elementSymbol) const
int getMostCommonIsotope(const char *elementSymbol) const
int getMostCommonIsotope(UINT atomicNumber) const
returns the number of the most common isotope
int getNouterElecs(const char *elementSymbol) const
std::map< std::string, UINT > STR_UINT_MAP
std::string getElementSymbol(UINT atomicNumber) const
returns the atomic symbol
std::vector< int > INT_VECT
int getAtomicNumber(const std::string &elementSymbol) const
overload
double getMostCommonIsotopeMass(const std::string &elementSymbol) const
Includes a bunch of functionality for handling Atom and Bond queries.
double getMassForIsotope(UINT atomicNumber, UINT isotope) const
double getAtomicWeight(UINT atomicNumber) const
returns the atomic weight
singleton class for retrieving information about atoms
double getRcovalent(const char *elementSymbol) const
double getRvdw(UINT atomicNumber) const
returns the atom's van der Waals radius
static PeriodicTable * getTable()
returns a pointer to the singleton PeriodicTable
int getDefaultValence(const char *elementSymbol) const
double getAbundanceForIsotope(const std::string &elementSymbol, UINT isotope) const
const INT_VECT & getValenceList(const std::string &elementSymbol) const
double getRb0(const std::string &elementSymbol) const
#define PRECONDITION(expr, mess)
int getMostCommonIsotope(const std::string &elementSymbol) const
const INT_VECT & getValenceList(const char *elementSymbol) const
double getRcovalent(UINT atomicNumber) const
returns the atom's covalent radius
const INT_VECT & getValenceList(UINT atomicNumber) const
double getRb0(UINT atomicNumber) const
returns the atom's bond radius
double getMassForIsotope(const char *elementSymbol, UINT isotope) const