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");
313 static void initInstance();
317 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
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
static PeriodicTable * getTable()
returns a pointer to the singleton PeriodicTable
#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
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