0% found this document useful (0 votes)
12 views81 pages

LAMMPS Input Script Tutorial Guide

The document is a tutorial on LAMMPS, a molecular dynamics simulation software, detailing resources for learning, typical input script structures, and examples of input scripts for simulations. It covers various aspects such as defining potential interactions, setting up simulations, and using variables and tools for complex system construction. Additionally, it discusses output analysis and the use of pair styles for interaction potentials in simulations.

Uploaded by

lookyoursoul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views81 pages

LAMMPS Input Script Tutorial Guide

The document is a tutorial on LAMMPS, a molecular dynamics simulation software, detailing resources for learning, typical input script structures, and examples of input scripts for simulations. It covers various aspects such as defining potential interactions, setting up simulations, and using variables and tools for complex system construction. Additionally, it discusses output analysis and the use of pair styles for interaction potentials in simulations.

Uploaded by

lookyoursoul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

A Quick Tour of LAMMPS

Steve Plimpton
Sandia National Labs
sjplimp@[Link]

4th LAMMPS Workshop


August 2015 - Albuquerque, NM

Follow along with my slides at:


[Link] [Link]
Resources for learning LAMMPS

All on web site, most in distro tarball:

Web page links: Workshops (beginners sessions), Tutorials


Features list: [Link]
Manual: doc/[Link]
Intro, Commands, Packages, Accelerating,
Howto, Modifying, Errors sections
New format has index, allows searching
Alphabetized command list: one doc page per command
doc/Section [Link]#cmd 5
Papers: find a paper similar to what you want to model
Mail list: search archives, post Qs to it
[Link]
Examples: about 45 sub-dirs under examples in distro
lower-case = simple, upper-case = more complex
many have movies: [Link]
Structure of typical input scripts

1 Units and atom style


2 Create simulation box and atoms
region, create box, create atoms, region commands
lattice command vs box units
read data command
data file is a text file
look at examples/micelle/[Link]
see read data doc page for full syntax
3 Define groups
4 Attributes of atoms: mass, velocity
5 Pair style for atom interactions
6 Fixes for time integration and constraints
7 Computes for diagnostics
8 Output: thermo, dump, restart
9 Run or minimize
10 Rinse and repeat (script executed one command at a time)
Obstacle example

input script = examples/obstacle/[Link]


Obstacle input script

1st section = setup box and create atoms

# 2d LJ obstacle flow

dimension 2
boundary p s p
atom style atomic
neighbor 0.3 bin
neigh modify delay 5

# create geometry

lattice hex 0.7


region box block 0 40 0 10 -0.25 0.25
create box 3 box
create atoms 1 box
Obstacle input script

2nd section = define potential and groups of atoms

# LJ potentials

pair style lj/cut 1.12246


pair coeff * * 1.0 1.0 1.12246

# define groups

region 1 block INF INF INF 1.25 INF INF


group lower region 1
region 2 block INF INF 8.75 INF INF INF
group upper region 2
group boundary union lower upper
group flow subtract all boundary

set group lower type 2


set group upper type 3
Obstacle input script

3rd section = set velocities and fixes

# initial velocities

mass * 1.0
compute mobile flow temp
velocity flow create 1.0 482748 temp mobile
fix 1 all nve
fix 2 flow temp/rescale 200 1.0 1.0 0.02 1.0
fix modify 2 temp mobile

# Poiseuille flow

velocity boundary set 0.0 0.0 0.0


fix 3 lower setforce 0.0 0.0 0.0
fix 4 upper setforce 0.0 NULL 0.0
fix 5 upper aveforce 0.0 -0.5 0.0
fix 6 flow addforce 1.0 0.0 0.0
Obstacle input script

4th section = create 2 obstacles to flow

# 2 obstacles

region void1 sphere 10 4 0 3


delete atoms region void1
region void2 sphere 20 7 0 3
delete atoms region void2

fix 7 flow indent 100 sphere 10 4 0 4


fix 8 flow indent 100 sphere 20 7 0 4
fix 9 all enforce2d
Obstacle input script

5th section: define output and run simulation (JPG or PPM)

# run

timestep 0.003
thermo 1000
thermo modify temp mobile

#dump 1 all atom 100 [Link]


dump 1 all image 500 image.*.ppm type type &
zoom 1.6 adiam 1.5
dump modify 1 pad 5

run 25000
Obstacle example

Questions on input script?

Exercise: run examples/obstacle/[Link] on your box,


examine output.
Make a movie

50 JPG or PPM files


[Link]
ImageMagick display
Mac Preview
Make/view a movie
ImageMagick
convert *.jpg [Link]
open in browser
open -a Safari [Link]
Mac QuickTime
open image sequence
Windows Media Player
VMD, AtomEye, ...
Examine screen output

LAMMPS (15 Aug 2013)


Lattice spacing in x,y,z = 1.28436 2.22457 1.28436
Created orthogonal box = (0 0 -0.321089)
to (51.3743 22.2457 0.321089)
4 by 1 by 1 MPI processor grid
Created 840 atoms
120 atoms in group lower
120 atoms in group upper
240 atoms in group boundary
600 atoms in group flow
Setting atom values ...
120 settings made for type
Setting atom values ...
120 settings made for type
Deleted 36 atoms, new total = 804
Deleted 35 atoms, new total = 769
Thermo output

WARNING: Temperature for thermo pressure is not


for group all (../[Link])
Setting up run ...
Memory usage per processor = 2.23494 Mbytes
Step Temp E pair E mol TotEng Press Volume
0 1.0004177 0 0 0.68689281 0.46210058 1143.0857
1000 1 -0.32494012 0 0.36166587 1.2240503 1282.5239
2000 1 -0.37815616 0 0.30844982 1.0642877 1312.5691
...
...
...
25000 1 -0.36649381 0 0.32011217 0.98366691 1451.5444
25000 1 -0.38890426 0 0.29770172 0.95284427 1455.9361
Loop time of 1.76555 on 4 procs for
25000 steps with 769 atoms
Timing info

Loop time of 1.76555 on 4 procs for


25000 steps with 769 atoms

Pair time (%) = 0.14617 (8.27903)


Neigh time (%) = 0.0467809 (2.64966)
Comm time (%) = 0.307951 (17.4422)
Outpt time (%) = 0.674575 (38.2078)
Other time (%) = 0.590069 (33.4213)
Run statistics

Per-processor values at end of run

Nlocal: 192.25 ave 242 max 159 min


Histogram: 2 0 0 0 0 1 0 0 0 1
Nghost: 43 ave 45 max 39 min
Histogram: 1 0 0 0 0 0 0 0 2 1
Neighs: 414 ave 588 max 284 min
Histogram: 2 0 0 0 0 0 1 0 0 1

Total # of neighbors = 1656


Ave neighs/atom = 2.15345
Neighbor list builds = 1641
Dangerous builds = 1
Run statistics

Per-processor values at end of run

Nlocal: 192.25 ave 242 max 159 min


Histogram: 2 0 0 0 0 1 0 0 0 1
Nghost: 43 ave 45 max 39 min
Histogram: 1 0 0 0 0 0 0 0 2 1
Neighs: 414 ave 588 max 284 min
Histogram: 2 0 0 0 0 0 1 0 0 1

Total # of neighbors = 1656


Ave neighs/atom = 2.15345
Neighbor list builds = 1641
Dangerous builds = 1

Questions on output?
Defining variables in input scripts

Styles: index, loop, equal, atom, ...


variable x index run1 run2 run3 run4
variable x loop 100
variable x trap(f JJ[3])*${scale}
variable x atom -(c p[1]+c p[2]+c p[3])/(3*vol)
Defining variables in input scripts

Styles: index, loop, equal, atom, ...


variable x index run1 run2 run3 run4
variable x loop 100
variable x trap(f JJ[3])*${scale}
variable x atom -(c p[1]+c p[2]+c p[3])/(3*vol)
Formulas can be complex
see doc/[Link]
thermo keywords (temp, press, ...)
math operators & functions (sqrt, log, cos, ...)
group and region functions (count, xcm, fcm, ...)
various special functions (min, ave, trap, stride, stagger, ...)
per-atom vectors (x, vx, fx, ...)
output from computes, fixes, other variables
Formulas can be time- and/or spatially-dependent
Using variables in input scripts

Substitute in any command via $x or ${myVar}


Immediate formula evaluation via $ syntax:
avoids need to define variable separately
variable xmid equal (xlo+xhi)/2
region 1 block $xmid EDGE INF INF EDGE EDGE
region 1 block $((xlo+xhi)/2) EDGE INF INF EDGE EDGE
Next command increments a variable to next value
Many commands allow variables as arguments
fix addforce 0.0 v fy 1.0
dump modify every v foo
region sphere 0.0 0.0 0.0 v radius
Power tools for input scripts

Filename options:
dump.*.% for per-snapshot or per-processor output
read data [Link]
read restart [Link].*
If/then/else via if command
Insert another script via include command
useful for long list of params
Power tools for input scripts

Filename options:
dump.*.% for per-snapshot or per-processor output
read data [Link]
read restart [Link].*
If/then/else via if command
Insert another script via include command
useful for long list of params
Looping via next and jump commands
Invoke a shell command or external program
shell cd subdir1
shell my analyze [Link] $n ${param}
(New!) Invoke Python code from your script
pass LAMMPS data to Python, returne values in variables
Python function can make callbacks to LAMMPS
Various ways to run multiple simulations from one script
see doc/Section howto 6.4
Example script for multiple runs

8 successive simulations on P processors:

variable r equal random(1,1000000000,58798)


variable a loop 8
variable t index 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15
log log.$a
read [Link]
velocity all create $t $r
fix 1 all nvt $t $t 1.0
dump 1 all atom 1000 dump.$a.*
run 100000
next t
next a
jump [Link]
Example script for multiple runs

8 successive simulations on P processors:

variable r equal random(1,1000000000,58798)


variable a loop 8
variable t index 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15
log log.$a
read [Link]
velocity all create $t $r
fix 1 all nvt $t $t 1.0
dump 1 all atom 1000 dump.$a.*
run 100000
next t
next a
jump [Link]

Run 8 simulations on 3 partitions until finished:


change a & t to universe-style variables
mpirun -np 12 lmp linux -p 3x4 -in [Link]
Pre-processing tools to build complex systems

LAMMPS does not build molecular systems or auto-magically


assign force field parameters for you
Pre-processing tools to build complex systems

LAMMPS does not build molecular systems or auto-magically


assign force field parameters for you
Data file must include list of bonds, angles, etc
Data file can include force field assignments
Tools directory has converters for both steps
ch2lmp = CHARMM converter
amber2lmp = AMBER converter
msi2lmp = Accelrys converter
Pre-processing tools to build complex systems

LAMMPS does not build molecular systems or auto-magically


assign force field parameters for you
Data file must include list of bonds, angles, etc
Data file can include force field assignments
Tools directory has converters for both steps
ch2lmp = CHARMM converter
amber2lmp = AMBER converter
msi2lmp = Accelrys converter
Provided builders
Moltemplate (Andrew Jewett)
[Link] = chain and patch tools (Python)
Builders that can create LAMMPS input
see [Link]
VMD TopoTools (Axel Kohlmeyer)
Avogadro, Packmol, EMC (breakout A2)
EMC builder tool

EMC: Initial Structure Generation


Option A2, Thursday, 1-3pm
[Link]

bulk graft copolymer

multiphase surface
Pair styles

LAMMPS lingo for interaction potentials


Pair styles

LAMMPS lingo for interaction potentials


A pair style can be true pair-wise or many-body
LJ, Coulombic, Buckingham, Morse, Yukawa, ...
EAM, Tersoff, REBO, ReaxFF, ...
Bond/angle/dihedral/improper styles = permanent bonds
Pair styles

LAMMPS lingo for interaction potentials


A pair style can be true pair-wise or many-body
LJ, Coulombic, Buckingham, Morse, Yukawa, ...
EAM, Tersoff, REBO, ReaxFF, ...
Bond/angle/dihedral/improper styles = permanent bonds
Variants optimized for GPU and many-core
GPU, USER-OMP, USER-INTEL, KOKKOS packages
lj/cut, lj/cut/gpu, lj/cut/kk, lj/cut/omp
see doc/Section [Link]
see Kokkos talk by Stan Moore on Thurs AM
Coulomb interactions included in pair style
lj/cut, lj/cut/coul/cut, lj/cut/coul/wolf, lj/cut/coul/long
done to optimize inner loop
Categories of pair styles

Solids
eam, eim, meam, adp, etc
Bio and polymers
charmm, class2, gromacs, dreiding, etc
Reactive
tersoff, bop, airebo, comb, reax/c, etc
Coarse-grained
dpd, granular, sph, peri, colloid, lubricate, brownian, FLD
Aspherical
gayberne, resquared, line, tri, etc
Categories of pair styles

Solids
eam, eim, meam, adp, etc
Bio and polymers
charmm, class2, gromacs, dreiding, etc
Reactive
tersoff, bop, airebo, comb, reax/c, etc
Coarse-grained
dpd, granular, sph, peri, colloid, lubricate, brownian, FLD
Aspherical
gayberne, resquared, line, tri, etc

Pair table for tabulation of any pair-wise interaction


Pair hybrid style allows for hybrid models
polymers on metal
CNTs in water
solid-solid interface between 2 materials
Pair styles

See doc/Section [Link] for full list


Annotated with (cgikot) for accelerated variants
Pair styles

See doc/[Link] for one-line descriptions


Relative CPU cost of potentials

See [Link] for details


Can estimate how long your simulation will run
Bond styles (also angle, dihedral, improper)

Used for molecules with fixed bonds


Fix bond/break and bond style quartic can break them
To learn what bond styles LAMMPS has ...
where would you look?
Bond styles (also angle, dihedral, improper)

Used for molecules with fixed bonds


Fix bond/break and bond style quartic can break them
To learn what bond styles LAMMPS has ...
where would you look?
doc/Section [Link] or doc/bond [Link]
Long-range Coulombics

KSpace style in LAMMPS lingo, see doc/kspace [Link]


Options:
traditional Ewald, scales as O(N 3/2 )
PPPM (like PME), scales as O(N log(N))
MSM, scales as O(N), lj/cut/coul/msm
Additional options:
non-periodic, PPPM (z) vs MSM (xyz)
long-range dispersion (LJ)
Long-range Coulombics

KSpace style in LAMMPS lingo, see doc/kspace [Link]


Options:
traditional Ewald, scales as O(N 3/2 )
PPPM (like PME), scales as O(N log(N))
MSM, scales as O(N), lj/cut/coul/msm
Additional options:
non-periodic, PPPM (z) vs MSM (xyz)
long-range dispersion (LJ)
PPPM is fastest choice for most systems
FFTs can scale poorly for large processor counts
MSM can be faster for low-accuracy or large proc counts
Pay attention to cutoff & accuracy settings
can affect performance dramatically
adjust Real vs KSpace work
Fixes

Most flexible feature in LAMMPS


Allow control of “what” happens “when” within each timestep
Loop over timesteps:

communicate ghost atoms

build neighbor list (once in a while)


compute forces
communicate ghost forces

output to screen and files


Fixes

Most flexible feature in LAMMPS


Allow control of “what” happens “when” within each timestep
Loop over timesteps:
fix initial NVE, NVT, NPT, rigid-body integration
communicate ghost atoms
fix neighbor insert particles
build neighbor list (once in a while)
compute forces
communicate ghost forces
fix force SHAKE, langevin drag, wall, spring, gravity
fix final NVE, NVT, NPT, rigid-body integration
fix end volume & T rescaling, diagnostics
output to screen and files
Fixes

∼150 fixes in LAMMPS


You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix 1 all nve
fix 2 flow temp/rescale 200 1.0 1.0 0.02 1.0
fix 3 lower setforce 0.0 0.0 0.0
fix 5 upper aveforce 0.0 -0.5 0.0
fix 6 flow addforce 1.0 0.0 0.0
Fixes

∼150 fixes in LAMMPS


You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix 1 all nve
fix 2 flow temp/rescale 200 1.0 1.0 0.02 1.0
fix 3 lower setforce 0.0 0.0 0.0
fix 5 upper aveforce 0.0 -0.5 0.0
fix 6 flow addforce 1.0 0.0 0.0
To learn what fix styles LAMMPS has ...
where would you look?
Fixes

∼150 fixes in LAMMPS


You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix 1 all nve
fix 2 flow temp/rescale 200 1.0 1.0 0.02 1.0
fix 3 lower setforce 0.0 0.0 0.0
fix 5 upper aveforce 0.0 -0.5 0.0
fix 6 flow addforce 1.0 0.0 0.0
To learn what fix styles LAMMPS has ...
where would you look?
doc/Section [Link] or doc/[Link]
Fixes

∼150 fixes in LAMMPS


You choose what group of atoms to apply fix to
Already saw some in obstacle example:
fix 1 all nve
fix 2 flow temp/rescale 200 1.0 1.0 0.02 1.0
fix 3 lower setforce 0.0 0.0 0.0
fix 5 upper aveforce 0.0 -0.5 0.0
fix 6 flow addforce 1.0 0.0 0.0
To learn what fix styles LAMMPS has ...
where would you look?
doc/Section [Link] or doc/[Link]
If you familiarize yourself with fixes,
you’ll know many things LAMMPS can do
Many fixes store output accessible by other commands
rigid body COM
thermostat energy
forces before modified
Computes

∼80 computes in LAMMPS


Calculate some property of system, in parallel
Always for the current timestep
To learn what compute styles LAMMPS has ...
Computes

∼80 computes in LAMMPS


Calculate some property of system, in parallel
Always for the current timestep
To learn what compute styles LAMMPS has ...
doc/Section [Link] or doc/[Link]
Computes

Key point:
computes store their answers
other commands invoke them and use the results
e.g. thermo output, dumps, fixes
Output of computes:
global vs per-atom vs local
scalar vs vector vs array
extensive vs intensive values
Computes

Key point:
computes store their answers
other commands invoke them and use the results
e.g. thermo output, dumps, fixes
Output of computes:
global vs per-atom vs local
scalar vs vector vs array
extensive vs intensive values
Examples:
temp & pressure = global scalar or vector
pe/atom = potential energy per atom (vector)
displace/atom = displacement per atom (array)
pair/local & bond/local = per-neighbor or per-bond info
Many computes are useful with averaging fixes:
fix ave/time, ave/chunk (spatial), ave/atom
fix ave/histo, ave/correlate
Thermo output

One line of output every N timesteps to screen and log file


See doc/thermo [Link]
Thermo output

One line of output every N timesteps to screen and log file


See doc/thermo [Link]
Any scalar can be output:
dozens of keywords: temp, pyy, eangle, lz, cpu
any output of a compute or fix: c ID, f ID[N], c ID[N][M]
fix ave/time stores time-averaged quantities
equal-style variable: v MyVar
one value from atom-style variable: v xx[N]
any property for one atom: q, fx, quat, etc
Thermo output

One line of output every N timesteps to screen and log file


See doc/thermo [Link]
Any scalar can be output:
dozens of keywords: temp, pyy, eangle, lz, cpu
any output of a compute or fix: c ID, f ID[N], c ID[N][M]
fix ave/time stores time-averaged quantities
equal-style variable: v MyVar
one value from atom-style variable: v xx[N]
any property for one atom: q, fx, quat, etc
Post-process via:
tools/python/[Link] [Link] X Y (via GnuPlot)
tools/python/[Link] [Link] [Link] X Y ...
[Link] log tool
can read thermo output across multiple runs
Dump output

Snapshot of per-atom values every N timesteps


See doc/[Link]
Dump output

Snapshot of per-atom values every N timesteps


See doc/[Link]
Styles
atom, custom (both native LAMMPS)
VMD will auto-read if file named *.lammpstraj
xyz for coords only
cfg for AtomEye
DCD, XTC for CHARMM, NAMD, GROMACS
good for back-and-forth runs and analysis
Two additional styles
local: per-neighbor, per-bond, etc info
image: instant picture, rendered in parallel
Dump output

Any per-atom quantity can be output


dozens of keywords: id, type, x, xs, xu, mux, omegax, ...
any output of a compute or fix: f ID, c ID[M]
atom-style variable: v foo
Dump output

Any per-atom quantity can be output


dozens of keywords: id, type, x, xs, xu, mux, omegax, ...
any output of a compute or fix: f ID, c ID[M]
atom-style variable: v foo
Additional options:
control which atoms by group or region
control which atoms by threshold
dump modify thresh c pe > 3.0
text or binary or gzipped
one big file or per snapshot or per proc
see dump modify fileper or nfile
MPIIO package for parallel dump output
Dump output

Any per-atom quantity can be output


dozens of keywords: id, type, x, xs, xu, mux, omegax, ...
any output of a compute or fix: f ID, c ID[M]
atom-style variable: v foo
Additional options:
control which atoms by group or region
control which atoms by threshold
dump modify thresh c pe > 3.0
text or binary or gzipped
one big file or per snapshot or per proc
see dump modify fileper or nfile
MPIIO package for parallel dump output
Post-run conversion
tools/python/[Link], [Link], [Link]
[Link] dump, cfg, ensight, pdb, svg, vtk, xyz
Parallelization in LAMMPS

Physical domain divided into 3d bricks


One brick per processor
Atoms carry properties &
topology as they migrate
Comm of ghost atoms within cutoff
6-way local stencil
Short-range forces ⇒
CPU cost scales as O(N/P)
Parallel performance

See [Link]
Strong or weak scaling, O(N/P) until too few atoms/proc
Parallel performance

See [Link]
Strong or weak scaling, O(N/P) until too few atoms/proc

Exercise: run bench/[Link], change N and P, is it O(N/P) ?


lmp linux -v x 2 -v y 2 -v z 2 < [Link]
mpirun -np 2 lmp linux < [Link]
How to speed-up your simulations

See doc/Section [Link] of manual


1 Many ideas for long-range Coulombics
PPPM with 2 vs 4 FFTs (smoothed PPPM)
PPPM with staggered grid
run style verlet/split
processor layout
How to speed-up your simulations

See doc/Section [Link] of manual


1 Many ideas for long-range Coulombics
PPPM with 2 vs 4 FFTs (smoothed PPPM)
PPPM with staggered grid
run style verlet/split
processor layout
2 GPU, USER-INTEL, USER-OMP, KOKKOS packages
GPU for NVIDIA GPUs with multiple cores/GPU
USER-INTEL for Intel CPU optimization and Xeon Phi
USER-OMP for OpenMP on multicore nodes
KOKKOS for GPUs, OpenMP, and Xeon Phi
see Kokkos talk by Stan Moore on Thurs AM
Benchmark data at [Link]
How to speed-up your simulations

3 Increase time scale via timestep size


fix shake for rigid bonds (2 fs)
run style respa for hierarchical timesteps (4 fs)

4 Increase length scale via coarse graining


all-atom vs united-atom vs bead-spring
mesoscale models:
ASPHERE, BODY, COLLOID, FLD packages
GRANULAR, PERI, RIGID, SRD packages
see doc/Section [Link] for details
Quick tour of more advanced topics

Units
see doc/[Link]
LJ, real, metal, cgs, si
all input/output in one unit system
Ensembles
see doc/Section [Link] 6.16
one or more thermostats (by group)
single barostat
rigid body dynamics
Hybrid models
pair style hybrid and hybrid/overlay
atom style hybrid sphere bond ...
Quick tour of more advanced topics

Aspherical particles
see doc/Section [Link] 6.14
ellipsoidal, lines, triangles, rigid bodies
ASPHERE package
Mesoscale and continuum models
COLLOID, FLD, SRD packages for NPs and colloids
PERI package for Peridynamics
USER-ATC package for atom-to-continuum (FE)
USER-SPH, USER-SMD packages for smoothed particle hydro
GRANULAR package for granular media
add-on LIGGGHTS package for DEM
[Link]/[Link]
see talk by Christoph Kloss on Fri AM
breakout session B1 on Thurs
Quick tour of more advanced topics

Multi-replica modeling
see doc/Section [Link] 6.14
parallel tempering
PRD, TAD, NEB
Load balancing
balance command for static LB
fix balance command for dynamic LB
adjusting proc dividers, or recursive coordinate bisection
Quick tour of more advanced topics

Energy minimization
Via usual dynamics
pair style soft
fix nve/limit and fix viscous
Via gradient-based minimization
min style cg, htfn, sd
Via damped-dynamics minimization
min style quickmin and fire
used for nudged-elastic band (NEB)
Quick tour of more advanced topics

Use LAMMPS as a library

doc/Section [Link]
6.10 and 6.19
C-style interface
(C, C++, Fortran,
Python)
examples/COUPLE dir
python and
python/examples
directories
What have people done with LAMMPS?

Pictures: [Link]
Movies: [Link]
What have people done with LAMMPS?

Pictures: [Link]
Movies: [Link]

Papers: [Link]
authors, titles, abstracts for 1000s of papers
Customizing and modifying LAMMPS

95% of LAMMPS is customized add-on classes, via styles


Write a new derived class, drop into src, re-compile
Customizing and modifying LAMMPS

95% of LAMMPS is customized add-on classes, via styles


Write a new derived class, drop into src, re-compile
Resources:
doc/Section [Link]
doc/PDF/[Link]
class hierarchy & timestep structure
Links on LAMMPS web site:
slides for hackers/developers breakout of past workshops
ditto for slides on Tutorials link of web page
Come to developers breakout session A3 on Thurs
Please contribute your new code to the LAMMPS distro!
doc/Section modify 15:
Submitting new features for inclusion in LAMMPS
Exercises with the examples

examples/README has one-line descriptions of 40 examples

Quick runs (2d) and visually appealing:


crack: crack propagation
flow: Couette and Poiseuille flow in a channel
friction: frictional contact of spherical asperities
indent: spherical indenter into solid
micelle: self-assembly of small lipid-like molecules
obstacle: flow around two voids in a channel
shear: sideways shear of solid, with and without a void
Running and visualizing the examples

Run in serial
lmp linux < [Link]
Run in parallel
mpirun -np 4 lmp linux < [Link]
Uncomment dump image and dump modify lines
produce series of JPG (or PPM) files
Uncomment dump atom line
produce snapshot file, can viz with VMD
Crack problem

Tensile pull on 2d LJ solid


Slit crack between red/green
neigh modify exclude 2 3
Uniform gradient pull
velocity ramp command
else shock waves or worse
Need large system & slow pull
else defects besides crack
Options to play with:
pull rate
pair-wise cutoff
turn off velocity ramp
change NULL ⇒ 0.0 in fix 2
Flow problems

Couette flow and Poiseuille flow


Options to play with: wall velocity, force kick, temperature
Monitor velocity profile via fix ave/chunk or spatial
Friction problem

2 non-planar surfaces
Region commands
to build geometry
Options to play with:
asperity size, shape
asperity separation
x-velocity
multiple passes
Indent problem

2d LJ solid
periodic in x
free upper y surface
Spherical indenter
downward push, remove
Defect creation & healing
Options to play with:
speed & depth of indent
size of indenter
size of system
Micelle problem

Simple lipid model


hydrophilic head
hydrophobic tail
monomer solvent
2d self-assembly
vesicles, bilayers
Options to play with:
timestep size
# of timesteps
pair-wise coeffs
Obstacle problem

LJ flow around obstacle(s)


Poiseuille kick added to atoms
pressure-gradient flow
Top surface applies pressure
Obstacle creation
delete atoms command
fix indent command
Options to play with:
size of force kick
size of system
size & position of obstacles
shape of obstacles
add a new obstacle
Shear problems

Fixed-end shear in fcc Ni


EAM potential
Quasi-3d
non-periodic XY slab
thin in Z, periodic
Defect formation without and
with void
Options to play with:
size of system
shear rate
turn off velocity ramp
change void shape, size
add another void

You might also like