10 #ifndef _RD_PERIODIC_TABLE_H 11 #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") anum=6;
84 else if(elementSymbol==
"N") anum=7;
85 else if(elementSymbol==
"O") anum=8;
87 STR_UINT_MAP::const_iterator iter=byname.find(elementSymbol);
88 if(iter!=byname.end())
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 {
108 PRECONDITION(byname.count(elementSymbol),
"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();
123 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
124 return getRcovalent(byname.find(elementSymbol)->second);
133 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
134 return byanum[atomicNumber].Rb0();
137 double getRb0(
const std::string &elementSymbol)
const {
138 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
139 return getRb0(byname.find(elementSymbol)->second);
142 double getRb0(
const char *elementSymbol )
const {
143 return getRb0(std::string(elementSymbol));
148 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
149 return byanum[atomicNumber].DefaultValence();
153 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
165 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
166 return byanum[atomicNumber].ValenceList();
170 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
180 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
181 return byanum[atomicNumber].NumOuterShellElec();
185 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
195 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
196 return byanum[atomicNumber].MostCommonIsotope();
200 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
210 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
211 return byanum[atomicNumber].MostCommonIsotopeMass();
215 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
227 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
228 const std::map<unsigned int,std::pair<double,double> > &m=byanum[atomicNumber].d_isotopeInfoMap;
229 std::map<unsigned int,std::pair<double,double> >::const_iterator item=m.find(isotope);
233 return item->second.first;
238 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
248 PRECONDITION(atomicNumber<byanum.size(),
"Atomic number not found");
249 const std::map<unsigned int,std::pair<double,double> > &m=byanum[atomicNumber].d_isotopeInfoMap;
250 std::map<unsigned int,std::pair<double,double> >::const_iterator item=m.find(isotope);
254 return item->second.second;
259 PRECONDITION(byname.count(elementSymbol),
"Element '" + elementSymbol +
"' not found");
281 PRECONDITION(anum1<byanum.size(),
"Atomic number not found");
282 PRECONDITION(anum2<byanum.size(),
"Atomic number not found");
305 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