1 |
+ |
/* |
2 |
+ |
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
+ |
* |
4 |
+ |
* The University of Notre Dame grants you ("Licensee") a |
5 |
+ |
* non-exclusive, royalty free, license to use, modify and |
6 |
+ |
* redistribute this software in source and binary code form, provided |
7 |
+ |
* that the following conditions are met: |
8 |
+ |
* |
9 |
+ |
* 1. Acknowledgement of the program authors must be made in any |
10 |
+ |
* publication of scientific results based in part on use of the |
11 |
+ |
* program. An acceptable form of acknowledgement is citation of |
12 |
+ |
* the article in which the program was described (Matthew |
13 |
+ |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
+ |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
+ |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
+ |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
+ |
* |
18 |
+ |
* 2. Redistributions of source code must retain the above copyright |
19 |
+ |
* notice, this list of conditions and the following disclaimer. |
20 |
+ |
* |
21 |
+ |
* 3. Redistributions in binary form must reproduce the above copyright |
22 |
+ |
* notice, this list of conditions and the following disclaimer in the |
23 |
+ |
* documentation and/or other materials provided with the |
24 |
+ |
* distribution. |
25 |
+ |
* |
26 |
+ |
* This software is provided "AS IS," without a warranty of any |
27 |
+ |
* kind. All express or implied conditions, representations and |
28 |
+ |
* warranties, including any implied warranty of merchantability, |
29 |
+ |
* fitness for a particular purpose or non-infringement, are hereby |
30 |
+ |
* excluded. The University of Notre Dame and its licensors shall not |
31 |
+ |
* be liable for any damages suffered by licensee as a result of |
32 |
+ |
* using, modifying or distributing the software or its |
33 |
+ |
* derivatives. In no event will the University of Notre Dame or its |
34 |
+ |
* licensors be liable for any lost revenue, profit or data, or for |
35 |
+ |
* direct, indirect, special, consequential, incidental or punitive |
36 |
+ |
* damages, however caused and regardless of the theory of liability, |
37 |
+ |
* arising out of the use of or inability to use software, even if the |
38 |
+ |
* University of Notre Dame has been advised of the possibility of |
39 |
+ |
* such damages. |
40 |
+ |
*/ |
41 |
+ |
|
42 |
|
#ifndef TYPES_ATOMTYPE_HPP |
43 |
+ |
|
44 |
|
#define TYPES_ATOMTYPE_HPP |
45 |
|
|
46 |
|
#include <string> |
47 |
|
|
48 |
|
#include "utils/PropertyMap.hpp" |
49 |
+ |
|
50 |
|
#define __C |
51 |
|
#include "types/AtomTypeProperties.h" |
52 |
|
#include "UseTheForce/DarkSide/atype_interface.h" |
53 |
|
|
11 |
– |
using namespace std; |
12 |
– |
|
54 |
|
namespace oopse { |
14 |
– |
/** |
15 |
– |
* @class AtomType |
16 |
– |
* AtomType is what OOPSE looks to for unchanging data about an atom. |
17 |
– |
* Things that belong to AtomType are universal properties (i.e. does |
18 |
– |
* this atom have a Charge? What is it's mass?) Dynamic properties of |
19 |
– |
* an atom are not intended to be properties of an atom type |
20 |
– |
*/ |
21 |
– |
class AtomType{ |
22 |
– |
|
23 |
– |
public: |
24 |
– |
|
25 |
– |
AtomType(); |
26 |
– |
virtual ~AtomType(){ }; |
55 |
|
/** |
56 |
< |
* Finishes off the AtomType by communicating the logical portions of the |
57 |
< |
* structure to the Fortran atype module |
56 |
> |
* @class AtomType |
57 |
> |
* AtomType is what OOPSE looks to for unchanging data about an atom. |
58 |
> |
* Things that belong to AtomType are universal properties (i.e. does |
59 |
> |
* this atom have a Charge? What is it's mass_?) Dynamic properties of |
60 |
> |
* an atom are not intended to be properties of an atom type |
61 |
|
*/ |
62 |
< |
void complete(); |
63 |
< |
|
33 |
< |
void setMass(double m) { mass = m; } |
34 |
< |
double getMass(void) { return mass; } |
62 |
> |
class AtomType { |
63 |
> |
public: |
64 |
|
|
65 |
< |
void setIdent(int id) {atp.ident = id;} |
37 |
< |
int getIdent() {return atp.ident;} |
65 |
> |
AtomType(); |
66 |
|
|
67 |
< |
void setName(string n) {name = n;} |
68 |
< |
string getName() {return name;} |
69 |
< |
|
70 |
< |
void setLennardJones() { atp.is_LennardJones = 1; } |
71 |
< |
bool isLennardJones() { return atp.is_LennardJones; } |
72 |
< |
|
73 |
< |
void setElectrostatic() { atp.is_Electrostatic = 1; } |
74 |
< |
bool isElectrostatic() { return atp.is_Electrostatic; } |
67 |
> |
virtual ~AtomType() { } ; |
68 |
> |
|
69 |
> |
virtual void complete(); |
70 |
> |
|
71 |
> |
/** |
72 |
> |
* Finishes off the AtomType by communicating the logical portions of the |
73 |
> |
* structure to the Fortran atype module |
74 |
> |
*/ |
75 |
> |
void makeFortranAtomType(); |
76 |
> |
|
77 |
> |
void setMass(double m) { |
78 |
> |
mass_ = m; |
79 |
> |
} |
80 |
> |
|
81 |
> |
double getMass(void) { |
82 |
> |
return mass_; |
83 |
> |
} |
84 |
> |
|
85 |
> |
void setIdent(int id) { |
86 |
> |
atp.ident = id; |
87 |
> |
} |
88 |
> |
|
89 |
> |
int getIdent() { |
90 |
> |
return atp.ident; |
91 |
> |
} |
92 |
> |
|
93 |
> |
void setName(const std::string&name) { |
94 |
> |
name_ = name; |
95 |
> |
} |
96 |
> |
|
97 |
> |
std::string getName() { |
98 |
> |
return name_; |
99 |
> |
} |
100 |
> |
|
101 |
> |
void setLennardJones() { |
102 |
> |
atp.is_LennardJones = 1; |
103 |
> |
} |
104 |
> |
|
105 |
> |
bool isLennardJones() { |
106 |
> |
return atp.is_LennardJones; |
107 |
> |
} |
108 |
> |
|
109 |
> |
|
110 |
> |
bool isElectrostatic() { |
111 |
> |
return isCharge() || isMultipole(); |
112 |
> |
} |
113 |
> |
|
114 |
> |
void setEAM() { |
115 |
> |
atp.is_EAM = 1; |
116 |
> |
} |
117 |
> |
|
118 |
> |
bool isEAM() { |
119 |
> |
return atp.is_EAM; |
120 |
> |
} |
121 |
> |
|
122 |
> |
void setCharge() { |
123 |
> |
atp.is_Charge = 1; |
124 |
> |
} |
125 |
> |
|
126 |
> |
bool isCharge() { |
127 |
> |
return atp.is_Charge; |
128 |
> |
} |
129 |
> |
|
130 |
> |
bool isDirectional() { |
131 |
> |
return atp.is_Directional; |
132 |
> |
} |
133 |
> |
|
134 |
> |
bool isDipole() { |
135 |
> |
return atp.is_Dipole; |
136 |
> |
} |
137 |
> |
|
138 |
> |
bool isSplitDipole() { |
139 |
> |
return atp.is_SplitDipole; |
140 |
> |
} |
141 |
> |
|
142 |
> |
bool isQuadrupole() { |
143 |
> |
return atp.is_Quadrupole; |
144 |
> |
} |
145 |
> |
|
146 |
> |
bool isMultipole() { |
147 |
> |
return isDipole() || isQuadrupole(); |
148 |
> |
} |
149 |
> |
|
150 |
> |
bool isGayBerne() { |
151 |
> |
return atp.is_GayBerne; |
152 |
> |
} |
153 |
> |
|
154 |
> |
bool isSticky() { |
155 |
> |
return atp.is_Sticky; |
156 |
> |
} |
157 |
> |
|
158 |
> |
bool isShape() { |
159 |
> |
return atp.is_Shape; |
160 |
> |
} |
161 |
> |
|
162 |
> |
//below functions are just forward functions |
163 |
> |
/** |
164 |
> |
* Adds property into property map |
165 |
> |
* @param genData GenericData to be added into PropertyMap |
166 |
> |
*/ |
167 |
> |
void addProperty(GenericData* genData); |
168 |
> |
|
169 |
> |
/** |
170 |
> |
* Removes property from PropertyMap by name |
171 |
> |
* @param propName the name of property to be removed |
172 |
> |
*/ |
173 |
> |
void removeProperty(const std::string& propName); |
174 |
> |
|
175 |
> |
/** |
176 |
> |
* clear all of the properties |
177 |
> |
*/ |
178 |
> |
void clearProperties(); |
179 |
> |
|
180 |
> |
/** |
181 |
> |
* Returns all names of properties |
182 |
> |
* @return all names of properties |
183 |
> |
*/ |
184 |
> |
std::vector<std::string> getPropertyNames(); |
185 |
> |
|
186 |
> |
/** |
187 |
> |
* Returns all of the properties in PropertyMap |
188 |
> |
* @return all of the properties in PropertyMap |
189 |
> |
*/ |
190 |
> |
std::vector<GenericData*> getProperties(); |
191 |
> |
|
192 |
> |
/** |
193 |
> |
* Returns property |
194 |
> |
* @param propName name of property |
195 |
> |
* @return a pointer point to property with propName. If no property named propName |
196 |
> |
* exists, return NULL |
197 |
> |
*/ |
198 |
> |
GenericData* getPropertyByName(const std::string& propName); |
199 |
> |
|
200 |
> |
protected: |
201 |
> |
|
202 |
> |
AtomTypeProperties atp; |
203 |
> |
double mass_; |
204 |
> |
std::string name_; |
205 |
> |
|
206 |
> |
private: |
207 |
> |
//prevent copy construction and copy assignment, since property map contains |
208 |
> |
//pointers which can not be copied and managered safely, except make the generic data |
209 |
> |
//at PropertyMap as copy on write shared pointer |
210 |
> |
AtomType(const AtomType&); |
211 |
> |
AtomType& operator=(const AtomType& atomType); |
212 |
> |
|
213 |
> |
|
214 |
> |
PropertyMap properties_; |
215 |
|
|
216 |
< |
void setEAM() { atp.is_EAM = 1; } |
49 |
< |
bool isEAM() { return atp.is_EAM; } |
50 |
< |
|
51 |
< |
void setCharge() { atp.is_Charge = 1; atp.is_Electrostatic = 1;} |
52 |
< |
bool isCharge() { return atp.is_Charge; } |
216 |
> |
}; |
217 |
|
|
218 |
< |
bool isDirectional() { return atp.is_Directional; } |
219 |
< |
bool isDipole() { return atp.is_Dipole; } |
220 |
< |
bool isGayBerne() { return atp.is_GayBerne; } |
221 |
< |
bool isSticky() { return atp.is_Sticky; } |
222 |
< |
bool isShape() { return atp.is_Shape; } |
218 |
> |
struct LJParam { |
219 |
> |
double epsilon; |
220 |
> |
double sigma; |
221 |
> |
int soft_pot; |
222 |
> |
}; |
223 |
> |
typedef SimpleTypeData<LJParam> LJParamGenericData; |
224 |
|
|
225 |
< |
PropertyMap properties; |
226 |
< |
|
227 |
< |
protected: |
228 |
< |
|
229 |
< |
AtomTypeProperties atp; |
230 |
< |
double mass; |
231 |
< |
string name; |
232 |
< |
|
233 |
< |
}; |
225 |
> |
struct EAMParam { |
226 |
> |
double latticeConstant; |
227 |
> |
int nrho; |
228 |
> |
double drho; |
229 |
> |
int nr; |
230 |
> |
double dr; |
231 |
> |
double rcut; |
232 |
> |
std::vector<double> rvals; |
233 |
> |
std::vector<double> rhovals; |
234 |
> |
std::vector<double> Frhovals; |
235 |
> |
}; |
236 |
> |
|
237 |
> |
typedef SimpleTypeData<EAMParam> EAMParamGenericData; |
238 |
|
} |
239 |
+ |
|
240 |
|
#endif |