| 212 |
|
eamAtomData.F = ea.getF(); |
| 213 |
|
eamAtomData.Z = ea.getZ(); |
| 214 |
|
eamAtomData.rcut = ea.getRcut(); |
| 215 |
– |
eamAtomData.isFluctuating = atomType->isFluctuatingCharge(); |
| 215 |
|
|
| 216 |
|
// add it to the map: |
| 217 |
|
int atid = atomType->getIdent(); |
| 228 |
|
simError(); |
| 229 |
|
} |
| 230 |
|
|
| 232 |
– |
if (eamAtomData.isFluctuating) { |
| 233 |
– |
// compute charge to rho scaling: |
| 234 |
– |
RealType z0 = eamAtomData.Z->getValueAt(0.0); |
| 235 |
– |
RealType dr = ea.getDr(); |
| 236 |
– |
RealType rmax = max(eamAtomData.rcut, ea.getNr() * dr); |
| 237 |
– |
int nr = int(rmax/dr + 0.5); |
| 238 |
– |
RealType r; |
| 239 |
– |
RealType sum(0.0); |
| 231 |
|
|
| 241 |
– |
for (int i = 0; i < nr; i++) { |
| 242 |
– |
r = RealType(i*dr); |
| 243 |
– |
sum += r * r * eamAtomData.rho->getValueAt(r) * dr; |
| 244 |
– |
} |
| 245 |
– |
sum *= 4.0 * M_PI; |
| 246 |
– |
eamAtomData.qToRhoScaling = sum / z0; |
| 247 |
– |
} |
| 248 |
– |
|
| 249 |
– |
|
| 232 |
|
EAMtids[atid] = eamtid; |
| 233 |
|
EAMdata[eamtid] = eamAtomData; |
| 234 |
|
MixingMap[eamtid].resize(nEAM_); |
| 296 |
|
if ( *(idat.rij) > eamRcut_) return; |
| 297 |
|
|
| 298 |
|
if ( *(idat.rij) < data1.rcut) { |
| 299 |
< |
if (data1.isFluctuating) { |
| 318 |
< |
*(idat.rho2) += (1.0 - *(idat.flucQ1) * data1.qToRhoScaling ) * |
| 319 |
< |
data1.rho->getValueAt( *(idat.rij) ); |
| 320 |
< |
} else { |
| 321 |
< |
*(idat.rho2) += data1.rho->getValueAt( *(idat.rij)); |
| 322 |
< |
} |
| 299 |
> |
*(idat.rho2) += data1.rho->getValueAt( *(idat.rij)); |
| 300 |
|
} |
| 301 |
|
|
| 302 |
|
if ( *(idat.rij) < data2.rcut) { |
| 303 |
< |
if (data2.isFluctuating) { |
| 327 |
< |
*(idat.rho1) += (1.0 - *(idat.flucQ2) * data2.qToRhoScaling ) * |
| 328 |
< |
data2.rho->getValueAt( *(idat.rij) ); |
| 329 |
< |
} else { |
| 330 |
< |
*(idat.rho1) += data2.rho->getValueAt( *(idat.rij)); |
| 331 |
< |
} |
| 303 |
> |
*(idat.rho1) += data2.rho->getValueAt( *(idat.rij)); |
| 304 |
|
} |
| 305 |
|
|
| 306 |
|
return; |
| 351 |
|
data1.rho->getValueAndDerivativeAt( *(idat.rij), rha, drha); |
| 352 |
|
CubicSpline* phi = MixingMap[eamtid1][eamtid1].phi; |
| 353 |
|
phi->getValueAndDerivativeAt( *(idat.rij), pha, dpha); |
| 382 |
– |
if (data1.isFluctuating) { |
| 383 |
– |
*(idat.dVdFQ1) -= *(idat.dfrho2) * rha * data1.qToRhoScaling; |
| 384 |
– |
} |
| 354 |
|
} |
| 355 |
|
|
| 356 |
|
if ( *(idat.rij) < rcj) { |
| 357 |
|
data2.rho->getValueAndDerivativeAt( *(idat.rij), rhb, drhb ); |
| 358 |
|
CubicSpline* phi = MixingMap[eamtid2][eamtid2].phi; |
| 359 |
|
phi->getValueAndDerivativeAt( *(idat.rij), phb, dphb); |
| 391 |
– |
if (data2.isFluctuating) { |
| 392 |
– |
*(idat.dVdFQ2) -= *(idat.dfrho1) * rhb * data2.qToRhoScaling; |
| 393 |
– |
} |
| 360 |
|
} |
| 361 |
|
|
| 362 |
|
switch(mixMeth_) { |