[lammps-users] Question about using python to call eam/alloy pair coeff


I am using lammps(29Sep21) as a shared library and running python on my mac. I meet an error when I try to execute “pair_coeff” command:

from lammps import lammps
import numpy as np

lmp = lammps()

units metal
dimension 3
boundary p p p
timestep 0.002
atom_modify map array sort 0 0.0

read_data NiFe_65.dat

group Ni type 1
group Fe type 2

mass 1 58.6934
mass 2 55.845

pair_style eam/alloy
pair_coeff * * 2011_FeNiCr.eam.alloy Ni Fe

neighbor 1.0 bin
neigh_modify every 1 delay 0 check yes

run 0

it says:

The only way to get this kind of error is with a broken eam/alloy potential file.
Your “local” LAMMPS version may work if it is an older version of LAMMPS that does not check for correct input as thoroughly as more recent LAMMPS versions and will instead read incorrect values.

The error is in the file itself, which usually means that the program that created it was faulty.
If you have access to the source code, you may be able to correct it and regenerate that file.
Otherwise, I would look for a different potential file for the same elements. This is not an unusual combination…

I will try that. Thanks so much for the information.


Do you know how to fix this? or check how the most recent lammps read the eam potential file?