| 60 |
|
CubicSpline* z1 = ea1.getZ(); |
| 61 |
|
CubicSpline* z2 = ea2.getZ(); |
| 62 |
|
|
| 63 |
+ |
// Thise prefactors convert the charge-charge interactions into |
| 64 |
+ |
// kcal / mol all were computed assuming distances are measured in |
| 65 |
+ |
// angstroms Charge-Charge, assuming charges are measured in |
| 66 |
+ |
// electrons. Matches value in Electrostatics.cpp |
| 67 |
+ |
pre11_ = 332.0637778; |
| 68 |
+ |
|
| 69 |
|
// make the r grid: |
| 70 |
|
|
| 65 |
– |
|
| 71 |
|
// we need phi out to the largest value we'll encounter in the radial space; |
| 72 |
|
|
| 73 |
|
RealType rmax = 0.0; |
| 106 |
|
zi = r <= ea1.getRcut() ? z1->getValueAt(r) : 0.0; |
| 107 |
|
zj = r <= ea2.getRcut() ? z2->getValueAt(r) : 0.0; |
| 108 |
|
|
| 109 |
< |
phi = 331.999296 * (zi * zj) / r; |
| 109 |
> |
phi = pre11_ * (zi * zj) / r; |
| 110 |
|
|
| 111 |
|
phivals.push_back(phi); |
| 112 |
|
} |
| 212 |
|
eamAtomData.F = ea.getF(); |
| 213 |
|
eamAtomData.Z = ea.getZ(); |
| 214 |
|
eamAtomData.rcut = ea.getRcut(); |
| 215 |
< |
|
| 215 |
> |
|
| 216 |
|
// add it to the map: |
| 217 |
|
int atid = atomType->getIdent(); |
| 218 |
|
int eamtid = EAMtypes.size(); |
| 228 |
|
simError(); |
| 229 |
|
} |
| 230 |
|
|
| 231 |
+ |
|
| 232 |
|
EAMtids[atid] = eamtid; |
| 233 |
|
EAMdata[eamtid] = eamAtomData; |
| 234 |
|
MixingMap[eamtid].resize(nEAM_); |
| 243 |
|
|
| 244 |
|
EAMInteractionData mixer; |
| 245 |
|
mixer.phi = getPhi(atomType, atype2); |
| 246 |
+ |
mixer.rcut = mixer.phi->getLimits().second; |
| 247 |
|
mixer.explicitlySet = false; |
| 248 |
|
|
| 249 |
|
MixingMap[eamtid2].resize( nEAM_ ); |
| 272 |
|
|
| 273 |
|
cs->addPoints(rVals, phiVals); |
| 274 |
|
mixer.phi = cs; |
| 275 |
+ |
mixer.rcut = mixer.phi->getLimits().second; |
| 276 |
|
mixer.explicitlySet = true; |
| 277 |
|
|
| 278 |
|
int eamtid1 = EAMtids[ atype1->getIdent() ]; |
| 294 |
|
|
| 295 |
|
if (haveCutoffRadius_) |
| 296 |
|
if ( *(idat.rij) > eamRcut_) return; |
| 289 |
– |
|
| 290 |
– |
if ( *(idat.rij) < data1.rcut) |
| 291 |
– |
*(idat.rho1) += data1.rho->getValueAt( *(idat.rij)); |
| 297 |
|
|
| 298 |
+ |
if ( *(idat.rij) < data1.rcut) { |
| 299 |
+ |
*(idat.rho2) += data1.rho->getValueAt( *(idat.rij)); |
| 300 |
+ |
} |
| 301 |
|
|
| 302 |
< |
if ( *(idat.rij) < data2.rcut) |
| 303 |
< |
*(idat.rho2) += data2.rho->getValueAt( *(idat.rij)); |
| 302 |
> |
if ( *(idat.rij) < data2.rcut) { |
| 303 |
> |
*(idat.rho1) += data2.rho->getValueAt( *(idat.rij)); |
| 304 |
> |
} |
| 305 |
|
|
| 306 |
|
return; |
| 307 |
|
} |
| 311 |
|
if (!initialized_) initialize(); |
| 312 |
|
|
| 313 |
|
EAMAtomData &data1 = EAMdata[ EAMtids[sdat.atid] ]; |
| 314 |
< |
|
| 314 |
> |
|
| 315 |
|
data1.F->getValueAndDerivativeAt( *(sdat.rho), *(sdat.frho), *(sdat.dfrhodrho) ); |
| 316 |
|
|
| 317 |
|
(*(sdat.pot))[METALLIC_FAMILY] += *(sdat.frho); |
| 379 |
|
break; |
| 380 |
|
|
| 381 |
|
case eamDaw: |
| 373 |
– |
MixingMap[eamtid1][eamtid2].phi->getValueAndDerivativeAt( *(idat.rij), phab, dvpdr); |
| 382 |
|
|
| 383 |
+ |
if ( *(idat.rij) < MixingMap[eamtid1][eamtid2].rcut) { |
| 384 |
+ |
MixingMap[eamtid1][eamtid2].phi->getValueAndDerivativeAt( *(idat.rij), |
| 385 |
+ |
phab, dvpdr); |
| 386 |
+ |
} |
| 387 |
+ |
|
| 388 |
|
break; |
| 389 |
|
case eamUnknown: |
| 390 |
|
default: |
| 404 |
|
dudr = drhojdr* *(idat.dfrho1) + drhoidr* *(idat.dfrho2) + dvpdr; |
| 405 |
|
|
| 406 |
|
*(idat.f1) += *(idat.d) * dudr / *(idat.rij); |
| 407 |
+ |
|
| 408 |
|
|
| 409 |
|
if (idat.doParticlePot) { |
| 410 |
|
// particlePot is the difference between the full potential and |