eam pair_style issue


I found an issue/bug related to using the classic eam pair_style with multiple atom types. As an example, I get drastically different energy values if I use two atom types and assign the same element to them than if I use one atom type. You can test with the input script below, switching between the two variations by commenting and uncommenting the 1 and 2 atom type sections. I was running different versions of LAMMPS: 27 Aug 2016 is fine (same energies for 1 and 2 atom types), while 17 Nov 2016 and the most recent versions are not.

Lucas Hale

units metal

atom_style atomic

boundary p p p

#Generate CsCl lattice with one element (i.e. bcc)

lattice custom 3.2378 &

a1 1.0 0.0 0.0 &

a2 0.0 1.0 0.0 &

a3 0.0 0.0 1.0 &

basis 0.0 0.0 0.0 &

basis 0.5 0.5 0.5

region box block 0.0 10.0 0.0 10.0 0.0 10.0

####1 atom type#####

#create_box 1 box

#create_atoms 1 box


thanks for reporting. this is indeed a bug, that was introduced, when support for thermodynamic integration was added to pair style eam.
the following 1 line change will restore the correct behavior. please note, that this issue only appears when you apply two separate EAM potential files and depend on LAMMPS computing the mixed interactions.


pair_coeff * * 1989–Adams-J-B–Au/auu6.txt

the energies and forces should have been correct.


here is the modification (which will hopefully included into the next patch for LAMMPS).

diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp
index a610ca1…d3ac395 100644
— a/src/MANYBODY/pair_eam.cpp
+++ b/src/MANYBODY/pair_eam.cpp
@@ -429,6 +429,7 @@ double PairEAM::init_one(int i, int j)
// for funcfl could be multiple files
// for setfl or fs, just one file

  • if (setflag[i][j] == 0) scale[i][j] = 1.0;
    scale[j][i] = scale[i][j];

if (funcfl) {