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()) {
93 POSTCONDITION(anum > -1,
"Element '" + elementSymbol +
"' not found");
99 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
100 return byanum[atomicNumber].Symbol();
105 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
106 return byanum[atomicNumber].Rvdw();
109 double getRvdw(
const std::string &elementSymbol)
const {
111 "Element '" + elementSymbol +
"' not found");
112 return getRvdw(byname.find(elementSymbol)->second);
115 double getRvdw(
const char *elementSymbol)
const {
116 return getRvdw(std::string(elementSymbol));
121 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
122 return byanum[atomicNumber].Rcov();
127 "Element '" + elementSymbol +
"' not found");
128 return getRcovalent(byname.find(elementSymbol)->second);
132 return getRcovalent(std::string(elementSymbol));
137 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
138 return byanum[atomicNumber].Rb0();
141 double getRb0(
const std::string &elementSymbol)
const {
143 "Element '" + elementSymbol +
"' not found");
144 return getRb0(byname.find(elementSymbol)->second);
147 double getRb0(
const char *elementSymbol)
const {
148 return getRb0(std::string(elementSymbol));
153 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
154 return byanum[atomicNumber].DefaultValence();
159 "Element '" + elementSymbol +
"' not found");
160 return getDefaultValence(byname.find(elementSymbol)->second);
164 return getDefaultValence(std::string(elementSymbol));
171 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
172 return byanum[atomicNumber].ValenceList();
177 "Element '" + elementSymbol +
"' not found");
178 return getValenceList(byname.find(elementSymbol)->second);
182 return getValenceList(std::string(elementSymbol));
187 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
188 return byanum[atomicNumber].NumOuterShellElec();
193 "Element '" + elementSymbol +
"' not found");
194 return getNouterElecs(byname.find(elementSymbol)->second);
198 return getNouterElecs(std::string(elementSymbol));
203 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
204 return byanum[atomicNumber].MostCommonIsotope();
209 "Element '" + elementSymbol +
"' not found");
210 return getMostCommonIsotope(byname.find(elementSymbol)->second);
214 return getMostCommonIsotope(std::string(elementSymbol));
219 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
220 return byanum[atomicNumber].MostCommonIsotopeMass();
225 "Element '" + elementSymbol +
"' not found");
226 return getMostCommonIsotopeMass(byname.find(elementSymbol)->second);
230 return getMostCommonIsotopeMass(std::string(elementSymbol));
236 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
237 const std::map<unsigned int, std::pair<double, double>> &m =
238 byanum[atomicNumber].d_isotopeInfoMap;
239 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
241 if (item == m.end()) {
244 return item->second.first;
249 UINT isotope)
const {
251 "Element '" + elementSymbol +
"' not found");
252 return getMassForIsotope(byname.find(elementSymbol)->second, isotope);
256 return getMassForIsotope(std::string(elementSymbol), isotope);
261 PRECONDITION(atomicNumber < byanum.size(),
"Atomic number not found");
262 const std::map<unsigned int, std::pair<double, double>> &m =
263 byanum[atomicNumber].d_isotopeInfoMap;
264 std::map<unsigned int, std::pair<double, double>>::const_iterator item =
266 if (item == m.end()) {
269 return item->second.second;
274 UINT isotope)
const {
276 "Element '" + elementSymbol +
"' not found");
277 return getAbundanceForIsotope(byname.find(elementSymbol)->second, isotope);
281 return getAbundanceForIsotope(std::string(elementSymbol), isotope);
297 PRECONDITION(anum1 < byanum.size(),
"Atomic number not found");
298 PRECONDITION(anum2 < byanum.size(),
"Atomic number not found");
300 UINT ne1 = getNouterElecs(anum1);
301 UINT ne2 = getNouterElecs(anum2);
316 static void initInstance();
320 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
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
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...
double getMostCommonIsotopeMass(const std::string &elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
double getRb0(UINT atomicNumber) const
returns the atom's bond radius
static PeriodicTable * getTable()
returns a pointer to the singleton PeriodicTable
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...
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...
double getMassForIsotope(const char *elementSymbol, UINT isotope) 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
const INT_VECT & getValenceList(UINT atomicNumber) const
bool moreElectroNegative(UINT anum1, UINT anum2) const
convenience function to determine which atom is more electronegative
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...
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...
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...
const INT_VECT & getValenceList(const char *elementSymbol) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
#define RDKIT_GRAPHMOL_EXPORT
RDKIT_STRUCTCHECKER_EXPORT unsigned getAtomicNumber(const std::string symbol)
std::vector< int > INT_VECT
std::map< std::string, UINT > STR_UINT_MAP