65 {
"H",
"hydrogen", 1.008},
66 {
"He",
"helium", 4.002602},
67 {
"Li",
"lithium", 6.94},
68 {
"Be",
"beryllium", 9.0121831},
69 {
"B",
"boron", 10.81},
70 {
"C",
"carbon", 12.011},
71 {
"N",
"nitrogen", 14.007},
72 {
"O",
"oxygen", 15.999},
73 {
"F",
"fluorine", 18.998403163},
74 {
"Ne",
"neon", 20.1797},
75 {
"Na",
"sodium", 22.98976928},
76 {
"Mg",
"magnesium", 24.305},
77 {
"Al",
"aluminum", 26.9815384},
78 {
"Si",
"silicon", 28.085},
79 {
"P",
"phosphorus", 30.973761998},
80 {
"S",
"sulfur", 32.06},
81 {
"Cl",
"chlorine", 35.45},
82 {
"Ar",
"argon", 39.95},
83 {
"K",
"potassium", 39.0983},
84 {
"Ca",
"calcium", 40.078},
85 {
"Sc",
"scandium", 44.955908},
86 {
"Ti",
"titanium", 47.867},
87 {
"V",
"vanadium", 50.9415},
88 {
"Cr",
"chromium", 51.9961},
89 {
"Mn",
"manganese", 54.938043},
90 {
"Fe",
"iron", 55.845},
91 {
"Co",
"cobalt", 58.933194},
92 {
"Ni",
"nickel", 58.6934},
93 {
"Cu",
"copper", 63.546},
94 {
"Zn",
"zinc", 65.38},
95 {
"Ga",
"gallium", 69.723},
96 {
"Ge",
"germanium", 72.630},
97 {
"As",
"arsenic", 74.921595},
98 {
"Se",
"selenium", 78.971},
99 {
"Br",
"bromine", 79.904},
100 {
"Kr",
"krypton", 83.798},
101 {
"Rb",
"rubidium", 85.4678},
102 {
"Sr",
"strontium", 87.62},
103 {
"Y",
"yttrium", 88.90584},
104 {
"Zr",
"zirconium", 91.224},
105 {
"Nb",
"nobelium", 92.90637},
106 {
"Mo",
"molybdenum", 95.95},
107 {
"Tc",
"technetium", -1.0},
108 {
"Ru",
"ruthenium", 101.07},
109 {
"Rh",
"rhodium", 102.90549},
110 {
"Pd",
"palladium", 106.42},
111 {
"Ag",
"silver", 107.8682},
112 {
"Cd",
"cadmium", 112.414},
113 {
"In",
"indium", 114.818},
114 {
"Sn",
"tin", 118.710},
115 {
"Sb",
"antimony", 121.760},
116 {
"Te",
"tellurium", 127.60 },
117 {
"I",
"iodine", 126.90447},
118 {
"Xe",
"xenon", 131.293},
119 {
"Cs",
"cesium", 132.90545196},
120 {
"Ba",
"barium", 137.327},
121 {
"La",
"lanthanum", 138.90547},
122 {
"Ce",
"cerium", 140.116},
123 {
"Pr",
"praseodymium", 140.90766},
124 {
"Nd",
"neodymium", 144.242},
125 {
"Pm",
"promethium", -1.0},
126 {
"Sm",
"samarium", 150.36},
127 {
"Eu",
"europium", 151.964},
128 {
"Gd",
"gadolinium", 157.25},
129 {
"Tb",
"terbium", 158.925354},
130 {
"Dy",
"dysprosium", 162.500},
131 {
"Ho",
"holmium", 164.930328},
132 {
"Er",
"erbium", 167.259},
133 {
"Tm",
"thulium", 168.934218},
134 {
"Yb",
"ytterbium", 173.045},
135 {
"Lu",
"lutetium", 174.9668},
136 {
"Hf",
"hafnium", 178.49},
137 {
"Ta",
"tantalum", 180.94788},
138 {
"W",
"tungsten", 183.84},
139 {
"Re",
"rhenium", 186.207},
140 {
"Os",
"osmium", 190.23 },
141 {
"Ir",
"iridium", 192.217},
142 {
"Pt",
"platinum", 195.084},
143 {
"Au",
"gold", 196.966570},
144 {
"Hg",
"mercury", 200.592},
145 {
"Tl",
"thallium", 204.38},
146 {
"Pb",
"lead", 207.2 },
147 {
"Bi",
"bismuth", 208.98040},
148 {
"Po",
"polonium", -1.0},
149 {
"At",
"astatine", -1.0},
150 {
"Rn",
"radon", -1.0},
151 {
"Fr",
"francium", -1.0},
152 {
"Ra",
"radium", -1.0},
153 {
"Ac",
"actinium", -1.0},
154 {
"Th",
"thorium", 232.0377},
155 {
"Pa",
"protactinium", 231.03588},
156 {
"U",
"uranium", 238.02891},
157 {
"Np",
"neptunium", -1.0},
158 {
"Pu",
"plutonium", -1.0},
159 {
"Am",
"americium", -1.0},
160 {
"Cm",
"curium", -1.0},
161 {
"Bk",
"berkelium", -1.0},
162 {
"Cf",
"californium", -1.0},
163 {
"Es",
"einsteinium", -1.0},
164 {
"Fm",
"fermium", -1.0},
165 {
"Md",
"mendelevium", -1.0},
166 {
"No",
"nobelium", -1.0},
167 {
"Lr",
"lawrencium", -1.0},
168 {
"Rf",
"rutherfordium", -1.0},
169 {
"Db",
"dubnium", -1.0},
170 {
"Sg",
"seaborgium", -1.0},
171 {
"Bh",
"bohrium", -1.0},
172 {
"Hs",
"hassium", -1.0},
173 {
"Mt",
"meitnerium", -1.0},
174 {
"Ds",
"darmstadtium", -1.0},
175 {
"Rg",
"roentgenium", -1.0},
176 {
"Cn",
"copernicium", -1.0},
177 {
"Nh",
"nihonium", -1.0},
178 {
"Gl",
"flerovium", -1.0},
179 {
"Mc",
"moscovium", -1.0},
180 {
"Lv",
"livermorium", -1.0},
181 {
"Ts",
"tennessine", -1.0},
182 {
"Og",
"oganesson", -1.0},
197 {
"D",
"deuterium", 2.0141017781, 1},
198 {
"Tr",
"tritium", 3.0160492820, 1},
204vector<string> elementVectorsFromSymbols() {
205 vector<string> values;
207 values.push_back(atom.symbol);
213 const static vector<string> values = elementVectorsFromSymbols();
219vector<string> elementVectorsFromNames() {
220 vector<string> values;
222 values.push_back(atom.fullName);
228 const static vector<string> values = elementVectorsFromNames();
232map<string, double> mapAtomicWeights() {
233 map<string, double> symMap;
236 symMap.emplace(atom.symbol, atom.atomicWeight);
237 symMap.emplace(atom.fullName, atom.atomicWeight);
240 symMap.emplace(isotope.symbol, isotope.atomicWeight);
241 symMap.emplace(isotope.fullName, isotope.atomicWeight);
247 const static map<string, double> symMap = mapAtomicWeights();
254 double elementWeight = 0.0;
256 auto search = elementMap.find(symbol);
257 if (search != elementMap.end()) {
258 elementWeight = search->second;
261 search = elementMap.find(name);
262 if (search != elementMap.end()) {
263 elementWeight = search->second;
266 if (elementWeight > 0.0) {
267 return elementWeight;
268 }
else if (elementWeight < 0.0) {
270 "element '{}' has no stable isotopes", ename);
272 throw CanteraError(
"getElementWeight",
"element not found: " + ename);
278 if (atomicNumber > num || atomicNumber < 1) {
279 throw IndexError(
"getElementWeight",
"atomicWeightTable", atomicNumber, num);
282 if (elementWeight < 0.0) {
284 "element '{}' has no stable isotopes",
getElementName(atomicNumber));
286 return elementWeight;
293 if (name == atom.fullName) {
298 if (name == atom.fullName) {
302 throw CanteraError(
"getElementSymbol",
"element not found: " + ename);
308 if (atomicNumber > num || atomicNumber < 1) {
309 throw IndexError(
"getElementSymbol",
"atomicWeightTable", atomicNumber, num);
318 if (symbol == atom.symbol) {
319 return atom.fullName;
323 if (symbol == atom.symbol) {
324 return atom.fullName;
327 throw CanteraError(
"getElementName",
"element not found: " + ename);
333 if (atomicNumber > num || atomicNumber < 1) {
334 throw IndexError(
"getElementName",
"atomicWeightTable", atomicNumber, num);
345 for (
size_t i = 0; i < numElements; i++) {
347 return static_cast<int>(i) + 1;
349 return static_cast<int>(i) + 1;
352 for (
size_t i = 0; i < numIsotopes; i++) {
359 throw CanteraError(
"getAtomicNumber",
"element not found: " + ename);
Contains the getElementWeight function and the definitions of element constraint types.
Base class for exceptions thrown by Cantera classes.
An array index is out of range.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
string trimCopy(const string &input)
Trim.
string toLowerCopy(const string &input)
Convert to lower case.
const double Avogadro
Avogadro's Number [number/kmol].
const double ElectronMass
Electron Mass [kg].
Namespace for the Cantera kernel.
double getElementWeight(const string &ename)
Get the atomic weight of an element.
static vector< atomicWeightData > atomicWeightTable
atomicWeightTable is a vector containing the atomic weights database.
int getAtomicNumber(const string &ename)
Get the atomic number for an element.
const vector< string > & elementNames()
Get a vector of the names of the elements defined in Cantera.
static vector< isotopeWeightData > isotopeWeightTable
isotopeWeightTable is a vector containing the atomic weights database.
string getElementName(const string &ename)
Get the name of an element.
size_t numElementsDefined()
Get the number of named elements defined in Cantera.
string getElementSymbol(const string &ename)
Get the symbol for an element.
const map< string, double > & elementWeights()
Get a map with the element and isotope symbols and names as keys and weights as values.
const vector< string > & elementSymbols()
Get a vector of the atomic symbols of the elements defined in Cantera.
size_t numIsotopesDefined()
Get the number of named isotopes defined in Cantera.
Contains declarations for string manipulation functions within Cantera.
Database for atomic weights.
string fullName
Element full name, first letter lowercase.
string symbol
Element symbol, first letter capitalized.
double atomicWeight
Element atomic weight in kg / kg-mol, if known. -1 if no stable isotope.
Database for named isotopic weights.
int atomicNumber
Isotope atomic number.
string fullName
Isotope full name, first letter lowercase.
string symbol
Isotope symbol, first letter capitalized.
double atomicWeight
Isotope atomic weight in kg / kg-mol.