forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8798 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
56e152e97d
commit
356d67afc8
|
@ -206,6 +206,8 @@ void PairEAM::compute(int eflag, int vflag)
|
|||
|
||||
// fp = derivative of embedding energy at each atom
|
||||
// phi = embedding energy at each atom
|
||||
// if rho > rhomax (e.g. due to close approach of two atoms),
|
||||
// will exceed table, so add linear term to conserve energy
|
||||
|
||||
for (ii = 0; ii < inum; ii++) {
|
||||
i = ilist[ii];
|
||||
|
@ -218,6 +220,7 @@ void PairEAM::compute(int eflag, int vflag)
|
|||
fp[i] = (coeff[0]*p + coeff[1])*p + coeff[2];
|
||||
if (eflag) {
|
||||
phi = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
|
||||
if (rho[i] > rhomax) phi += fp[i] * (rho[i]-rhomax);
|
||||
if (eflag_global) eng_vdwl += phi;
|
||||
if (eflag_atom) eatom[i] += phi;
|
||||
}
|
||||
|
@ -491,7 +494,7 @@ void PairEAM::file2array()
|
|||
// active means some element is pointing at it via map
|
||||
|
||||
int active;
|
||||
double rmax,rhomax;
|
||||
double rmax;
|
||||
dr = drho = rmax = rhomax = 0.0;
|
||||
|
||||
for (int i = 0; i < nfuncfl; i++) {
|
||||
|
|
|
@ -41,7 +41,7 @@ class PairEAM : public Pair {
|
|||
|
||||
// potentials in spline form used for force computation
|
||||
|
||||
double dr,rdr,drho,rdrho;
|
||||
double dr,rdr,drho,rdrho,rhomax;
|
||||
double ***rhor_spline,***frho_spline,***z2r_spline;
|
||||
|
||||
PairEAM(class LAMMPS *);
|
||||
|
|
|
@ -219,6 +219,7 @@ void PairEAMAlloy::file2array()
|
|||
nr = setfl->nr;
|
||||
drho = setfl->drho;
|
||||
dr = setfl->dr;
|
||||
rhomax = (nrho-1) * drho;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// setup frho arrays
|
||||
|
|
|
@ -224,6 +224,7 @@ void PairEAMFS::file2array()
|
|||
nr = fs->nr;
|
||||
drho = fs->drho;
|
||||
dr = fs->dr;
|
||||
rhomax = (nrho-1) * drho;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// setup frho arrays
|
||||
|
|
|
@ -233,6 +233,8 @@ void PairEAMOpt::eval()
|
|||
|
||||
// fp = derivative of embedding energy at each atom
|
||||
// phi = embedding energy at each atom
|
||||
// if rho > rhomax (e.g. due to close approach of two atoms),
|
||||
// will exceed table, so add linear term to conserve energy
|
||||
|
||||
for (ii = 0; ii < inum; ii++) {
|
||||
i = ilist[ii];
|
||||
|
@ -244,6 +246,7 @@ void PairEAMOpt::eval()
|
|||
fp[i] = (coeff[0]*p + coeff[1])*p + coeff[2];
|
||||
if (EFLAG) {
|
||||
double phi = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
|
||||
if (rho[i] > rhomax) phi += fp[i] * (rho[i]-rhomax);
|
||||
if (eflag_global) eng_vdwl += phi;
|
||||
if (eflag_atom) eatom[i] += phi;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue