forked from lijiext/lammps
Fixed issue with switching function derivative in PairAIREBO::FLJ
Since we compute dvdw as d vdw / d rij, we have to also compute dslw as d slw / d rij. Currently, we compute -1/r d slw/d rij, which leads to incorrect results when the two are later combined. Alternatively, one could also modify dvdw to be -1/r d vdw/d rij, which would be a more standard way to do LJ calculations, but this way seems more consistent.
This commit is contained in:
parent
fc3505fac4
commit
904609a7a3
|
@ -753,7 +753,7 @@ void PairAIREBO::FLJ(int eflag, int vflag)
|
||||||
tee = drij / swidth;
|
tee = drij / swidth;
|
||||||
tee2 = tee*tee;
|
tee2 = tee*tee;
|
||||||
slw = 1.0 - tee2 * (3.0 - 2.0 * tee);
|
slw = 1.0 - tee2 * (3.0 - 2.0 * tee);
|
||||||
dslw = 6.0 * tee * (1.0 - tee) / rij / swidth;
|
dslw = -6.0 * tee * (1.0 - tee) / swidth;
|
||||||
} else {
|
} else {
|
||||||
slw = 1.0;
|
slw = 1.0;
|
||||||
dslw = 0.0;
|
dslw = 0.0;
|
||||||
|
|
Loading…
Reference in New Issue