Hi, I'm new and I need some help in my code

Hi, well, this what I’m strugglin to right now:

ERROR: Invalid command-line argument (…/lammps.cpp:363)

And this is my code (link code: in.eam.alloy - Google Drive):

#Define the simulation and general parameters
units metal
dimension 3
boundary p p p
atom_style atomic
atom_modify map array

#Define atomic masses
mass 1 58.6934 # Ni
mass 2 63.546 # Cu

#Define EAM potentials
pair_style eam/alloy pair_coeff * * .\FeCuNi.eam.alloy Ni Cu Fe

#Create the simulation box and read the systems
lattice custom 3.52 a1 1 0 0 a2 0 1 0 a3 0 0 1
region box block 0 20 0 20 0 10
create_box 2 box
create_atoms 1 box

#Read the Ni surface
read_data .\Ni_surface.lammps

#Read the 1 nm Cu nanoparticle
read_data .\Cu_1nm.lammps

#Set initial velocities for the nanoparticle
velocity 2 create 1.0 1234567 dist gaussian

#Set temperature conditions and thermostat
velocity all create 300.0 1234567 dist gaussian
fix 1 all langevin 300.0 300.0 100.0 1234567

#Define interatomic interactions
fix 2 all nve

dump 1 all atom 100 dump.shear

#Define data output
thermo 100
thermo_style custom step temp pe ke etotal

#Run the simulation
reset_timestep 0
timestep 0.001
run 1000

I was trying to generate a (100)-oriented Ni surface with dimensions of 20x20 and a thickness of 10 nm, along with spherical Cu nanoparticles of crystalline structure measuring 1 nm and 2 nm , and already did it. The sphere will be launched perpendicularly onto the surface with velocities of 1 m/s, 10 m/s, and 100 m/s. I need to employ LAMMPS to simulate the system at T=300K, assuming atomic interactions modeled with an EAM potential for Ni (surface) and Cu (particle).

The objective is to investigate the various morphological effects as a function of parameters such as velocity and particle diameter. Additionally, we will identify the different defects generated, including stacking faults, twinning, recrystallization, etc., and compare our findings with existing literature.

Subsequently, we will switch the surface to a polycrystalline Ni system and repeat the study to examine the impact of grain boundaries on defect propagation.

I hope you can help me with the code, I’m new on this but is a really fun and useful software. Take care!

This error means that LAMMPS has not even reached the point where it starts processing your input, but already fails due to incorrect use of command line flags.

what I can fix to solve this? Im confused

How to run LAMMPS is explained in the documentation: 4. Run LAMMPS — LAMMPS documentation

Do u know an example of a code that 2 particules collides, or 2 objects coliding? Now I learn about my past mistake, but the error is this one:

ERROR: Expected floating point parameter instead of ‘a2’ in input script or data file (…/lattice.cpp:192)
Last command: lattice custom 3.52 a1 100 a2 010 a3 001

Where I can find the documentation to lear to fix that?

Please take a step back and think before you continue. You are trying to rush into doing a complex task with no preparation and no detailed knowledge of what you are about to do. This is a way of guaranteed frustration, confusion, and will likely end up with bad or barely acceptable simulation data.

The proper way to go about this is to let your research project rest for a bit and work on the basics, both for LAMMPS syntax and conventions as well as how to debug and correct mistakes, but also for how to properly and effectively plan, set up, execute, and analyze MD simulations. You are trying to do something that is far more complex than just putting together an input with cut-n-paste, let it run and then pick up the results. There is quite a bit of craftsmanship involved beyond the science (which is a chunk of work, too, as it usually requires a decent understanding of statistical thermodynamics). Bottom line, having an input that runs without an error is the easiest to solve problem; but that is where the real work starts.

Thus I suggest, you work your way through some of the available tutorial materials and examples, even if they are far from what you intend to do as an MD simulation project. That will provide you with the basic understanding of the processes and you have some results to compare to in order to see, whether you properly understand what you are doing.
Some materials are listed here: LAMMPS Tutorials

Of course, any error like you quoted is a sign that your input is contradicting the documentation. This is available online at https://docs.lammps.org/
The list of available commands, general input syntax and parsing rules, with links to the individual command documentation is here: 5. Commands — LAMMPS documentation

Thanks for your detailed response, and I believe you’re absolutely right. First, I need to be systematic in learning these complex concepts. I am working on this for a university project as I am studying Physics Engineering, and I hope to receive some assistance from my professor. However, I do realize that I need to delve deeper into this language and strive to develop a better understanding of how it works. This way, I can ask more insightful questions in the future. Currently, I am working on something specific, such as the surface and related aspects (Proyecto - Google Drive). However, my first priority is to adequately prepare myself to comprehend what I am working on before exploring new avenues or seeking further assistance. I will make sure to read the tutorials you suggested and study relevant examples to enhance my understanding.

Once again, thank you for your detailed response. Take care!


I hope you’re doing well. I’m currently exploring an example of the interaction between two elements using eam/alloy potentials based on your recommendations. However, I’m uncertain about the correct method for calling the potential. Should I use the CuNi.eam.alloy potential alone, or should I consider Cu_u3.eam and Ni_u3.eam potentials separately?

Could you provide an example that would assist me in better understanding this? I’m interested in a simulation where two elements interact using eam/alloy potentials, and I would like to visualize it in ovito. So far, the closest examples I’ve found are shear and stritz, but they haven’t provided much clarity.

I have already gone through the documentation available at smcm.iqfr.csic.es/docs/lammps/pair_eam.html and watched all the basic vids by EnCodeVentor (official lammps). The latest I watched was Two Element Simulations in LAMMPS, which was quite helpful in understanding the code. However, having a working example that demonstrates the concepts would enable me to learn more effectively. In the meantime, I will continue to study independently, although it can sometimes be frustrating.

Thank you for your support!

pd: Link Input file (in.eam - Google Drive)

Have you read any previous journal studies that use EAM potentials to study two-element mixtures?

Do they use just parameters for each individual element, or do they also specify inter-elemental parameters?

Where do you recommend me to look for journal studies where I can find that kind of examples?

Thanks for your response!

The obvious starting point would be the publication(s) that describes the potential(s) in question and the publication(s) that describe the EAM potential in general.