May I ask a question about meam? (ERROR: Incorrect args for pair style meam coefficients (src/MEAM/pair_meam.cpp:231))

this is my error snapshot

this is my code.

this is my installed packages and other set

Hi @xll,

Please for future posts, take a look at the posting guidelines. They will help you to format your posts but also give you insights on the first step to take when having issues with lammps. This might give you more autonomy and help get more insightful answers when having a problem. The LAMMPS forum is not really aimed at general error handling and solving.

In your case, I think the error is raised because you define only two atom types in your command: create_box 2 box while giving 3 arguments to the pair_coeff command, the NULL argument counts.

I suggest you take a good read to the MEAM pair style documentation where this is explained in details. Also if I remember correctly, the syntax meam/c is an alias that was useful when there were 2 versions of the library (FORTRAN and C++). You can just use meam now.

This is a serious problem because the second parameter file NaCuSn-para.meam expects that you “extract” the parameters for Na Cu Sn from library.meam file and in exactly that order (it uses numbers not strings). Thus you either must manually edit the NaCuSn-para.meam file to only apply to Sn and Cu (which is error prone), or you must define 3 (three!) atom types with the create_box command and also set a mass for the third atom type. But you do not have to create an atom with the third atom type. You can also change the order by changing the mapping, so you may use something like this:

pair_coeff * * library.meam Na Cu Sn NaCuSn-para.meam Cu Sn Na

What the posted input shows is in violation with the existing documentation and thus the LAMMPS error is expected.

1 Like

@akohlmey is 100% correct in his remark. I assumed that the NaCuSn-para.meam file would contain only two elements which is probably wrong given the name.

(A reason for that being that raw pasted code/shell output is easier to read compared to screenshots. But this is no excuse to my mistake.)

Thank you so much. With your help, this little code can be successfully run. Thank you truly again.

Yeah. Absolutely meeting both of you is my luck. Thank you.