18 static double _weights[] = {
19 1.00797, 4.0026, 6.939, 9.01220, 10.811,
20 12.01115, 14.0067, 15.9994, 18.9984, 20.183, 22.9898,
21 24.312, 26.9815, 28.086, 30.9738, 32.064,
22 35.453, 39.948, 39.102, 40.08, 44.956,
23 47.9, 50.942, 51.996, 54.938, 55.847,
24 58.9332, 58.71, 63.54, 65.37, 69.72,
25 72.59, 74.9216, 78.96, 79.9009, 83.8,
26 85.47, 87.62, 88.905, 91.22, 92.9064,
27 95.94, 98, 101.07, 102.906, 106.42,
28 107.868, 112.41, 114.82, 118.71, 121.75,
29 127.6, 126.905, 131.29, 132.905, 137.33,
30 138.906, 140.12, 140.908, 144.24, 145,
31 150.36, 151.96, 157.25, 158.925, 162.5,
32 164.93, 167.26, 168.934, 173.04, 174.967,
33 178.49, 180.948, 183.85, 186.207, 190.2,
34 192.22, 195.08, 196.967, 200.59, 204.383,
35 207.2, 208.98, 209, 210, 222,
36 223, 226.025, 227.028, 232.038, 231.036,
37 238.029, 237.048, 244, 243, 247,
38 247, 251, 252, 257, 258,
39 259, 269, 2.0141, 5.45e-4, -1.0
44 static char _symbols[][3] = {
45 "H",
"He",
"Li",
"Be",
"B",
46 "C",
"N",
"O",
"F",
"Ne",
"Na",
47 "Mg",
"Al",
"Si",
"P",
"S",
48 "Cl",
"Ar",
"K",
"Ca",
"Sc",
49 "Ti",
"V",
"Cr",
"Mn",
"Fe",
50 "Co",
"Ni",
"Cu",
"Zn",
"Ga",
51 "Ge",
"As",
"Se",
"Br",
"Kr",
52 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
53 "Mo",
"Tc",
"Ru",
"Rh",
"Pd",
54 "Ag",
"Cd",
"In",
"Sn",
"Sb",
55 "Te",
"I",
"Xe",
"Cs",
"Ba",
56 "La",
"Ce",
"Pr",
"Nd",
"Pm",
57 "Sm",
"Eu",
"Gd",
"Tb",
"Dy",
58 "Ho",
"Er",
"Tm",
"Yb",
"Lu",
59 "Hf",
"Ta",
"W",
"Re",
"Os",
60 "Ir",
"Pt",
"Au",
"Hg",
"Tl",
61 "Pb",
"Bi",
"Po",
"At",
"Rn",
62 "Fr",
"Ra",
"Ac",
"Th",
"Pa",
63 "U",
"Np",
"Pu",
"Am",
"Cm",
64 "Bk",
"Cf",
"Ei",
"Fm",
"Md",
65 "No",
"Lw",
"D",
"E",
"!"
92 const int MAX_NUM = 200;
94 for (n = 0; n < MAX_NUM; n++) {
95 if (_symbols[n][0] ==
'!') {
98 weights[_symbols[n]] = _weights[n];
102 void writeKnownElements(ostream& s,
string fmt)
105 const int MAX_NUM = 200;
108 for (n = 0; n < MAX_NUM; n++) {
109 if (_symbols[n][0] ==
'!') {
112 s <<
" " << string(_symbols[n]) <<
"/" << _weights[n] <<
"/" << endl;
114 }
else if (fmt ==
"XML") {
115 s <<
"<known_elements>" << endl;
116 for (n = 0; n < MAX_NUM; n++) {
117 if (_symbols[n][0] ==
'!') {
120 s <<
" <element>" << _symbols[n] <<
"<wt>"
121 << _weights[n] <<
"</wt></element>" << endl;
123 s <<
"</known_elements>" << endl;