45 |
|
#include "UseTheForce/DarkSide/gb_interface.h" |
46 |
|
#include "utils/simError.h" |
47 |
|
namespace oopse { |
48 |
< |
|
48 |
> |
|
49 |
|
void DirectionalAtomType::complete() { |
50 |
< |
|
51 |
< |
// |
50 |
> |
|
51 |
|
AtomType::complete(); |
52 |
|
|
53 |
|
int isError = 0; |
54 |
|
GenericData* data; |
55 |
< |
|
56 |
< |
//setup dipole atom type in fortran side |
55 |
> |
|
56 |
> |
//setup dipole atom type in fortran side |
57 |
|
if (isDipole()) { |
58 |
|
data = getPropertyByName("Dipole"); |
59 |
|
if (data != NULL) { |
85 |
|
simError(); |
86 |
|
} |
87 |
|
} |
88 |
< |
|
88 |
> |
|
89 |
|
if (isSplitDipole()) { |
90 |
|
data = getPropertyByName("SplitDipoleDistance"); |
91 |
|
if (data != NULL) { |
123 |
|
data = getPropertyByName("QuadrupoleMoments"); |
124 |
|
if (data != NULL) { |
125 |
|
Vector3dGenericData* vector3dData= dynamic_cast<Vector3dGenericData*>(data); |
126 |
< |
|
126 |
> |
|
127 |
|
// Quadrupoles in OOPSE are set as the diagonal elements |
128 |
|
// of the diagonalized traceless quadrupole moment tensor. |
129 |
|
// The column vectors of the unitary matrix that diagonalizes |
160 |
|
} |
161 |
|
|
162 |
|
//setup sticky atom type in fortran side |
163 |
< |
if (isSticky() || isStickyPower()) { |
163 |
> |
if (isSticky() || isStickyPower()) { |
164 |
|
data = getPropertyByName("Sticky"); |
165 |
|
if (data != NULL) { |
166 |
|
StickyParamGenericData* stickyData = dynamic_cast<StickyParamGenericData*>(data); |
167 |
< |
|
167 |
> |
|
168 |
|
if (stickyData != NULL) { |
169 |
|
StickyParam stickyParam = stickyData->getData(); |
170 |
< |
|
171 |
< |
newStickyType(&atp.ident,&stickyParam.w0, &stickyParam.v0, |
170 |
> |
|
171 |
> |
newStickyType(&atp.ident,&stickyParam.w0, &stickyParam.v0, |
172 |
|
&stickyParam.v0p, &stickyParam.rl, &stickyParam.ru, |
173 |
|
&stickyParam.rlp, &stickyParam.rup, &isError); |
174 |
|
if (isError != 0) { |
178 |
|
painCave.isFatal = 1; |
179 |
|
simError(); |
180 |
|
} |
181 |
< |
|
181 |
> |
|
182 |
|
} else { |
183 |
|
sprintf( painCave.errMsg, |
184 |
|
"Can not cast GenericData to StickyParam\n"); |
192 |
|
painCave.isFatal = 1; |
193 |
|
simError(); |
194 |
|
} |
195 |
< |
} |
196 |
< |
|
197 |
< |
//setup GayBerne type in fortran side |
198 |
< |
if (isGayBerne()) { |
199 |
< |
data = getPropertyByName("GayBerne"); |
200 |
< |
if (data != NULL) { |
201 |
< |
GayBerneParamGenericData* gayBerneData = dynamic_cast<GayBerneParamGenericData*>(data); |
202 |
< |
|
203 |
< |
if (gayBerneData != NULL) { |
204 |
< |
GayBerneParam gayBerneParam = gayBerneData->getData(); |
205 |
< |
|
206 |
< |
newGayBerneType(&atp.ident, |
207 |
< |
&gayBerneParam.GB_d, |
208 |
< |
&gayBerneParam.GB_l, |
209 |
< |
&gayBerneParam.GB_eps, |
210 |
< |
&gayBerneParam.GB_eps_ratio, |
211 |
< |
&gayBerneParam.GB_dw, |
212 |
< |
&isError); |
213 |
< |
|
214 |
< |
if (isError != 0) { |
215 |
< |
sprintf( painCave.errMsg, |
216 |
< |
"Fortran rejected newGayBerneType\n"); |
217 |
< |
painCave.severity = OOPSE_ERROR; |
218 |
< |
painCave.isFatal = 1; |
219 |
< |
simError(); |
220 |
< |
} |
221 |
< |
|
223 |
< |
} |
224 |
< |
|
225 |
< |
else { |
226 |
< |
sprintf( painCave.errMsg, |
227 |
< |
"Can not cast GenericData to GayBerneParam\n"); |
228 |
< |
painCave.severity = OOPSE_ERROR; |
229 |
< |
painCave.isFatal = 1; |
230 |
< |
simError(); |
231 |
< |
} |
195 |
> |
} |
196 |
> |
|
197 |
> |
//setup GayBerne type in fortran side |
198 |
> |
if (isGayBerne()) { |
199 |
> |
data = getPropertyByName("GayBerne"); |
200 |
> |
if (data != NULL) { |
201 |
> |
GayBerneParamGenericData* gayBerneData = dynamic_cast<GayBerneParamGenericData*>(data); |
202 |
> |
|
203 |
> |
if (gayBerneData != NULL) { |
204 |
> |
GayBerneParam gayBerneParam = gayBerneData->getData(); |
205 |
> |
|
206 |
> |
newGayBerneType(&atp.ident, |
207 |
> |
&gayBerneParam.GB_d, |
208 |
> |
&gayBerneParam.GB_l, |
209 |
> |
&gayBerneParam.GB_eps, |
210 |
> |
&gayBerneParam.GB_eps_ratio, |
211 |
> |
&gayBerneParam.GB_dw, |
212 |
> |
&isError); |
213 |
> |
|
214 |
> |
if (isError != 0) { |
215 |
> |
sprintf( painCave.errMsg, |
216 |
> |
"Fortran rejected newGayBerneType\n"); |
217 |
> |
painCave.severity = OOPSE_ERROR; |
218 |
> |
painCave.isFatal = 1; |
219 |
> |
simError(); |
220 |
> |
} |
221 |
> |
|
222 |
|
} |
223 |
< |
else { |
224 |
< |
sprintf( painCave.errMsg, "Can not find Parameters for GayBerne\n"); |
225 |
< |
painCave.severity = OOPSE_ERROR; |
226 |
< |
painCave.isFatal = 1; |
227 |
< |
simError(); |
228 |
< |
} |
223 |
> |
|
224 |
> |
else { |
225 |
> |
sprintf( painCave.errMsg, |
226 |
> |
"Can not cast GenericData to GayBerneParam\n"); |
227 |
> |
painCave.severity = OOPSE_ERROR; |
228 |
> |
painCave.isFatal = 1; |
229 |
> |
simError(); |
230 |
> |
} |
231 |
> |
} |
232 |
> |
else { |
233 |
> |
sprintf( painCave.errMsg, "Can not find Parameters for GayBerne\n"); |
234 |
> |
painCave.severity = OOPSE_ERROR; |
235 |
> |
painCave.isFatal = 1; |
236 |
> |
simError(); |
237 |
> |
} |
238 |
|
} |
239 |
< |
} |
241 |
< |
|
242 |
< |
|
243 |
< |
|
239 |
> |
} |
240 |
|
} //end namespace oopse |