Hello everyone:
I encountered the error “ERROR: Expected integer parameter instead of ‘0.00000’ in input script or data file (…/atom.cpp:1121)”. But I don’t think it is the mistake of the data file, because it download from a paper link. So, does anyone know how to solve this error. Thank you so much!
Three comments:
- you provide no reference of what specific file you are referring to, what LAMMPS version you are using, what platform you are running on and which LAMMPS version the reference was using. If nobody can reproduce what you are seeing, nobody can make a meaningful to the point suggestion
- The format of data files is different for different atom styles. So downloading a valid file is not sufficient to get no error reading it
- LAMMPS as a program is evolving over time and so does the data file format. It is thus crucial to know the version. Specifically data files from very old LAMMPS versions (e.g. a Fortran versions) may be incompatible with a current LAMMPS version
Most likely is that your input file does not use the correct atom style. But if you want better help than an educated guess, you will have to provide more details.
Thank you for your comments.
My Lammps version is June 23, 2022. I have uploaded the input file and.dat file (GitHub - BrokenHeart2021/Lammps-test), which is an equilibration process. I conducted it on my PC and got that error. I know one also has this problem shown in the attachment picture. Maybe it is caused by PC; I have no idea about it. I will try to conduct it on a supercomputer.
No. The problem is that the data file is not correctly formatted.
You have atom style “charge” and there the Atoms section has either 6 or 9 columns
You have atom-ID atom-type q x y z
and optionally ix iy iz
for image flags. Those image flags are integers, but your data file has:
Atoms
1 1 -2 1.31400 -0.75900 3.39800 0.00000 0.00000 0.00000
2 1 -2 5.60900 -3.23800 3.39800 0.00000 0.00000 0.00000
3 1 -2 9.90300 -5.71800 3.39800 0.00000 0.00000 0.00000
4 1 -2 14.19800 -8.19700 3.39800 0.00000 0.00000 0.00000
5 1 -2 18.49200 -10.67700 3.39800 0.00000 0.00000 0.00000
6 1 -2 22.78700 -13.15600 3.39800 0.00000 0.00000 0.00000
7 1 -2 27.08100 -15.63500 3.39800 0.00000 0.00000 0.00000
8 1 -2 31.37600 -18.11500 3.39800 0.00000 0.00000 0.00000
[...]
While the correct format would be:
Atoms
1 1 -2 1.31400 -0.75900 3.39800 0 0 0
2 1 -2 5.60900 -3.23800 3.39800 0 0 0
3 1 -2 9.90300 -5.71800 3.39800 0 0 0
4 1 -2 14.19800 -8.19700 3.39800 0 0 0
5 1 -2 18.49200 -10.67700 3.39800 0 0 0
6 1 -2 22.78700 -13.15600 3.39800 0 0 0
7 1 -2 27.08100 -15.63500 3.39800 0 0 0
8 1 -2 31.37600 -18.11500 3.39800 0 0 0
[...]
Very old LAMMPS versions had a bug where it would not detect if there was a floating point number used where an integer is required. The conversion would simply stop at the first non-conforming character. So if somebody had written 0.5, LAMMPS would read this as 0. This was corrected a looooong time ago. But I strongly advise against using such old LAMMPS versions because this very same bug can easily produce incorrect simulations when input parameters are incorrectly read without throwing an error.
That said, image flags of value 0 are redundant, so the last 3 columns in the Atoms section could also be simply deleted.
Dear Axel, Thank you so much for your detailed explanation of my problem. I understand this question totally. BTW, I forgot to introduce myself. I am a PhD student at Xi’an Jiaotong University, majoring in material science. You can call me Pengfei. Thank you again.
Pengfei