Getting Started with LAMMPS - Nazarbayev University

Preview:

Citation preview

© 2020 Yanwei Wang

Getting Started with LAMMPS

Yanwei Wang

Department of Chemical and Materials Engineering

School of Engineering and Digital Sciences

Nazarbayev University

© 2020 Yanwei Wang

What is LAMMPS?

2

❑ LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel

Simulator and is a popular molecular dynamics program from Sandia

National Laboratories.

❑ Authors of LAMMPS: https://lammps.sandia.gov/authors.html

❑ How to cite LAMMPS: https://lammps.sandia.gov/cite.html

❑ Homepage of LAMMPS: https://lammps.sandia.gov/index.html

❑ The LAMMPS Manual: https://lammps.sandia.gov/doc/Manual.html

❑ LAMMPS Tutorials: https://lammps.sandia.gov/tutorials.html

❑ LAMMPS Workshops: https://lammps.sandia.gov/workshops.html

Lots of presentations to

spend your spare time

Bookmark this page!

© 2020 Yanwei Wang

❑ Download an executable for Windows

https://lammps.sandia.gov/doc/Install_windows.html

❑There are installer packages for 32-bit and 64-bit versions of Windows available. So,

which version should we install? It depends on the system type of your computer.

Install LAMMPS on Windows 10

3

© 2020 Yanwei Wang

Install LAMMPS on Windows 10

4

http://packages.lammps.org/windows.html

I am using a 64-bit windows laptop, so I should

download the 64-bit version

It is always a good idea to download the Latest stable versions

© 2020 Yanwei Wang

Install LAMMPS on Windows 10

5

Latest stable versions 64-bit Windows download area

Latest version

Let’s download the latest stable version:

LAMMPS-64bit-stable.exe

© 2020 Yanwei Wang

Install LAMMPS on Windows 10

6

Double-click on

the LAMMPS-

64bit-stable.exe

file that you have

downloaded.Click on More info

Run Anyway

1

2

3

© 2020 Yanwei Wang

Install LAMMPS on Windows 10

7

1 2 3

Let’s go to the folder where LAMMPS is installed and see what we’ve got

LAMMPS 64-bit 3Mar2020 Setup: Completed!

4

© 2020 Yanwei Wang

Install LAMMPS on Windows 10

8

Homework: Try to understand what you have got in each folder

© 2020 Yanwei Wang

My first LAMMPS Simulation

9

❑ Create a New Folder in your “Documents”. Name it “Lammps”.

❑ Create in “Lammps” a subfolder “melt”

❑ Copy files “in.chain” and “data.chain” from “C:\Program Files\LAMMPS

64-bit 3Mar2020\Benchmarks” to “melt”, the new folder that you have

just created. If you did everything as I told you to, the directory of Folder

“melt” should be “C:\Users\dell\Documents\LAMMPS\melt”

Those are the typical input files for a LAMMPS simulation.

© 2020 Yanwei Wang

My first LAMMPS Simulation

10

❑ Both “in.chain” and “data.chain” are simple text files, you may open

them with Notepad.

❑ To increase your work efficiency, I recommend that you install a more

power text editor, such as Notepad++ or Sublime Text. To learn more,

Google “Top 5 Best Text Editor For Windows In 2019”

© 2020 Yanwei Wang

My first LAMMPS Simulation

11

in.chaindata.chain

© 2020 Yanwei Wang

My first LAMMPS Simulation

12

❑ The LAMMPS executable files can be found in the folder

C:\Program Files\LAMMPS 64-bit 3Mar2020\bin

❑ It is troublesome if we run those executable files every time from that

“bin” folder. A better idea is to add the path “C:\Program Files\LAMMPS

64-bit 3Mar2020” to our system as system environment variables.

❑ If you are using windows 10, search “edit the system environment

variables” in the start.

© 2020 Yanwei Wang

My first LAMMPS Simulation

13

© 2020 Yanwei Wang

My first LAMMPS Simulation

14

Double-click on “Path”

Click on “New”, and add the path

“C:\Program Files\LAMMPS 64-bit 3Mar2020\bin”

1

2

34

© 2020 Yanwei Wang

My first LAMMPS Simulation

15

❑ If you are using windows 10, search “PowerShell” in the start.

“dell” is my username, which in

your case will be your username.

https://devblogs.microsoft.com/scripting/table-of-basic-powershell-commands/Table of Basic PowerShell Commands

You should learn some basic shell

commands. If you are familiar with basic

UNIX commands, they are very similar.

© 2020 Yanwei Wang

My first LAMMPS Simulation

16

Change your work directory to the

“melt” folder. You may simply type

“cd Doc” and type the magic “Tab”

key.

Type “ls’ to see what is in that

folder

Type “pwd” to see your current

work directory

© 2020 Yanwei Wang

My first LAMMPS Simulation

17

Now you ready for (maybe) your

first LAMMPS simulation.

Type “lmp” and try the magic “Tab”

key

When all is done, type the “Enter”

key to run your Lammps simulation.

“-in” can be replaced by “-i”

© 2020 Yanwei Wang

My first LAMMPS Simulation

18

This is also a text file. Open it with

Notepad or my favorite Notepad++,

and see what is in there.

Congratulations! You have conducted your

first LAMMPS simulation successfully.

Read this page https://lammps.sandia.gov/bench.html#chain

to learn more about this benchmark test.

Send me know your

results. Let’s see whose

computer has the best

performance ☺

© 2020 Yanwei Wang

❑ Copy from “C:\Program Files\LAMMPS 64-bit 3Mar2020\Examples”

folder “colloid”, “dreiding”, and “peptide” to your “LAMMPS” folder

More Examples

19

© 2020 Yanwei Wang

If the current work directory of your PowerShell is “C:\Users\dell\Documents\LAMMPS\melt”. Then, you

may type “cd ..” to go the upper-level folder. Let’s practice those Unix-like commands again.

More Examples

20

http://linuxcommand.org/tlcl.php

© 2020 Yanwei Wang21

More Examples

Type the “Enter” key to run

your Lammps simulation.

Now let’s try to modify the “in.colloid” file and run the simulation again.

Go to your /LAMMPS/colloid folder, and open “in.colloid” with Notepad++.

© 2020 Yanwei Wang22

More Examples

Remove the hashtag # and save

the file.

CTRL+S also works.

© 2020 Yanwei Wang23

More Examples You may use the arrow ↑ on your keyboard to

repeat the previous commands.

Run the simulation again and see what you

have got in your folder

C:\Users\dell\Documents\LAMMPS\colloid

© 2020 Yanwei Wang24

More Examples

© 2020 Yanwei Wang25

More Examples

Let’s try another example.

© 2020 Yanwei Wang26

More Examples

And another one

© 2020 Yanwei Wang

Homework

27

❑ Repeat the simulations described in this tutorial

❑ Try to go through all the input and output files of your LAMMPS

simulations

© 2020 Yanwei Wang

Further readings

28

❑ This is a set of nice tutorials created by the Center for Advanced

Vehicular Systems (CAVS) group at Mississippi State University:

LAMMPS tutorials

https://icme.hpc.msstate.edu/mediawiki/index.php/LAMMPS_tutorials

© 2020 Yanwei Wang

If Windows PowerShell isn’t power enough

29

Try Cygwin or Ubuntu on Windows 10

❑ Install Ubuntu on Windows 10 Cygwin https://cygwin.com/

www.nu.edu.kz © 2020 Yanwei Wang

Recommended