<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>MPQC: atominfo.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <h1>atominfo.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span> <a name="l00002"></a>00002 <span class="comment">// atominfo.h</span> <a name="l00003"></a>00003 <span class="comment">//</span> <a name="l00004"></a>00004 <span class="comment">// Copyright (C) 1996 Limit Point Systems, Inc.</span> <a name="l00005"></a>00005 <span class="comment">//</span> <a name="l00006"></a>00006 <span class="comment">// Author: Curtis Janssen <cljanss@limitpt.com></span> <a name="l00007"></a>00007 <span class="comment">// Maintainer: LPS</span> <a name="l00008"></a>00008 <span class="comment">//</span> <a name="l00009"></a>00009 <span class="comment">// This file is part of the SC Toolkit.</span> <a name="l00010"></a>00010 <span class="comment">//</span> <a name="l00011"></a>00011 <span class="comment">// The SC Toolkit is free software; you can redistribute it and/or modify</span> <a name="l00012"></a>00012 <span class="comment">// it under the terms of the GNU Library General Public License as published by</span> <a name="l00013"></a>00013 <span class="comment">// the Free Software Foundation; either version 2, or (at your option)</span> <a name="l00014"></a>00014 <span class="comment">// any later version.</span> <a name="l00015"></a>00015 <span class="comment">//</span> <a name="l00016"></a>00016 <span class="comment">// The SC Toolkit is distributed in the hope that it will be useful,</span> <a name="l00017"></a>00017 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00018"></a>00018 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00019"></a>00019 <span class="comment">// GNU Library General Public License for more details.</span> <a name="l00020"></a>00020 <span class="comment">//</span> <a name="l00021"></a>00021 <span class="comment">// You should have received a copy of the GNU Library General Public License</span> <a name="l00022"></a>00022 <span class="comment">// along with the SC Toolkit; see the file COPYING.LIB. If not, write to</span> <a name="l00023"></a>00023 <span class="comment">// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00024"></a>00024 <span class="comment">//</span> <a name="l00025"></a>00025 <span class="comment">// The U.S. Government is granted a limited license as per AL 91-7.</span> <a name="l00026"></a>00026 <span class="comment">//</span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="preprocessor">#ifndef _chemistry_molecule_atominfo_h</span> <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define _chemistry_molecule_atominfo_h</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#include <string></span> <a name="l00032"></a>00032 <span class="preprocessor">#include <map></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <vector></span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="preprocessor">#include <util/class/class.h></span> <a name="l00036"></a>00036 <span class="preprocessor">#include <util/keyval/keyval.h></span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="keyword">namespace </span>sc { <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="keyword">class </span>Units; <a name="l00041"></a>00041 <a name="l00045"></a><a class="code" href="classsc_1_1AtomInfo.html">00045</a> <span class="keyword">class </span><a class="code" href="classsc_1_1AtomInfo.html" title="The AtomInfo class provides information about atoms.">AtomInfo</a>: <span class="keyword">public</span> <a class="code" href="classsc_1_1SavableState.html" title="Base class for objects that can save/restore state.">SavableState</a> { <a name="l00046"></a>00046 <span class="keyword">private</span>: <a name="l00047"></a>00047 <span class="keyword">enum</span> { Nelement = 118, DefaultZ = 0 }; <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="keyword">struct </span>atom <a name="l00050"></a>00050 { <a name="l00051"></a>00051 <span class="keywordtype">int</span> Z; <a name="l00052"></a>00052 <span class="keywordtype">char</span> *<a class="code" href="classsc_1_1AtomInfo.html#b73bc35d761adf7679a9299a677c5ad1" title="This returns the full name of the element.">name</a>; <a name="l00053"></a>00053 <span class="keywordtype">char</span> *<a class="code" href="classsc_1_1AtomInfo.html#c258cee9997782f4193ef6f70a2a0514" title="This returns the symbol for the element.">symbol</a>; <a name="l00054"></a>00054 }; <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keyword">struct </span>atom elements_[Nelement]; <a name="l00057"></a>00057 <a name="l00058"></a>00058 std::map<std::string,int> name_to_Z_; <a name="l00059"></a>00059 std::map<std::string,int> symbol_to_Z_; <a name="l00060"></a>00060 std::map<int,std::string> Z_to_names_; <a name="l00061"></a>00061 std::map<int,std::string> Z_to_symbols_; <a name="l00062"></a>00062 std::map<int,double> Z_to_mass_; <a name="l00063"></a>00063 std::map<int,double> Z_to_atomic_radius_; <a name="l00064"></a>00064 std::map<int,double> Z_to_vdw_radius_; <a name="l00065"></a>00065 std::map<int,double> Z_to_bragg_radius_; <a name="l00066"></a>00066 std::map<int,double> Z_to_maxprob_radius_; <a name="l00067"></a>00067 std::map<int,std::vector<double> > Z_to_rgb_; <a name="l00068"></a>00068 std::map<int,double> Z_to_ip_; <a name="l00069"></a>00069 <span class="keywordtype">double</span> atomic_radius_scale_; <a name="l00070"></a>00070 <span class="keywordtype">double</span> vdw_radius_scale_; <a name="l00071"></a>00071 <span class="keywordtype">double</span> bragg_radius_scale_; <a name="l00072"></a>00072 <span class="keywordtype">double</span> maxprob_radius_scale_; <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="keywordtype">char</span> *overridden_values_; <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="keywordtype">void</span> load_library_values(); <a name="l00077"></a>00077 <span class="keywordtype">void</span> override_library_values(<span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<KeyVal></a> &keyval); <a name="l00078"></a>00078 <span class="keywordtype">void</span> load_values(<span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<KeyVal></a>& keyval, <span class="keywordtype">int</span> <span class="keyword">override</span>); <a name="l00079"></a>00079 <span class="keywordtype">void</span> load_values(std::map<int,double>&, <a name="l00080"></a>00080 <span class="keywordtype">double</span> *scale, <span class="keyword">const</span> <span class="keywordtype">char</span> *keyword, <a name="l00081"></a>00081 <span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<KeyVal></a> &keyval, <span class="keywordtype">int</span> <span class="keyword">override</span>, <a name="l00082"></a>00082 <span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<Units></a> &); <a name="l00083"></a>00083 <span class="keywordtype">void</span> load_values(std::map<<span class="keywordtype">int</span>,std::vector<double> >&, <a name="l00084"></a>00084 <span class="keyword">const</span> <span class="keywordtype">char</span> *keyword, <a name="l00085"></a>00085 <span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<KeyVal></a> &keyval, <span class="keywordtype">int</span> <span class="keyword">override</span>); <a name="l00086"></a>00086 <span class="keywordtype">void</span> add_overridden_value(<span class="keyword">const</span> <span class="keywordtype">char</span> *assignment); <a name="l00087"></a>00087 <span class="keywordtype">void</span> initialize_names(); <a name="l00088"></a>00088 <span class="keywordtype">double</span> lookup_value(<span class="keyword">const</span> std::map<int,double>& values, <span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00089"></a>00089 <span class="keywordtype">double</span> lookup_array_value(<span class="keyword">const</span> std::map<<span class="keywordtype">int</span>,std::vector<double> >& values, <a name="l00090"></a>00090 <span class="keywordtype">int</span> Z, <span class="keywordtype">int</span> i) <span class="keyword">const</span>; <a name="l00091"></a>00091 <span class="keyword">public</span>: <a name="l00092"></a>00092 <a class="code" href="classsc_1_1AtomInfo.html" title="The AtomInfo class provides information about atoms.">AtomInfo</a>(); <a name="l00093"></a>00093 <a name="l00173"></a>00173 <a class="code" href="classsc_1_1AtomInfo.html" title="The AtomInfo class provides information about atoms.">AtomInfo</a>(<span class="keyword">const</span> <a class="code" href="classsc_1_1Ref.html">Ref<KeyVal></a>&); <a name="l00174"></a>00174 <a class="code" href="classsc_1_1AtomInfo.html" title="The AtomInfo class provides information about atoms.">AtomInfo</a>(<a class="code" href="classsc_1_1StateIn.html" title="Restores objects that derive from SavableState.">StateIn</a>&); <a name="l00175"></a>00175 ~<a class="code" href="classsc_1_1AtomInfo.html" title="The AtomInfo class provides information about atoms.">AtomInfo</a>(); <a name="l00176"></a>00176 <span class="keywordtype">void</span> <a class="code" href="classsc_1_1AtomInfo.html#43bb1c9eaa4538c10680b4d186a722c7" title="Save the base classes (with save_data_state) and the members in the same order that...">save_data_state</a>(<a class="code" href="classsc_1_1StateOut.html" title="Serializes objects that derive from SavableState.">StateOut</a>& s); <a name="l00177"></a>00177 <a name="l00179"></a>00179 <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#6a213236e605e687253355c3650d4bd1" title="These return various measures of the atom&#39;s radius.">vdw_radius</a>(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00180"></a>00180 <span class="keywordtype">double</span> bragg_radius(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00181"></a>00181 <span class="keywordtype">double</span> atomic_radius(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00182"></a>00182 <span class="keywordtype">double</span> maxprob_radius(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00183"></a>00183 <a name="l00185"></a>00185 <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#39bfbe37378d523c63d14ac4e9563d76" title="Returns the atomization potential for atomic number Z.">ip</a>(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00186"></a>00186 <a name="l00188"></a><a class="code" href="classsc_1_1AtomInfo.html#8eea84dd0813227ab12fed72e1a4b54f">00188</a> <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#8eea84dd0813227ab12fed72e1a4b54f" title="Return the scale factor for the VdW radii.">vdw_radius_scale</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> vdw_radius_scale_; } <a name="l00190"></a><a class="code" href="classsc_1_1AtomInfo.html#adf2116d2b461efbe056b4e789c48c10">00190</a> <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#adf2116d2b461efbe056b4e789c48c10" title="Return the scale factor for the Bragg radii.">bragg_radius_scale</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> bragg_radius_scale_; } <a name="l00192"></a><a class="code" href="classsc_1_1AtomInfo.html#ee33c4a5f8e56be1fb6e099acd5c2588">00192</a> <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#ee33c4a5f8e56be1fb6e099acd5c2588" title="Return the scale factor for the atomic radii.">atomic_radius_scale</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> atomic_radius_scale_; } <a name="l00194"></a><a class="code" href="classsc_1_1AtomInfo.html#26ccf092d5ed0a06a92581c85251e573">00194</a> <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#26ccf092d5ed0a06a92581c85251e573" title="Return the scale factor for the maximum probability radii.">maxprob_radius_scale</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> maxprob_radius_scale_; } <a name="l00195"></a>00195 <a name="l00198"></a>00198 <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#8ae0a293337b5261d68e876e123ea270" title="These return information about the color of the atom for visualization programs.">rgb</a>(<span class="keywordtype">int</span> Z, <span class="keywordtype">int</span> color) <span class="keyword">const</span>; <a name="l00199"></a>00199 <span class="keywordtype">double</span> red(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00200"></a>00200 <span class="keywordtype">double</span> green(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00201"></a>00201 <span class="keywordtype">double</span> blue(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00202"></a>00202 <a name="l00204"></a>00204 <span class="keywordtype">double</span> <a class="code" href="classsc_1_1AtomInfo.html#2dd4011dc954c1328fe6f76421e7bd67" title="This returns the mass of the most abundant isotope.">mass</a>(<span class="keywordtype">int</span> Z) <span class="keyword">const</span>; <a name="l00205"></a>00205 <a name="l00207"></a>00207 std::string <a class="code" href="classsc_1_1AtomInfo.html#b73bc35d761adf7679a9299a677c5ad1" title="This returns the full name of the element.">name</a>(<span class="keywordtype">int</span> Z); <a name="l00209"></a>00209 std::string <a class="code" href="classsc_1_1AtomInfo.html#c258cee9997782f4193ef6f70a2a0514" title="This returns the symbol for the element.">symbol</a>(<span class="keywordtype">int</span> Z); <a name="l00210"></a>00210 <a name="l00212"></a>00212 <span class="keywordtype">int</span> <a class="code" href="classsc_1_1AtomInfo.html#0f1602b0eb48d3e9ff9655b324ba93e9" title="This converts a name or symbol to the atomic number.">string_to_Z</a>(<span class="keyword">const</span> std::string &, <span class="keywordtype">int</span> allow_exceptions = 1); <a name="l00213"></a>00213 }; <a name="l00214"></a>00214 <a name="l00215"></a>00215 } <a name="l00216"></a>00216 <a name="l00217"></a>00217 <span class="preprocessor">#endif</span> <a name="l00218"></a>00218 <span class="preprocessor"></span> <a name="l00219"></a>00219 <span class="comment">// Local Variables:</span> <a name="l00220"></a>00220 <span class="comment">// mode: c++</span> <a name="l00221"></a>00221 <span class="comment">// c-file-style: "CLJ"</span> <a name="l00222"></a>00222 <span class="comment">// End:</span> </pre></div></div> <hr> <address> <small> Generated at Wed Oct 14 14:12:08 2009 for <a href="http://www.mpqc.org">MPQC</a> 2.3.1 using the documentation package <a href="http://www.doxygen.org">Doxygen</a> 1.5.9. </small> </address> </body> </html>