1 |
gezelter |
1210 |
/********************************************************************** |
2 |
|
|
|
3 |
|
|
This basic Element data-holding class was originally taken from the data.h |
4 |
gezelter |
1390 |
file in OpenBabel. The code has been modified to match the OpenMD coding style. |
5 |
gezelter |
1210 |
|
6 |
|
|
We have retained the OpenBabel copyright and GPL license on this class: |
7 |
|
|
|
8 |
|
|
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc. |
9 |
|
|
Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison |
10 |
|
|
|
11 |
|
|
This file is part of the Open Babel project. |
12 |
|
|
For more information, see <http://openbabel.sourceforge.net/> |
13 |
|
|
|
14 |
|
|
This program is free software; you can redistribute it and/or modify |
15 |
|
|
it under the terms of the GNU General Public License as published by |
16 |
|
|
the Free Software Foundation version 2 of the License. |
17 |
|
|
|
18 |
|
|
This program is distributed in the hope that it will be useful, |
19 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 |
|
|
GNU General Public License for more details. |
22 |
|
|
***********************************************************************/ |
23 |
|
|
|
24 |
|
|
/** |
25 |
|
|
* @file Element.hpp |
26 |
|
|
* @author gezelter |
27 |
|
|
* @date 12/21/2007 |
28 |
|
|
* @version 1.0 |
29 |
|
|
*/ |
30 |
|
|
|
31 |
|
|
#ifndef PRIMITIVES_ELEMENT_HPP |
32 |
|
|
#define PRIMITIVES_ELEMENT_HPP |
33 |
|
|
#include <string> |
34 |
gezelter |
1282 |
#include <string.h> |
35 |
gezelter |
1210 |
#include "config.h" |
36 |
|
|
|
37 |
gezelter |
1390 |
namespace OpenMD{ |
38 |
gezelter |
1210 |
class Element { |
39 |
|
|
public: |
40 |
|
|
Element() {} |
41 |
|
|
Element(int num, const char *sym, RealType rcov, RealType rvdw, |
42 |
|
|
int maxbo, RealType mass, RealType elNeg, RealType ionize, |
43 |
|
|
RealType elAffin, RealType red, RealType green, RealType blue, |
44 |
|
|
std::string name) : |
45 |
|
|
num_(num), name_(name), Rcov_(rcov), Rvdw_(rvdw), mass_(mass), |
46 |
|
|
elNeg_(elNeg), ionize_(ionize), elAffinity_(elAffin), |
47 |
|
|
red_(red), green_(green), blue_(blue), |
48 |
|
|
maxbonds_(maxbo) |
49 |
|
|
{ |
50 |
|
|
strncpy(symbol_, sym, 3); |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
|
54 |
|
|
/** |
55 |
|
|
* Returns the atomic number of this element |
56 |
|
|
* @return the atomic number of this element |
57 |
|
|
*/ |
58 |
|
|
int GetAtomicNum() { |
59 |
|
|
return(num_); |
60 |
|
|
} |
61 |
|
|
|
62 |
|
|
/** |
63 |
|
|
* Returns the atomic symbol for this element |
64 |
|
|
* @return the atomic symbol for this element |
65 |
|
|
*/ |
66 |
|
|
char *GetSymbol() { |
67 |
|
|
return(symbol_); |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
/** |
71 |
|
|
* Returns the covalent radius of this element |
72 |
|
|
* @return the covalent radius of this element |
73 |
|
|
*/ |
74 |
|
|
RealType GetCovalentRad() { |
75 |
|
|
return(Rcov_); |
76 |
|
|
} |
77 |
|
|
|
78 |
|
|
/** |
79 |
|
|
* Returns the van der Waals radius of this element |
80 |
|
|
* @return the van der Waals radius of this element |
81 |
|
|
*/ |
82 |
|
|
RealType GetVdwRad() { |
83 |
|
|
return(Rvdw_); |
84 |
|
|
} |
85 |
|
|
|
86 |
|
|
/** |
87 |
|
|
* Returns the standard atomic mass for this element (in amu) |
88 |
|
|
* @return the standard atomic mass for this element (in amu) |
89 |
|
|
*/ |
90 |
|
|
RealType GetMass() { |
91 |
|
|
return(mass_); |
92 |
|
|
} |
93 |
|
|
|
94 |
|
|
/** |
95 |
|
|
* Returns the maximum expected number of bonds to this element |
96 |
|
|
* @return the maximum expected number of bonds to this element |
97 |
|
|
*/ |
98 |
|
|
int GetMaxBonds() { |
99 |
|
|
return(maxbonds_); |
100 |
|
|
} |
101 |
|
|
|
102 |
|
|
/** |
103 |
|
|
* Returns the Pauling electronegativity for this element |
104 |
|
|
* @return the Pauling electronegativity for this element |
105 |
|
|
*/ |
106 |
|
|
RealType GetElectroNeg() { |
107 |
|
|
return(elNeg_); |
108 |
|
|
} |
109 |
|
|
|
110 |
|
|
/** |
111 |
|
|
* Returns the ionization potential (in eV) of this element |
112 |
|
|
* @return the ionization potential (in eV) of this element |
113 |
|
|
*/ |
114 |
|
|
RealType GetIonization() { |
115 |
|
|
return(ionize_); |
116 |
|
|
} |
117 |
|
|
|
118 |
|
|
/** |
119 |
|
|
* Returns the electron affinity (in eV) of this element |
120 |
|
|
* @return the electron affinity (in eV) of this element |
121 |
|
|
*/ |
122 |
|
|
RealType GetElectronAffinity() { |
123 |
|
|
return(elAffinity_); |
124 |
|
|
} |
125 |
|
|
|
126 |
|
|
/** |
127 |
|
|
* Returns the name of this element (in English) |
128 |
|
|
* @return the name of this element (in English) |
129 |
|
|
*/ |
130 |
|
|
std::string GetName() { |
131 |
|
|
return(name_); |
132 |
|
|
} |
133 |
|
|
|
134 |
|
|
/** |
135 |
|
|
* Returns the red component of this element's default visualization color |
136 |
|
|
* @return the red component of this element's default visualization color |
137 |
|
|
*/ |
138 |
|
|
RealType GetRed() { |
139 |
|
|
return(red_); |
140 |
|
|
} |
141 |
|
|
|
142 |
|
|
/** |
143 |
|
|
* Returns the green component of this element's default color |
144 |
|
|
* @return the green component of this element's default color |
145 |
|
|
*/ |
146 |
|
|
RealType GetGreen() { |
147 |
|
|
return(green_); |
148 |
|
|
} |
149 |
|
|
|
150 |
|
|
/** |
151 |
|
|
* Returns the blue component of this element's default color |
152 |
|
|
* @return the blue component of this element's default color |
153 |
|
|
*/ |
154 |
|
|
RealType GetBlue() { |
155 |
|
|
return(blue_); |
156 |
|
|
} |
157 |
|
|
|
158 |
|
|
protected: |
159 |
|
|
int num_; |
160 |
|
|
char symbol_[3]; |
161 |
|
|
std::string name_; |
162 |
|
|
RealType Rcov_, Rvdw_, mass_, elNeg_, ionize_, elAffinity_; |
163 |
|
|
RealType red_, green_, blue_; |
164 |
|
|
int maxbonds_; |
165 |
|
|
|
166 |
|
|
}; |
167 |
|
|
} |
168 |
|
|
#endif |