MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
atominfo.h
1//
2// atominfo.h
3//
4// Copyright (C) 1996 Limit Point Systems, Inc.
5//
6// Author: Curtis Janssen <cljanss@limitpt.com>
7// Maintainer: LPS
8//
9// This file is part of the SC Toolkit.
10//
11// The SC Toolkit is free software; you can redistribute it and/or modify
12// it under the terms of the GNU Library General Public License as published by
13// the Free Software Foundation; either version 2, or (at your option)
14// any later version.
15//
16// The SC Toolkit is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU Library General Public License for more details.
20//
21// You should have received a copy of the GNU Library General Public License
22// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24//
25// The U.S. Government is granted a limited license as per AL 91-7.
26//
27
28#ifndef _chemistry_molecule_atominfo_h
29#define _chemistry_molecule_atominfo_h
30
31#include <string>
32#include <map>
33#include <vector>
34
35#include <util/class/class.h>
36#include <util/keyval/keyval.h>
37
38namespace sc {
39
40 class Units;
41
44
48class AtomInfo: public SavableState {
49 private:
50 enum { Nelement = 118, DefaultZ = 0 };
51
52 struct atom
53 {
54 int Z;
55 const char *name;
56 const char *symbol;
57 };
58
59 static struct atom elements_[Nelement];
60
61 std::map<std::string,int> name_to_Z_;
62 std::map<std::string,int> symbol_to_Z_;
63 std::map<int,std::string> Z_to_names_;
64 std::map<int,std::string> Z_to_symbols_;
65 std::map<int,double> Z_to_mass_;
66 std::map<int,double> Z_to_atomic_radius_;
67 std::map<int,double> Z_to_vdw_radius_;
68 std::map<int,double> Z_to_bragg_radius_;
69 std::map<int,double> Z_to_maxprob_radius_;
70 std::map<int,std::vector<double> > Z_to_rgb_;
71 std::map<int,double> Z_to_ip_;
72 double atomic_radius_scale_;
73 double vdw_radius_scale_;
74 double bragg_radius_scale_;
75 double maxprob_radius_scale_;
76
77 char *overridden_values_;
78
79 void load_library_values();
80 void override_library_values(const Ref<KeyVal> &keyval);
81 void load_values(const Ref<KeyVal>& keyval, int override);
82 void load_values(std::map<int,double>&,
83 double *scale, const char *keyword,
84 const Ref<KeyVal> &keyval, int override,
85 const Ref<Units> &);
86 void load_values(std::map<int,std::vector<double> >&,
87 const char *keyword,
88 const Ref<KeyVal> &keyval, int override);
89 void add_overridden_value(const char *assignment);
90 void initialize_names();
91 double lookup_value(const std::map<int,double>& values, int Z) const;
92 double lookup_array_value(const std::map<int,std::vector<double> >& values,
93 int Z, int i) const;
94
95 // set to true after load_library_values() has been called
96 // to avoid repeatedly printing out "Reading file ..." message
97 static bool has_announced_library_source_;
98
99 public:
100 AtomInfo();
101
183 ~AtomInfo();
185
187 double vdw_radius(int Z) const;
188 double bragg_radius(int Z) const;
189 double atomic_radius(int Z) const;
190 double maxprob_radius(int Z) const;
191
193 double ip(int Z) const;
194
196 double vdw_radius_scale() const { return vdw_radius_scale_; }
198 double bragg_radius_scale() const { return bragg_radius_scale_; }
200 double atomic_radius_scale() const { return atomic_radius_scale_; }
202 double maxprob_radius_scale() const { return maxprob_radius_scale_; }
203
206 double rgb(int Z, int color) const;
207 double red(int Z) const;
208 double green(int Z) const;
209 double blue(int Z) const;
210
212 double mass(int Z) const;
213
215 std::string name(int Z) const;
217 std::string symbol(int Z) const;
218
220 int string_to_Z(const std::string &, int allow_exceptions = 1);
221
223 void print(std::ostream& os = ExEnv::out0()) const;
224};
225
227// end of addtogroup ChemistryMolecule
228
229}
230
231#endif
232
233// Local Variables:
234// mode: c++
235// c-file-style: "CLJ"
236// End:
The AtomInfo class provides information about atoms.
Definition atominfo.h:48
int string_to_Z(const std::string &, int allow_exceptions=1)
This converts a name or symbol to the atomic number.
double vdw_radius(int Z) const
These return various measures of the atom's radius.
void save_data_state(StateOut &s)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
double atomic_radius_scale() const
Return the scale factor for the atomic radii.
Definition atominfo.h:200
double mass(int Z) const
This returns the mass of the most abundant isotope.
double ip(int Z) const
Returns the atomization potential for atomic number Z.
double rgb(int Z, int color) const
These return information about the color of the atom for visualization programs.
double vdw_radius_scale() const
Return the scale factor for the VdW radii.
Definition atominfo.h:196
double bragg_radius_scale() const
Return the scale factor for the Bragg radii.
Definition atominfo.h:198
AtomInfo(const Ref< KeyVal > &)
The AtomInfo KeyVal constructor is used to generate a AtomInfo object from the input.
std::string name(int Z) const
This returns the full name of the element.
void print(std::ostream &os=ExEnv::out0()) const
prints out the contents of AtomInfo to ostream os
std::string symbol(int Z) const
This returns the symbol for the element.
double maxprob_radius_scale() const
Return the scale factor for the maximum probability radii.
Definition atominfo.h:202
static std::ostream & out0()
Return an ostream that writes from node 0.
A template class that maintains references counts.
Definition ref.h:361
Base class for objects that can save/restore state.
Definition state.h:45
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
Contains all MPQC code up to version 3.
Definition mpqcin.h:14

Generated at Wed Sep 25 2024 02:45:28 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.