| 107 |
|
zj = r <= ea2.getRcut() ? z2->getValueAt(r) : 0.0; |
| 108 |
|
|
| 109 |
|
phi = pre11_ * (zi * zj) / r; |
| 110 |
< |
|
| 110 |
> |
|
| 111 |
|
phivals.push_back(phi); |
| 112 |
|
} |
| 113 |
– |
|
| 113 |
|
CubicSpline* cs = new CubicSpline(); |
| 114 |
|
cs->addPoints(rvals, phivals); |
| 115 |
|
return cs; |
| 308 |
|
void EAM::calcFunctional(SelfData &sdat) { |
| 309 |
|
|
| 310 |
|
if (!initialized_) initialize(); |
| 312 |
– |
|
| 311 |
|
EAMAtomData &data1 = EAMdata[ EAMtids[sdat.atid] ]; |
| 312 |
|
|
| 313 |
< |
data1.F->getValueAndDerivativeAt( *(sdat.rho), *(sdat.frho), *(sdat.dfrhodrho) ); |
| 313 |
> |
data1.F->getValueAndDerivativeAt( *(sdat.rho), *(sdat.frho), |
| 314 |
> |
*(sdat.dfrhodrho) ); |
| 315 |
|
|
| 316 |
|
(*(sdat.pot))[METALLIC_FAMILY] += *(sdat.frho); |
| 317 |
|
if (sdat.doParticlePot) { |
| 332 |
|
|
| 333 |
|
int eamtid1 = EAMtids[idat.atid1]; |
| 334 |
|
int eamtid2 = EAMtids[idat.atid2]; |
| 336 |
– |
|
| 335 |
|
EAMAtomData &data1 = EAMdata[eamtid1]; |
| 336 |
|
EAMAtomData &data2 = EAMdata[eamtid2]; |
| 337 |
|
|
| 339 |
|
|
| 340 |
|
RealType rci = data1.rcut; |
| 341 |
|
RealType rcj = data2.rcut; |
| 342 |
+ |
|
| 343 |
|
|
| 344 |
|
RealType rha(0.0), drha(0.0), rhb(0.0), drhb(0.0); |
| 345 |
|
RealType pha(0.0), dpha(0.0), phb(0.0), dphb(0.0); |
| 357 |
|
CubicSpline* phi = MixingMap[eamtid2][eamtid2].phi; |
| 358 |
|
phi->getValueAndDerivativeAt( *(idat.rij), phb, dphb); |
| 359 |
|
} |
| 361 |
– |
|
| 360 |
|
switch(mixMeth_) { |
| 361 |
|
case eamJohnson: |
| 364 |
– |
|
| 362 |
|
if ( *(idat.rij) < rci) { |
| 363 |
|
phab = phab + 0.5 * (rhb / rha) * pha; |
| 364 |
|
dvpdr = dvpdr + 0.5*((rhb/rha)*dpha + |
| 365 |
|
pha*((drhb/rha) - (rhb*drha/rha/rha))); |
| 366 |
|
} |
| 367 |
< |
|
| 371 |
< |
|
| 372 |
< |
|
| 367 |
> |
|
| 368 |
|
if ( *(idat.rij) < rcj) { |
| 369 |
|
phab = phab + 0.5 * (rha / rhb) * phb; |
| 370 |
|
dvpdr = dvpdr + 0.5 * ((rha/rhb)*dphb + |
| 371 |
|
phb*((drha/rhb) - (rha*drhb/rhb/rhb))); |
| 372 |
|
} |
| 378 |
– |
|
| 373 |
|
break; |
| 380 |
– |
|
| 374 |
|
case eamDaw: |
| 382 |
– |
|
| 375 |
|
if ( *(idat.rij) < MixingMap[eamtid1][eamtid2].rcut) { |
| 376 |
|
MixingMap[eamtid1][eamtid2].phi->getValueAndDerivativeAt( *(idat.rij), |
| 377 |
|
phab, dvpdr); |
| 378 |
|
} |
| 387 |
– |
|
| 379 |
|
break; |
| 380 |
|
case eamUnknown: |
| 381 |
|
default: |
| 396 |
|
|
| 397 |
|
*(idat.f1) += *(idat.d) * dudr / *(idat.rij); |
| 398 |
|
|
| 408 |
– |
|
| 399 |
|
if (idat.doParticlePot) { |
| 400 |
|
// particlePot is the difference between the full potential and |
| 401 |
|
// the full potential without the presence of a particular |
| 413 |
|
- *(idat.frho1); |
| 414 |
|
} |
| 415 |
|
|
| 416 |
< |
(*(idat.pot))[METALLIC_FAMILY] += phab; |
| 417 |
< |
|
| 418 |
< |
*(idat.vpair) += phab; |
| 429 |
< |
|
| 430 |
< |
return; |
| 431 |
< |
|
| 416 |
> |
(*(idat.pot))[METALLIC_FAMILY] += phab; |
| 417 |
> |
*(idat.vpair) += phab; |
| 418 |
> |
return; |
| 419 |
|
} |
| 420 |
|
|
| 421 |
|
RealType EAM::getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes) { |