21#include <boost/algorithm/string.hpp>
43 }
catch (
const std::out_of_range& oor) {
44 throw std::runtime_error(
"Nuclearcharge of element " + name +
56 }
catch (
const std::out_of_range& oor) {
57 throw std::runtime_error(
"Elementnumber of element " + name +
69 return Mass_.at(name);
70 }
catch (
const std::out_of_range& oor) {
71 throw std::runtime_error(
"Mass of element " + name +
" not found.");
81 throw std::runtime_error(
"Element not found in VdWChelpG map " + name);
91 if (
VdWMK_.count(name) == 0) {
92 throw std::runtime_error(
"Element not found in VdWMP map " + name);
103 throw std::runtime_error(
"Element not found in ElPolarizability map " +
116 if (!unit.compare(
"bohr")) {
119 if (!unit.compare(
"nm")) {
122 if (!unit.compare(
"ang")) {
123 return CovRad_.find(name)->second;
125 throw std::runtime_error(
"Must specify appropriate units " + unit +
158 std::string name_upper = boost::to_upper_copy<std::string>(fullname);
172 if (closestMatch.second > tolerance) {
180 if (closestMatch.second > tolerance) {
181 throw std::runtime_error(
182 "In attempt to determine if mass is associated "
183 " with an element the mass exceeds tolerance of a possible match");
185 return closestMatch.first;
198 std::string eleShort =
"H";
199 double diff = std::fabs(mass -
Mass_[eleShort]);
200 for (
const auto& ele_pr :
Mass_) {
201 if (std::fabs(ele_pr.second - mass) < diff) {
202 eleShort = ele_pr.first;
203 diff = std::fabs(ele_pr.second - mass);
206 return std::pair<std::string, double>(eleShort, diff);
211 Mass_[
"H"] = 1.00794;
212 Mass_[
"He"] = 4.002602;
214 Mass_[
"Be"] = 9.012182;
216 Mass_[
"C"] = 12.0107;
217 Mass_[
"N"] = 14.00674;
218 Mass_[
"O"] = 15.9994;
219 Mass_[
"F"] = 18.9984032;
220 Mass_[
"Ne"] = 20.1797;
221 Mass_[
"Na"] = 22.989770;
222 Mass_[
"Mg"] = 24.3050;
223 Mass_[
"Al"] = 26.981538;
224 Mass_[
"Si"] = 28.0855;
225 Mass_[
"P"] = 30.973761;
227 Mass_[
"Cl"] = 35.4527;
228 Mass_[
"Ar"] = 39.948;
230 Mass_[
"Ca"] = 40.078;
231 Mass_[
"Sc"] = 44.956;
232 Mass_[
"Ti"] = 47.867;
234 Mass_[
"Cr"] = 51.996;
235 Mass_[
"Mn"] = 54.938;
236 Mass_[
"Fe"] = 55.845;
237 Mass_[
"Co"] = 58.933;
238 Mass_[
"Ni"] = 58.693;
239 Mass_[
"Cu"] = 63.546;
241 Mass_[
"Ga"] = 69.723;
242 Mass_[
"Ge"] = 72.630;
243 Mass_[
"As"] = 74.922;
244 Mass_[
"Se"] = 78.971;
246 Mass_[
"Kr"] = 83.798;
247 Mass_[
"Rb"] = 85.468;
250 Mass_[
"Zr"] = 91.224;
251 Mass_[
"Nb"] = 92.906;
254 Mass_[
"Ru"] = 101.07;
255 Mass_[
"Rh"] = 102.91;
256 Mass_[
"Pd"] = 106.42;
257 Mass_[
"Ag"] = 107.8682;
258 Mass_[
"Cd"] = 112.41;
259 Mass_[
"In"] = 114.82;
260 Mass_[
"Sn"] = 118.71;
261 Mass_[
"Sb"] = 121.76;
262 Mass_[
"Te"] = 127.60;
264 Mass_[
"Xe"] = 131.29;
265 Mass_[
"Cs"] = 132.91;
266 Mass_[
"Ba"] = 137.33;
267 Mass_[
"Hf"] = 178.49;
268 Mass_[
"Ta"] = 180.49;
270 Mass_[
"Re"] = 186.21;
271 Mass_[
"Os"] = 190.23;
272 Mass_[
"Ir"] = 192.22;
273 Mass_[
"Pt"] = 195.08;
274 Mass_[
"Au"] = 196.97;
275 Mass_[
"Hg"] = 200.59;
276 Mass_[
"Tl"] = 204.38;
278 Mass_[
"Bi"] = 208.98;
base class for all analysis tools