LAMMPS is the abbreviation for Large Atomic Molecular Massively Parallel Simulator. LAMMPS is a general purpose Molecular Dynamics simulation code that can be used to simulate a very large variety of systems. It is routinely used for studying crystalline solids, complex liquids, polymers, colloids and many other systems. LAMMPS is also GNU open source, which means you can download the source code and modify it if you have a MPI aware C++ compiler.

LAMMPS is a research tool, and it runs on some of the biggest clusters in the world, but it also runs on your laptop or PC. LAMMPS has been designed for getting the most out of the available hardware, it has not been designed to be particular user friendly, and there is no graphical user interface, and the error messages are perhaps not always that clear. So do not be surprised, if the learning curve is somewhat steep, but LAMMPS is FAST and that is what matters!

Installing LAMMPS

Follow the instructions in one of the links below depending on your operating system.

LAMMPS has no graphical user interface, and it is run from a command shell taking some text files as input to determine what simulation should be run. This is because on a typical cluster like ABACUS, we submit to a queue and wait until there are enough available compute nodes to run the simulation. A GUI is irrelevant, if the program should run on some 92 cores starting at 1AM in the morning!

Windows: After installing, you need to Start -> Run and type cmd to start the shell (AKA command line in windows). If you are not familiar with the shell have a look at this tutorial. Then you type lmp_serial <press enter> to start LAMMPS. If you get LAMMPS (date) and then nothing then the installation went well. LAMMPS is now waiting for you to type further commands to tell it what to do. Press  Ctrl+C stop it. Do not worry if it warns about OMP_NUM_THREADS not being defined.

If you get an error, then you should fix it before proceeding. If it can't find the lmp_serial executable, then you should find the executable (in the installation folder under bin), and manually add this to the PATH environment variable.

Mac/Linux: Since both Mac and Linux are offspring of Unix family of operating systems, they are in many ways quite similar. Note that the name of the executable could vary and typically the shell is called a Terminal. ABACUS and all other clusters in the world are based on Linux. For this reason, I also use Linux on all my computers, so I am not very familiar with how LAMMPS runs on Windows or Mac.

The serial executable uses one core on the processor and should always work. Most modern PCs and laptops have 2-4 cores, simulations will run faster if you use all of them. Again follow the detailed instructions for your operating system. Below I assume you are just running the serial LAMMPS executable.

Running LAMMPS

LAMMPS requires one or more text to define a system and how to run a simulation of it. For example, a demo.lam file defines the model you want to simulate, i.e. how particles are interacting, what kind of dynamics you want to simulate, and what kind of output to generate. The LAMMPS manual describes the format of this file should be written. Some times there is a second file e.g. demo.input. This file contains the initial positions of all particles in a system as well as information about chemical structure such as bonds, angles and so on. LAMMPS doesn't care about the file extensions, but I use these for consistency.

Both .lam and .input files are plain ascii text files that you can read and edit with a text editor. Do not use a word processing program!

Windows: You can use e.g. notepad. Be aware that Windows uses a different standard for line shifts compared to Unix. I can recommend using Notepad++ which is more powerful than notepad, and also reads and writes Unix text files. Also note that when you save the files in the browser, the browser might suggest .txt as an additional extension.

Mac/Linux: On Linux there is a plethora of text editors, my current favorite is atom, which also runs on Mac and Windows.

I propose you create a folder for each demo you want to run. For example, put the demo.lam and demo.input files in this folder and run the command  lmp_serial -in demo.lam  (or demo.lam.txt if this is what you called the file) in that folder  to run the simulation. It can take anywhere from minutes to hours to run a simulation. During the simulation you will see LAMMPS printing out thermodynamics information every so often. Every so often it also generates pictures of what the current system state looks like, these are saved in the img folder. After the simulation is completed, LAMMPS generates a movie of it that you can play (movie.avi).