Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

atominfo.h

00001 //
00002 // atominfo.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifndef _chemistry_molecule_atominfo_h
00029 #define _chemistry_molecule_atominfo_h
00030 
00031 #include <util/class/class.h>
00032 #include <util/keyval/keyval.h>
00033 
00034 class Units;
00035 
00039 class AtomInfo: public SavableState {
00040   private:
00041     enum { MaxZ = 107+1 };
00042 
00043     struct atomname
00044     {
00045       char *name;
00046       char *symbol;
00047     };
00048 
00049     static struct atomname names_[MaxZ];
00050     double  mass_[MaxZ];
00051     double  atomic_radius_[MaxZ];
00052     double  vdw_radius_[MaxZ];
00053     double  bragg_radius_[MaxZ];
00054     double  maxprob_radius_[MaxZ];
00055     double  rgb_[MaxZ][3];
00056     double  atomic_radius_scale_;
00057     double  vdw_radius_scale_;
00058     double  bragg_radius_scale_;
00059     double  maxprob_radius_scale_;
00060 
00061     char *overridden_values_;
00062 
00063     void load_library_values();
00064     void override_library_values(const Ref<KeyVal> &keyval);
00065     void load_values(const Ref<KeyVal>& keyval, int override);
00066     void load_values(double *array, double *scale, const char *keyword,
00067                      const Ref<KeyVal> &keyval, int override,
00068                      const Ref<Units> &);
00069     void load_values(double array[][3], const char *keyword,
00070                      const Ref<KeyVal> &keyval, int override);
00071     void add_overridden_value(const char *assignment);
00072   public:
00073     AtomInfo();
00074     AtomInfo(const Ref<KeyVal>&);
00075     AtomInfo(StateIn&);
00076     ~AtomInfo();
00077     void save_data_state(StateOut& s);
00078 
00080     double vdw_radius(int Z) const { return vdw_radius_[Z]*vdw_radius_scale_; }
00081     double bragg_radius(int Z) const { return bragg_radius_[Z]*bragg_radius_scale_; }
00082     double atomic_radius(int Z) const { return atomic_radius_[Z]*atomic_radius_scale_; }
00083     double maxprob_radius(int Z) const { return maxprob_radius_[Z]*maxprob_radius_scale_; }
00084 
00086     double vdw_radius_scale() const { return vdw_radius_scale_; }
00088     double bragg_radius_scale() const { return bragg_radius_scale_; }
00090     double atomic_radius_scale() const { return atomic_radius_scale_; }
00092     double maxprob_radius_scale() const { return maxprob_radius_scale_; }
00093 
00096     double rgb(int Z, int color) const { return rgb_[Z][color]; }
00097     double red(int Z) const { return rgb_[Z][0]; }
00098     double green(int Z) const { return rgb_[Z][1]; }
00099     double blue(int Z) const { return rgb_[Z][2]; }
00100 
00102     double mass(int Z) const { return mass_[Z]; }
00103 
00105     static const char *name(int Z) { return names_[Z].name; }
00107     static const char *symbol(int Z) { return names_[Z].symbol; }
00108 
00110     static int string_to_Z(const char *, int allow_exceptions = 1);
00111 };
00112 
00113 
00114 #endif
00115 
00116 // Local Variables:
00117 // mode: c++
00118 // c-file-style: "CLJ"
00119 // End:

Generated at Thu Oct 4 18:08:42 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.