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