1 |
gezelter |
1631 |
#ifndef TYPES_ATOMTYPE_HPP |
2 |
tim |
1740 |
|
3 |
gezelter |
1631 |
#define TYPES_ATOMTYPE_HPP |
4 |
|
|
|
5 |
gezelter |
1652 |
#include <string> |
6 |
|
|
|
7 |
gezelter |
1631 |
#include "utils/PropertyMap.hpp" |
8 |
tim |
1740 |
|
9 |
gezelter |
1631 |
#define __C |
10 |
|
|
#include "types/AtomTypeProperties.h" |
11 |
|
|
#include "UseTheForce/DarkSide/atype_interface.h" |
12 |
|
|
|
13 |
tim |
1787 |
using namespace std; |
14 |
gezelter |
1652 |
|
15 |
tim |
1787 |
namespace oopse { |
16 |
gezelter |
1631 |
/** |
17 |
tim |
1740 |
* @class AtomType |
18 |
|
|
* AtomType is what OOPSE looks to for unchanging data about an atom. |
19 |
|
|
* Things that belong to AtomType are universal properties (i.e. does |
20 |
|
|
* this atom have a Charge? What is it's mass_?) Dynamic properties of |
21 |
|
|
* an atom are not intended to be properties of an atom type |
22 |
gezelter |
1631 |
*/ |
23 |
tim |
1740 |
class AtomType { |
24 |
|
|
public: |
25 |
gezelter |
1631 |
|
26 |
tim |
1740 |
AtomType(); |
27 |
gezelter |
1632 |
|
28 |
tim |
1740 |
virtual ~AtomType() { } ; |
29 |
tim |
1769 |
|
30 |
|
|
virtual void complete(); |
31 |
|
|
|
32 |
tim |
1740 |
/** |
33 |
|
|
* Finishes off the AtomType by communicating the logical portions of the |
34 |
|
|
* structure to the Fortran atype module |
35 |
|
|
*/ |
36 |
tim |
1769 |
void makeFortranAtomType(); |
37 |
|
|
|
38 |
tim |
1740 |
void setMass(double m) { |
39 |
|
|
mass_ = m; |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
double getMass(void) { |
43 |
|
|
return mass_; |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
void setIdent(int id) { |
47 |
tim |
1787 |
atp.ident = id; |
48 |
tim |
1740 |
} |
49 |
|
|
|
50 |
|
|
int getIdent() { |
51 |
tim |
1787 |
return atp.ident; |
52 |
tim |
1740 |
} |
53 |
|
|
|
54 |
|
|
void setName(const std::string&name) { |
55 |
|
|
name_ = name; |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
std::string getName() { |
59 |
|
|
return name_; |
60 |
|
|
} |
61 |
|
|
|
62 |
|
|
void setLennardJones() { |
63 |
tim |
1787 |
atp.is_LennardJones = 1; |
64 |
tim |
1740 |
} |
65 |
|
|
|
66 |
|
|
bool isLennardJones() { |
67 |
tim |
1787 |
return atp.is_LennardJones; |
68 |
tim |
1740 |
} |
69 |
|
|
|
70 |
|
|
void setElectrostatic() { |
71 |
tim |
1787 |
atp.is_Electrostatic = 1; |
72 |
tim |
1740 |
} |
73 |
|
|
|
74 |
|
|
bool isElectrostatic() { |
75 |
tim |
1787 |
return atp.is_Electrostatic; |
76 |
tim |
1740 |
} |
77 |
|
|
|
78 |
|
|
void setEAM() { |
79 |
tim |
1787 |
atp.is_EAM = 1; |
80 |
tim |
1740 |
} |
81 |
|
|
|
82 |
|
|
bool isEAM() { |
83 |
tim |
1787 |
return atp.is_EAM; |
84 |
tim |
1740 |
} |
85 |
|
|
|
86 |
|
|
void setCharge() { |
87 |
tim |
1787 |
atp.is_Charge = 1; |
88 |
|
|
atp.is_Electrostatic = 1; |
89 |
tim |
1740 |
} |
90 |
|
|
|
91 |
|
|
bool isCharge() { |
92 |
tim |
1787 |
return atp.is_Charge; |
93 |
tim |
1740 |
} |
94 |
|
|
|
95 |
|
|
bool isDirectional() { |
96 |
tim |
1787 |
return atp.is_Directional; |
97 |
tim |
1740 |
} |
98 |
|
|
|
99 |
|
|
bool isDipole() { |
100 |
tim |
1787 |
return atp.is_Dipole; |
101 |
tim |
1740 |
} |
102 |
|
|
|
103 |
|
|
bool isGayBerne() { |
104 |
tim |
1787 |
return atp.is_GayBerne; |
105 |
tim |
1740 |
} |
106 |
|
|
|
107 |
|
|
bool isSticky() { |
108 |
tim |
1787 |
return atp.is_Sticky; |
109 |
tim |
1740 |
} |
110 |
|
|
|
111 |
|
|
bool isShape() { |
112 |
tim |
1787 |
return atp.is_Shape; |
113 |
tim |
1740 |
} |
114 |
|
|
|
115 |
|
|
//below functions are just forward functions |
116 |
|
|
/** |
117 |
|
|
* Adds property into property map |
118 |
|
|
* @param genData GenericData to be added into PropertyMap |
119 |
|
|
*/ |
120 |
|
|
void addProperty(GenericData* genData); |
121 |
|
|
|
122 |
|
|
/** |
123 |
|
|
* Removes property from PropertyMap by name |
124 |
|
|
* @param propName the name of property to be removed |
125 |
|
|
*/ |
126 |
|
|
void removeProperty(const std::string& propName); |
127 |
|
|
|
128 |
|
|
/** |
129 |
|
|
* clear all of the properties |
130 |
|
|
*/ |
131 |
|
|
void clearProperties(); |
132 |
|
|
|
133 |
|
|
/** |
134 |
|
|
* Returns all names of properties |
135 |
|
|
* @return all names of properties |
136 |
|
|
*/ |
137 |
|
|
std::vector<std::string> getPropertyNames(); |
138 |
|
|
|
139 |
|
|
/** |
140 |
|
|
* Returns all of the properties in PropertyMap |
141 |
|
|
* @return all of the properties in PropertyMap |
142 |
|
|
*/ |
143 |
|
|
std::vector<GenericData*> getProperties(); |
144 |
|
|
|
145 |
|
|
/** |
146 |
|
|
* Returns property |
147 |
|
|
* @param propName name of property |
148 |
|
|
* @return a pointer point to property with propName. If no property named propName |
149 |
|
|
* exists, return NULL |
150 |
|
|
*/ |
151 |
|
|
GenericData* getPropertyByName(const std::string& propName); |
152 |
|
|
|
153 |
|
|
protected: |
154 |
|
|
|
155 |
tim |
1787 |
AtomTypeProperties atp; |
156 |
tim |
1740 |
double mass_; |
157 |
|
|
std::string name_; |
158 |
|
|
|
159 |
|
|
private: |
160 |
|
|
//prevent copy construction and copy assignment, since property map contains |
161 |
|
|
//pointers which can not be copied and managered safely, except make the generic data |
162 |
|
|
//at PropertyMap as copy on write shared pointer |
163 |
|
|
AtomType(const AtomType&); |
164 |
|
|
AtomType& operator=(const AtomType& atomType); |
165 |
|
|
|
166 |
|
|
|
167 |
|
|
PropertyMap properties_; |
168 |
gezelter |
1632 |
|
169 |
tim |
1740 |
}; |
170 |
gezelter |
1632 |
|
171 |
tim |
1765 |
struct LJParam { |
172 |
|
|
double epsilon; |
173 |
|
|
double sigma; |
174 |
|
|
}; |
175 |
|
|
typedef SimpleTypeData<LJParam> LJParamGenericData; |
176 |
tim |
1769 |
|
177 |
|
|
struct EAMParam { |
178 |
|
|
double latticeConstant; |
179 |
|
|
int nrho; |
180 |
|
|
double drho; |
181 |
|
|
int nr; |
182 |
|
|
double dr; |
183 |
|
|
double rcut; |
184 |
|
|
std::vector<double> rvals; |
185 |
|
|
std::vector<double> rhovals; |
186 |
|
|
std::vector<double> Frhovals; |
187 |
|
|
}; |
188 |
|
|
|
189 |
|
|
typedef SimpleTypeData<EAMParam> EAMParamGenericData; |
190 |
tim |
1740 |
} |
191 |
gezelter |
1652 |
|
192 |
gezelter |
1631 |
#endif |