Error Message reading data

Hello!!! Giving a bit of context, what I want to achieve with this code
(in.eam - Google Drive, in.eam (1.5 KB)) is to collide a copper nanoparticle with a nickel surface (I obtained these files from Ovito, so I’m using read_data Cu.data (18.1 KB), Ni.data - Google Drive )). However, I have an error and I would like to consult it with you:
The code reads the surface or the copper nanoparticle separately (when using #), but it doesn’t read them together. When I try to execute the code with both, I get the following output:

LAMMPS (7 Aug 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (…/comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (…/comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
Reading data file …
orthogonal box = (0 0 0) to (49.9998 49.9998 49.9998)
1 by 1 by 1 MPI processor grid
reading atoms …
378 atoms
read_data CPU = 0 secs
Lattice spacing in x,y,z = 3.52 3.52 3.52
ERROR: Cannot read_data without add keyword after simulation box is defined (…/read_data.cpp:302)
Last command: read_data Ni.data

Or, if I place the nickel surface .data file first, I get the following:

LAMMPS (7 Aug 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (…/comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (…/comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
Lattice spacing in x,y,z = 3.52 3.52 3.52
Reading data file …
orthogonal box = (0 0 0) to (200 200 200)
1 by 1 by 1 MPI processor grid
reading atoms …
370386 atoms
read_data CPU = 0.627239 secs
ERROR: Cannot read_data without add keyword after simulation box is defined (…/read_data.cpp:302)
Last command: read_data Cu.data

When I add the “add” keyword, I get the following (abbreviated):

ERROR: Illegal read_data command (…/read_data.cpp:144)
Last command: read_data Ni.data add

Now, if I modify the code to only view the nickel surface, I get:

And now, only the copper surface:

I don’t understand the error. I know that the files are correct separately, but when I combine them in the simulation, I have problems. Should I update LAMMPS perhaps? Or should it work the same?

In my understanding, the error might be in this part, but I’m not sure what exactly is wrong or how to fix it:

atom_style atomic
atom_modify map array
lattice fcc 3.52
region box block 0 40.0 0 40.0 0 40.0 units lattice # Here I’m trying to create the region #where the collision will take place
#create_box 3 box
read_data Ni.data
read_data Cu.data

Your help would be greatly appreciated. I’m stuck on this and your attention would be of great help. Thank you very much.

All you need to do is to read the documentation.

A little background: In a simulation there is only one simulation cell. Also, in LAMMPS certain properties like the total number of atom types are locked in once the box is defined. Thus LAMMPS will refuse any command or operation that will either define a new simulation cell or exceed any property that are already “locked in” when defining the simulation cell.

The read_data command does just that. It sets up how many atom types (and bond types, etc.) are there and defines the simulation cell. Thus issuing another read_data command cannot be used as such since it wants to change or reset what cannot be changed, hence the errors.

However, the read_data command as an “add” option that tells the read_data command, to merge the new system with the existing system. This add option has multiple “modes” to describe how the two systems are supposed to be merged.

Given the simplicity of the setup of your simulation, I don’t quite understand where the benefit is in creating the geometries externally and then going through the pains of merging those with LAMMPS. With the lattice, region, and create_atoms commands (and also create_box, if course), it is rather straightforward to generate such a kind of system directly within LAMMPS.

Thanks! After reading the documentation, I was able to solve that problem. I put “read_data Cu.data add 370387” in the code, and it solved the problem.

My teacher recommended and taught me how to use Ovito to handle those bodies.

Now I’m having problems with the definition of eam/alloy. I’m trying to understand the documentation, but maybe I need a little help, like in the previous case. This is the eam/alloy potential that I’m using and how I implemented it in the script (
FeCuNi.eam.alloy (1.2 MB)):

pair_style eam/alloy
pair_coeff * * FeCuNi.eam.alloy Cu Ni

This is the error message I’m receiving:

ERROR: Incorrect args for pair coefficients (…/pair_eam_alloy.cpp:51) Last command: pair_coeff * * FeCuNi.eam.alloy Cu Ni

I think I’m doing everything correctly. The “* *” symbol means that I’m applying that potential to all the atoms, and the arguments are correct (just using Cu Ni), just as stated in FeCuNi.eam.alloy.

When I read the documentation, I couldn’t understand what my problem was. I’ve been trying to understand the following sections:

Could you please give me a little hint?

You need to keep reading the read_data documentation some more, this is where your problem originates. Also , you should experiment with the info command to check if your input file does what you think it does. Overall, you have to thank your adviser to give you incomplete training and thus ask for more.

Again, creating such a system in LAMMPS directly is way simpler.

I tried to create those systems in LAMMPS but I couldnt.

And I thought I had resolved the problem with the read_data command. I will continue reading the read_data documentation to see where my mistake is. Thanks for your advice.