| 302 |
|
return; |
| 303 |
|
} |
| 304 |
|
|
| 305 |
< |
void SC::calcDensity(DensityData ddat) { |
| 305 |
> |
void SC::calcDensity(InteractionData &idat) { |
| 306 |
|
|
| 307 |
|
if (!initialized_) initialize(); |
| 308 |
|
|
| 309 |
< |
SCInteractionData mixer = MixingMap[make_pair(ddat.atype1, ddat.atype2)]; |
| 309 |
> |
SCInteractionData mixer = MixingMap[idat.atypes]; |
| 310 |
|
|
| 311 |
|
RealType rcij = mixer.rCut; |
| 312 |
|
|
| 313 |
< |
if (ddat.rij < rcij) { |
| 314 |
< |
ddat.rho_i_at_j = mixer.phi->getValueAt(ddat.rij); |
| 315 |
< |
ddat.rho_j_at_i = ddat.rho_i_at_j; |
| 313 |
> |
if (idat.rij < rcij) { |
| 314 |
> |
idat.rho_i_at_j = mixer.phi->getValueAt(idat.rij); |
| 315 |
> |
idat.rho_j_at_i = idat.rho_i_at_j; |
| 316 |
|
} else { |
| 317 |
< |
ddat.rho_i_at_j = 0.0; |
| 318 |
< |
ddat.rho_j_at_i = 0.0; |
| 317 |
> |
idat.rho_i_at_j = 0.0; |
| 318 |
> |
idat.rho_j_at_i = 0.0; |
| 319 |
|
} |
| 320 |
|
|
| 321 |
|
return; |
| 322 |
|
} |
| 323 |
|
|
| 324 |
< |
void SC::calcFunctional(FunctionalData fdat) { |
| 324 |
> |
void SC::calcFunctional(SelfData &sdat) { |
| 325 |
|
|
| 326 |
|
if (!initialized_) initialize(); |
| 327 |
|
|
| 328 |
< |
SCAtomData data1 = SCMap[fdat.atype]; |
| 328 |
> |
SCAtomData data1 = SCMap[sdat.atype]; |
| 329 |
|
|
| 330 |
< |
fdat.frho = - data1.c * data1.epsilon * sqrt(fdat.rho); |
| 331 |
< |
fdat.dfrhodrho = 0.5 * fdat.frho / fdat.rho; |
| 330 |
> |
sdat.frho = - data1.c * data1.epsilon * sqrt(sdat.rho); |
| 331 |
> |
sdat.dfrhodrho = 0.5 * sdat.frho / sdat.rho; |
| 332 |
|
|
| 333 |
|
return; |
| 334 |
|
} |
| 335 |
|
|
| 336 |
|
|
| 337 |
< |
void SC::calcForce(InteractionData idat) { |
| 337 |
> |
void SC::calcForce(InteractionData &idat) { |
| 338 |
|
|
| 339 |
|
if (!initialized_) initialize(); |
| 340 |
|
|
| 341 |
< |
SCAtomData data1 = SCMap[idat.atype1]; |
| 342 |
< |
SCAtomData data2 = SCMap[idat.atype2]; |
| 341 |
> |
SCAtomData data1 = SCMap[idat.atypes.first]; |
| 342 |
> |
SCAtomData data2 = SCMap[idat.atypes.second]; |
| 343 |
|
|
| 344 |
< |
SCInteractionData mixer = MixingMap[make_pair(idat.atype1, idat.atype2)]; |
| 344 |
> |
SCInteractionData mixer = MixingMap[idat.atypes]; |
| 345 |
|
|
| 346 |
|
RealType rcij = mixer.rCut; |
| 347 |
|
|
| 380 |
|
idat.fshift1 = - data1.c * data1.epsilon * sqrt(idat.rho1 - rhtmp); |
| 381 |
|
idat.fshift2 = - data2.c * data2.epsilon * sqrt(idat.rho2 - rhtmp); |
| 382 |
|
|
| 383 |
< |
idat.pot += pot_temp; |
| 383 |
> |
idat.pot[3] += pot_temp; |
| 384 |
|
} |
| 385 |
|
|
| 386 |
|
return; |
| 387 |
|
} |
| 388 |
|
|
| 389 |
< |
RealType SC::getSuggestedCutoffRadius(AtomType* at1, AtomType* at2) { |
| 389 |
> |
RealType SC::getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes) { |
| 390 |
|
if (!initialized_) initialize(); |
| 391 |
< |
pair<AtomType*, AtomType*> key = make_pair(at1, at2); |
| 391 |
> |
|
| 392 |
|
map<pair<AtomType*, AtomType*>, SCInteractionData>::iterator it; |
| 393 |
< |
it = MixingMap.find(key); |
| 393 |
> |
it = MixingMap.find(atypes); |
| 394 |
|
if (it == MixingMap.end()) |
| 395 |
|
return 0.0; |
| 396 |
|
else { |