# LAMMPS Users Manual

### Manual

User Manual:

Open the PDF directly: View PDF .
Page Count: 2195

LAMMPS Users Manual
16 Mar 2018 version

http://lammps.sandia.gov - Sandia National Laboratories
pyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public

LAMMPS Users Manual

LAMMPS Documentation......................................................................................1
16 Mar 2018 version........................................................................................1
Version info:................................................................................................1
1. Introduction.................................................................................................5
1.1 What is LAMMPS..................................................................................5
1.2 LAMMPS features.................................................................................6
1.3 LAMMPS non-features..........................................................................9
1.4 Open source distribution....................................................................11
1.5 Acknowledgments and citations.........................................................12
2. Getting Started..........................................................................................14
2.1 What's in the LAMMPS distribution...................................................14
2.2 Making LAMMPS................................................................................15
2.3 Making LAMMPS with optional packages..........................................25
2.4 Building LAMMPS as a library............................................................29
2.5 Running LAMMPS...............................................................................31
2.6 Command-line options........................................................................33
2.7 LAMMPS screen output......................................................................40
2.8 Tips for users of previous LAMMPS versions.....................................43
3. Commands.................................................................................................45
3.1 LAMMPS input script..........................................................................45
3.2 Parsing rules.......................................................................................46
3.3 Input script structure..........................................................................48
3.4 Commands listed by category.............................................................49
3.5 Individual commands..........................................................................50
Fix styles...................................................................................................51
Compute styles..........................................................................................52
Pair_style potentials..................................................................................52
Bond_style potentials................................................................................54
Angle_style potentials...............................................................................54
Dihedral_style potentials..........................................................................55
Improper_style potentials.........................................................................55
Kspace solvers..........................................................................................55
4. Packages....................................................................................................57
ASPHERE package....................................................................................60
BODY package..........................................................................................61
CLASS2 package.......................................................................................61
COLLOID package....................................................................................62
COMPRESS package.................................................................................63
CORESHELL package...............................................................................63
DIPOLE package.......................................................................................64
GPU package.............................................................................................64
GRANULAR package.................................................................................66
KIM package.............................................................................................66
KOKKOS package.....................................................................................68
KSPACE package......................................................................................69
LATTE package.........................................................................................70
MANYBODY package................................................................................71
MC package..............................................................................................72
i

LAMMPS Users Manual

MEAM package.........................................................................................72
MISC package...........................................................................................73
MOLECULE package................................................................................74
MPIIO package.........................................................................................74
MSCG package..........................................................................................75
OPT package.............................................................................................76
PERI package............................................................................................77
POEMS package.......................................................................................77
PYTHON package.....................................................................................78
QEQ package............................................................................................79
REAX package...........................................................................................79
REPLICA package.....................................................................................80
RIGID package..........................................................................................81
SHOCK package........................................................................................82
SNAP package...........................................................................................82
SRD package.............................................................................................83
VORONOI package...................................................................................83
USER-ATC package...................................................................................84
USER-AWPMD package............................................................................85
USER-CGDNA package.............................................................................86
USER-CGSDK package.............................................................................87
USER-COLVARS package.........................................................................87
USER-DIFFRACTION package.................................................................88
USER-DPD package..................................................................................89
USER-DRUDE package.............................................................................90
USER-EFF package...................................................................................90
USER-FEP package...................................................................................91
USER-H5MD package...............................................................................92
USER-INTEL package...............................................................................93
USER-LB package.....................................................................................94
USER-MGPT package...............................................................................94
USER-MISC package................................................................................95
USER-MANIFOLD package......................................................................96
USER-MEAMC package............................................................................96
USER-MESO package...............................................................................97
USER-MOFFF package.............................................................................97
USER-MOLFILE package..........................................................................98
USER-NETCDF package...........................................................................99
USER-OMP package...............................................................................100
USER-PHONON package........................................................................101
USER-QMMM package...........................................................................101
USER-QTB package................................................................................102
USER-QUIP package...............................................................................103
USER-REAXC package............................................................................104
USER-SMD package...............................................................................104
USER-SMTBQ package...........................................................................105
USER-SPH package................................................................................106
USER-TALLY package.............................................................................106
ii

LAMMPS Users Manual

5.

6.

7.
8.
9.

USER-UEF package................................................................................107
USER-VTK package.................................................................................107
Accelerating LAMMPS performance........................................................109
5.1 Measuring performance....................................................................109
5.2 General strategies.............................................................................110
5.3 Packages with optimized styles........................................................111
5.4 Comparison of various accelerator packages...................................114
How-to discussions...................................................................................145
6.1 Restarting a simulation.....................................................................145
6.2 2d simulations...................................................................................147
6.3 CHARMM, AMBER, and DREIDING force fields..............................147
6.4 Running multiple simulations from one input script........................149
6.5 Multi-replica simulations..................................................................150
6.6 Granular models...............................................................................151
6.7 TIP3P water model............................................................................152
6.8 TIP4P water model............................................................................153
6.9 SPC water model...............................................................................155
6.10 Coupling LAMMPS to other codes..................................................156
6.11 Visualizing LAMMPS snapshots......................................................157
6.12 Triclinic (non-orthogonal) simulation boxes...................................157
6.13 NEMD simulations..........................................................................163
6.14 Finite-size spherical and aspherical particles.................................163
6.15 Output from LAMMPS (thermo, dumps, computes, fixes,
variables).....................................................................................167
6.16 Thermostatting, barostatting, and computing temperature...........172
6.17 Walls...............................................................................................175
6.18 Elastic constants.............................................................................176
6.19 Library interface to LAMMPS.........................................................177
6.20 Calculating thermal conductivity....................................................180
6.21 Calculating viscosity.......................................................................181
6.22 Calculating a diffusion coefficient..................................................183
6.23 Using chunks to calculate system properties.................................183
6.24 Setting parameters for the kspace_style pppm/disp command......186
6.25 Polarizable models..........................................................................188
6.27 Drude induced dipoles....................................................................192
Example problems....................................................................................195
Lowercase directories.............................................................................195
Uppercase directories.............................................................................197
Performance & scalability........................................................................198
amber2lmp tool.......................................................................................200
binary2txt tool.........................................................................................200
ch2lmp tool.............................................................................................201
chain tool................................................................................................201
colvars tools............................................................................................201
createatoms tool.....................................................................................202
doxygen tool............................................................................................202
iii

LAMMPS Users Manual

drude tool................................................................................................202
eam database tool...................................................................................202
eam generate tool...................................................................................203
eff tool.....................................................................................................203
emacs tool...............................................................................................203
fep tool....................................................................................................203
i-pi tool....................................................................................................203
ipp tool....................................................................................................204
kate tool..................................................................................................204
lmp2arc tool............................................................................................204
lmp2cfg tool............................................................................................204
matlab tool..............................................................................................204
micelle2d tool..........................................................................................205
moltemplate tool.....................................................................................205
msi2lmp tool...........................................................................................205
phonon tool.............................................................................................205
polybond tool..........................................................................................206
pymol_asphere tool.................................................................................206
python tool..............................................................................................206
reax tool..................................................................................................206
smd tool..................................................................................................207
vim tool...................................................................................................207
xmgrace tool...........................................................................................207
10. Modifying & extending LAMMPS..........................................................208
10.1 Atom styles......................................................................................210
10.2 Bond, angle, dihedral, improper potentials....................................211
10.3 Compute styles................................................................................212
10.4 Dump styles....................................................................................213
10.5 Dump custom output options..........................................................213
10.6 Fix styles.........................................................................................213
10.7 Input script commands...................................................................216
10.8 Kspace computations......................................................................216
10.9 Minimization styles.........................................................................216
10.10 Pairwise potentials........................................................................217
10.11 Region styles.................................................................................217
10.12 Body styles....................................................................................218
10.13 Thermodynamic output options....................................................218
10.14 Variable options............................................................................219
10.15 Submitting new features for inclusion in LAMMPS......................219
11. Python interface to LAMMPS.................................................................224
11.1 Overview of running LAMMPS from Python...................................225
11.2 Overview of using Python from a LAMMPS script..........................226
11.3 Building LAMMPS as a shared library............................................227
11.4 Installing the Python wrapper into Python.....................................227
11.5 Extending Python with MPI to run in parallel................................228
11.6 Testing the Python-LAMMPS interface...........................................231
11.7 Using LAMMPS from Python..........................................................233
11.8 Example Python scripts that use LAMMPS....................................237
iv

LAMMPS Users Manual

11.9 PyLammps interface.......................................................................238
12. Errors.....................................................................................................239
12.1 Common problems..........................................................................239
12.2 Reporting bugs................................................................................241
12.3 Error & warning messages.............................................................241
Errors:.....................................................................................................241
Warnings:................................................................................................353
13. Future and history.................................................................................365
13.1 Coming attractions.........................................................................365
13.2 Past versions...................................................................................365
Tutorials............................................................................................................368
Using LAMMPS with Bash on Windows.......................................................369
Installing Bash on Windows....................................................................369
Compiling LAMMPS in Bash on Windows..............................................376
Tutorial for Thermalized Drude oscillators in LAMMPS..............................379
LAMMPS GitHub tutorial.............................................................................387
PyLammps Tutorial......................................................................................403
Overview.................................................................................................403
Quick Start..............................................................................................403
Creating a new instance of PyLammps...................................................404
Commands..............................................................................................405
System state............................................................................................405
Working with LAMMPS variables...........................................................406
Retrieving the value of an arbitrary LAMMPS expressions....................406
Accessing atom data...............................................................................407
Evaluating thermo data..........................................................................407
Error handling with PyLammps..............................................................407
Using PyLammps in IPython notebooks and Jupyter..............................408
IPyLammps Examples.............................................................................408
Using PyLammps and mpi4py (Experimental)........................................413
Feedback and Contributing....................................................................413
Body particles..................................................................................................415
Manifolds (surfaces).......................................................................................421
LAMMPS Commands.......................................................................................423
angle_coeff command........................................................................................424
angle_style command...................................................................................426
atom_modify command................................................................................428
atom_style command....................................................................................431
balance command........................................................................................437
bond_coeff command...................................................................................446
bond_style command....................................................................................448
bond_write command...................................................................................450
boundary command......................................................................................451
box command...............................................................................................453
change_box command..................................................................................454
v

LAMMPS Users Manual

LAMMPS Commands
clear command.............................................................................................460
comm_modify command...............................................................................461
comm_style command..................................................................................464
compute command.......................................................................................465
compute_modify command...........................................................................470
create_atoms command...............................................................................472
create_bonds command................................................................................478
create_box command...................................................................................482
delete_atoms command................................................................................485
delete_bonds command................................................................................488
dielectric command......................................................................................491
dihedral_coeff command..............................................................................492
dihedral_style command..............................................................................494
dimension command....................................................................................497
displace_atoms command............................................................................498
dump command............................................................................................501
dump vtk command......................................................................................501
dump h5md command..................................................................................501
dump molfile command................................................................................501
dump netcdf command.................................................................................501
dump image command.................................................................................501
dump movie command.................................................................................501
dump h5md command..................................................................................512
dump image command.................................................................................514
dump movie command.................................................................................514
dump_modify command...............................................................................526
dump molfile command................................................................................541
dump netcdf command.................................................................................543
dump netcdf/mpiio command.......................................................................543
dump vtk command......................................................................................545
dump cfg/uef command................................................................................548
echo command.............................................................................................549
fix command.................................................................................................550
fix_modify command....................................................................................556
group command...........................................................................................558
group2ndx command...................................................................................563
ndx2group command...................................................................................563
if command...................................................................................................565
improper_coeff command.............................................................................569
improper_style command.............................................................................571
include command.........................................................................................573
info command...............................................................................................574
jump command.............................................................................................577
kspace_modify command.............................................................................580
kspace_style command.................................................................................586
label command.............................................................................................593
lattice command...........................................................................................594
vi

LAMMPS Users Manual

LAMMPS Commands
log command................................................................................................599
mass command.............................................................................................600
min_modify command..................................................................................602
min_style command......................................................................................604
minimize command......................................................................................606
molecule command......................................................................................611
neb command...............................................................................................619
neigh_modify command...............................................................................626
neighbor command......................................................................................630
newton command.........................................................................................632
next command..............................................................................................633
package command.......................................................................................636
pair_coeff command.....................................................................................646
pair_modify command..................................................................................649
pair_style command.....................................................................................654
pair_write command....................................................................................659
partition command.......................................................................................661
prd command...............................................................................................663
print command.............................................................................................669
processors command...................................................................................671
python command..........................................................................................677
quit command..............................................................................................685
region command..........................................................................................717
replicate command.......................................................................................724
rerun command............................................................................................726
reset_timestep command.............................................................................730
restart command..........................................................................................731
run command...............................................................................................734
run_style command......................................................................................738
set command................................................................................................743
shell command.............................................................................................751
special_bonds command..............................................................................753
suffix command............................................................................................757
temper command.........................................................................................764
temper/grem command................................................................................767
temper/npt command...................................................................................769
thermo command.........................................................................................771
thermo_modify command.............................................................................772
thermo_style command................................................................................775
timer command............................................................................................782
timestep command.......................................................................................785
uncompute command...................................................................................786
undump command........................................................................................787
vii

LAMMPS Users Manual

LAMMPS Commands
unfix command.............................................................................................788
units command.............................................................................................789
variable command........................................................................................794
Numbers, constants, and thermo keywords...........................................802
Math Operators.......................................................................................802
Math Functions.......................................................................................803
Group and Region Functions..................................................................805
Special Functions....................................................................................806
Feature Functions...................................................................................807
Atom Values and Vectors........................................................................808
Compute References...............................................................................809
Fix References........................................................................................810
Variable References................................................................................811
velocity command........................................................................................816
write_coeff command...................................................................................821
write_data command....................................................................................822
write_dump command..................................................................................824
write_restart command................................................................................826
fix append/atoms command.........................................................................843
fix atom/swap command...............................................................................845
fix ave/atom command.................................................................................848
fix ave/chunk command...............................................................................851
fix ave/correlate command...........................................................................859
fix ave/correlate/long command...................................................................865
fix ave/histo command.................................................................................868
fix ave/histo/weight command......................................................................868
fix ave/time command..................................................................................874
fix aveforce command..................................................................................880
fix balance command...................................................................................882
fix bond/break command..............................................................................889
fix bond/create command.............................................................................892
fix bond/swap command...............................................................................896
fix box/relax command.................................................................................900
fix cmap command.......................................................................................906
fix colvars command....................................................................................909
fix controller command................................................................................912
fix deform command....................................................................................916
fix deform/kk command................................................................................916
fix deposit command....................................................................................926
fix dpd/energy command..............................................................................931
fix dpd/energy/kk command.........................................................................931
fix edpd/source command............................................................................933
fix tdpd/source command.............................................................................933
viii

LAMMPS Users Manual

LAMMPS Commands
fix drag command........................................................................................935
fix drude command......................................................................................936
fix drude/transform/direct command...........................................................937
fix drude/transform/inverse command.........................................................937
fix dt/reset command...................................................................................940
fix efield command.......................................................................................942
fix ehex command........................................................................................945
fix enforce2d command................................................................................948
fix eos/cv command......................................................................................950
fix eos/table command.................................................................................951
fix eos/table/rx command.............................................................................953
fix eos/table/rx/kk command........................................................................953
fix evaporate command................................................................................957
fix external command...................................................................................959
fix filter/corotate command..........................................................................962
fix flow/gauss command...............................................................................964
fix freeze command......................................................................................967
fix gcmc command.......................................................................................969
fix gld command...........................................................................................977
fix gle command...........................................................................................980
fix gravity command.....................................................................................983
fix gravity/omp command.............................................................................983
fix grem command.......................................................................................986
fix halt command..........................................................................................988
fix heat command.........................................................................................991
fix imd command..........................................................................................994
fix indent command......................................................................................997
fix ipi command..........................................................................................1001
fix langevin command................................................................................1003
fix langevin/kk command...........................................................................1003
fix langevin/drude command......................................................................1009
fix langevin/eff command...........................................................................1013
fix latte command.......................................................................................1015
fix lb/fluid command...................................................................................1019
fix lb/momentum command........................................................................1026
fix lb/pc command......................................................................................1028
fix lb/rigid/pc/sphere command.................................................................1029
fix lb/viscous command..............................................................................1032
fix lineforce command................................................................................1034
fix manifoldforce command........................................................................1035
fix meso command.....................................................................................1036
fix meso/stationary command....................................................................1037
fix momentum command............................................................................1038
fix momentum/kk command.......................................................................1038
fix move command.....................................................................................1040
fix mscg command.....................................................................................1044
fix msst command.....................................................................................1047
ix

LAMMPS Users Manual

LAMMPS Commands
fix mvv/dpd command................................................................................1051
fix mvv/edpd command..............................................................................1051
fix mvv/tdpd command...............................................................................1051
fix neb command........................................................................................1053
fix nvt command.........................................................................................1057
fix nvt/intel command.................................................................................1057
fix nvt/kk command....................................................................................1057
fix nvt/omp command.................................................................................1057
fix npt command.........................................................................................1057
fix npt/intel command................................................................................1057
fix npt/kk command....................................................................................1057
fix npt/omp command.................................................................................1057
fix nph command........................................................................................1057
fix nph/kk command...................................................................................1057
fix nph/omp command................................................................................1057
fix nvt/eff command...................................................................................1068
fix npt/eff command...................................................................................1068
fix nph/eff command...................................................................................1068
fix nph/asphere command..........................................................................1071
fix nph/asphere/omp command..................................................................1071
fix nph/body command...............................................................................1074
fix nph/sphere command............................................................................1077
fix nph/sphere/omp command....................................................................1077
fix nphug command....................................................................................1080
fix nphug/omp command............................................................................1080
fix npt/asphere command...........................................................................1084
fix npt/asphere/omp command...................................................................1084
fix npt/body command................................................................................1087
fix npt/sphere command.............................................................................1090
fix npt/sphere/omp command.....................................................................1090
fix nve command........................................................................................1093
fix nve/intel command................................................................................1093
fix nve/kk command...................................................................................1093
fix nve/omp command................................................................................1093
fix nve/asphere command..........................................................................1095
fix nve/asphere/intel command..................................................................1095
fix nve/asphere/noforce command.............................................................1097
fix nve/body command...............................................................................1098
fix nve/dot command..................................................................................1099
fix nve/dotc/langevin command..................................................................1100
fix nve/eff command...................................................................................1103
fix nve/limit command................................................................................1104
fix nve/line command.................................................................................1106
fix nve/manifold/rattle command...............................................................1107
fix nve/noforce command...........................................................................1109
fix nve/sphere command............................................................................1110
fix nve/sphere/omp command....................................................................1110
x

LAMMPS Users Manual

LAMMPS Commands
fix nve/tri command...................................................................................1112
fix nvk command........................................................................................1113
fix nvt/asphere command...........................................................................1115
fix nvt/asphere/omp command...................................................................1115
fix nvt/body command................................................................................1118
fix nvt/manifold/rattle command................................................................1121
fix nvt/sllod command................................................................................1123
fix nvt/sllod/intel command........................................................................1123
fix nvt/sllod/omp command........................................................................1123
fix nvt/sllod/eff command...........................................................................1126
fix nvt/sphere command.............................................................................1128
fix nvt/sphere/omp command.....................................................................1128
fix nvt/uef command...................................................................................1131
fix npt/uef command..................................................................................1131
fix oneway command..................................................................................1135
fix orient/fcc command...............................................................................1136
fix orient/bcc command..............................................................................1136
fix phonon command..................................................................................1140
fix pimd command......................................................................................1144
fix planeforce command.............................................................................1148
fix poems....................................................................................................1149
fix pour command......................................................................................1152
fix press/berendsen command...................................................................1157
fix print command......................................................................................1161
fix property/atom command.......................................................................1163
fix python/invoke command.......................................................................1168
fix python/move command.........................................................................1170
fix qbmsst command..................................................................................1172
fix qeq/point command...............................................................................1177
fix qeq/shielded command.........................................................................1177
fix qeq/slater command..............................................................................1177
fix qeq/dynamic command.........................................................................1177
fix qeq/fire command.................................................................................1177
fix qeq/comb command..............................................................................1181
fix qeq/comb/omp command......................................................................1181
fix qeq/reax command................................................................................1184
fix qeq/reax/kk command...........................................................................1184
fix qeq/reax/omp command........................................................................1184
fix qmmm command...................................................................................1187
fix qtb command.........................................................................................1189
fix reax/bonds command............................................................................1192
fix reax/c/bonds command.........................................................................1192
fix reax/c/bonds/kk command....................................................................1192
fix reax/c/species command.......................................................................1194
fix reax/c/species/kk command..................................................................1194
fix recenter command................................................................................1197
fix restrain command.................................................................................1199
xi

LAMMPS Users Manual

LAMMPS Commands
fix rigid command......................................................................................1203
fix rigid/omp command..............................................................................1203
fix rigid/nve command................................................................................1203
fix rigid/nve/omp command........................................................................1203
fix rigid/nvt command................................................................................1203
fix rigid/nvt/omp command........................................................................1203
fix rigid/npt command................................................................................1203
fix rigid/npt/omp command........................................................................1203
fix rigid/nph command...............................................................................1203
fix rigid/nph/omp command.......................................................................1203
fix rigid/small command.............................................................................1203
fix rigid/small/omp command.....................................................................1203
fix rigid/nve/small command......................................................................1203
fix rigid/nvt/small command.......................................................................1203
fix rigid/npt/small command......................................................................1203
fix rigid/nph/small command......................................................................1203
fix rhok command......................................................................................1217
fix rx command...........................................................................................1219
fix rx/kk command......................................................................................1219
fix saed/vtk command................................................................................1224
fix setforce command.................................................................................1227
fix setforce/kk command............................................................................1227
fix shake command.....................................................................................1230
fix rattle command.....................................................................................1230
fix shardlow command...............................................................................1234
fix shardlow/kk command..........................................................................1234
fix smd command.......................................................................................1236
fix smd/integrate_tlsph command..............................................................1240
fix smd/integrate_ulsph command.............................................................1241
fix smd/move_tri_surf command................................................................1242
fix smd/setvel command.............................................................................1244
fix smd/wall_surface command..................................................................1246
fix spring command....................................................................................1248
fix spring/chunk command.........................................................................1251
fix spring/rg command...............................................................................1253
fix spring/self command.............................................................................1255
fix srd command.........................................................................................1257
fix store/force command............................................................................1264
fix store/state command.............................................................................1266
fix wall/surface/globale command..............................................................1268
fix temp/berendsen command....................................................................1269
fix temp/csvr command..............................................................................1272
fix temp/csld command..............................................................................1272
fix temp/rescale command.........................................................................1275
fix temp/rescale/eff command....................................................................1278
fix tfmc command.......................................................................................1280
xii

LAMMPS Users Manual

LAMMPS Commands
fix thermal/conductivity command.............................................................1283
fix ti/spring command................................................................................1286
fix tmd command........................................................................................1289
fix ttm command........................................................................................1292
fix ttm/mod command................................................................................1292
fix tune/kspace command...........................................................................1298
fix vector command....................................................................................1300
fix viscosity command................................................................................1303
fix viscous command..................................................................................1306
fix wall/lj93 command................................................................................1308
fix wall/lj93/kk command...........................................................................1308
fix wall/lj126 command..............................................................................1308
fix wall/lj1043 command............................................................................1308
fix wall/colloid command............................................................................1308
fix wall/harmonic command.......................................................................1308
fix wall/ees command.................................................................................1314
fix wall/region/ees command.....................................................................1314
fix wall/gran command...............................................................................1317
fix wall/gran/region command...................................................................1320
fix wall/piston command............................................................................1324
fix wall/reflect command............................................................................1326
fix wall/reflect/kk command.......................................................................1326
fix wall/region command............................................................................1329
fix wall/srd command.................................................................................1333
compute ackland/atom command..............................................................1336
compute angle command...........................................................................1338
compute angle/local command...................................................................1339
compute angmom/chunk command...........................................................1341
compute basal/atom command...................................................................1343
compute body/local command....................................................................1345
compute bond command............................................................................1347
compute bond/local command...................................................................1348
compute centro/atom command.................................................................1351
compute chunk/atom command.................................................................1354
compute cluster/atom command................................................................1365
compute fragment/atom command............................................................1365
compute aggregate/atom command...........................................................1365
compute cna/atom command.....................................................................1367
compute cnp/atom command.....................................................................1370
compute com command.............................................................................1373
compute com/chunk command...................................................................1374
compute contact/atom command...............................................................1376
compute coord/atom command..................................................................1377
compute damage/atom command..............................................................1380
compute dihedral command.......................................................................1381
compute dihedral/local command..............................................................1382
compute dilatation/atom command............................................................1384
xiii

LAMMPS Users Manual

LAMMPS Commands
compute dipole/chunk command...............................................................1386
compute displace/atom command..............................................................1388
compute dpd command..............................................................................1390
compute dpd/atom command.....................................................................1392
compute edpd/temp/atom command..........................................................1394
compute erotate/asphere command...........................................................1395
compute erotate/rigid command................................................................1397
compute erotate/sphere command............................................................1398
compute erotate/sphere/atom command...................................................1399
compute event/displace command.............................................................1400
compute fep command...............................................................................1402
compute global/atom command.................................................................1407
compute group/group command................................................................1411
compute gyration command.......................................................................1414
compute gyration/chunk command............................................................1416
compute heat/flux command......................................................................1418
compute hexorder/atom command............................................................1422
compute improper command.....................................................................1424
compute improper/local command.............................................................1425
compute inertia/chunk command...............................................................1427
compute ke command................................................................................1429
compute ke/atom command.......................................................................1430
compute ke/atom/eff command..................................................................1431
compute ke/eff command...........................................................................1433
compute ke/rigid command........................................................................1435
compute meso/e/atom command................................................................1436
compute meso/rho/atom command............................................................1437
compute meso/t/atom command................................................................1438
compute msd command.............................................................................1439
compute msd/chunk command...................................................................1441
compute msd/nongauss command.............................................................1443
compute omega/chunk command...............................................................1445
compute orientorder/atom command.........................................................1447
compute pair command..............................................................................1450
compute pair/local command.....................................................................1452
compute pe command................................................................................1455
compute pe/atom command.......................................................................1457
compute plasticity/atom command............................................................1459
compute pressure command......................................................................1461
compute pressure/uef command................................................................1464
compute property/atom command.............................................................1465
compute property/chunk command...........................................................1468
compute property/local command..............................................................1470
compute rdf command...............................................................................1473
compute reduce command.........................................................................1477
compute reduce/region command..............................................................1477
compute rigid/local command....................................................................1481
xiv

LAMMPS Users Manual

LAMMPS Commands
compute saed command.............................................................................1485
compute slice command.............................................................................1489
compute smd/damage command................................................................1492
compute smd/hourglass/error command...................................................1493
compute smd/internal/energy command....................................................1494
compute smd/plastic/strain command.......................................................1495
compute smd/plastic/strain/rate command................................................1496
compute smd/rho command.......................................................................1497
compute smd/tlsph/dt command................................................................1499
compute smd/tlsph/num/neighs command.................................................1500
compute smd/tlsph/shape command..........................................................1501
compute smd/tlsph/strain command..........................................................1502
compute smd/tlsph/strain/rate command..................................................1503
compute smd/tlsph/stress command..........................................................1504
compute smd/triangle/mesh/vertices.........................................................1505
compute smd/ulsph/num/neighs command................................................1506
compute smd/ulsph/strain command.........................................................1507
compute smd/ulsph/strain/rate command..................................................1508
compute smd/ulsph/stress command.........................................................1509
compute smd/vol command........................................................................1510
compute sna/atom command.....................................................................1511
compute snav/atom command....................................................................1511
compute stress/atom command.................................................................1517
compute force/tally command....................................................................1520
compute heat/flux/tally command..............................................................1520
compute pe/tally command........................................................................1520
compute pe/mol/tally command.................................................................1520
compute stress/tally command...................................................................1520
compute tdpd/cc/atom command...............................................................1522
compute temp command............................................................................1523
compute temp/kk command.......................................................................1523
compute temp/asphere command..............................................................1525
compute temp/body command...................................................................1528
compute temp/chunk command.................................................................1531
compute temp/com command....................................................................1535
compute temp/cs command.......................................................................1537
compute temp/deform command...............................................................1539
compute temp/deform/eff command..........................................................1542
compute temp/drude command.................................................................1544
compute temp/eff command.......................................................................1546
compute temp/partial command................................................................1548
compute temp/profile command................................................................1550
compute temp/ramp command..................................................................1553
compute temp/region command................................................................1555
xv

LAMMPS Users Manual

LAMMPS Commands
compute temp/region/eff command...........................................................1557
compute temp/rotate command.................................................................1558
compute temp/sphere command................................................................1560
compute temp/uef command......................................................................1563
compute ti command..................................................................................1564
compute torque/chunk command...............................................................1567
compute vacf command.............................................................................1569
compute vcm/chunk command...................................................................1571
compute voronoi/atom command...............................................................1573
compute xrd command...............................................................................1577
pair_style agni command...........................................................................1586
pair_style agni/omp command...................................................................1586
pair_style airebo command........................................................................1589
pair_style airebo/intel command................................................................1589
pair_style airebo/omp command................................................................1589
pair_style airebo/morse command.............................................................1589
pair_style airebo/morse/intel command.....................................................1589
pair_style airebo/morse/omp command.....................................................1589
pair_style rebo command...........................................................................1589
pair_style rebo/intel command...................................................................1589
pair_style rebo/omp command...................................................................1589
pair_style awpmd/cut command.................................................................1594
pair_style beck command...........................................................................1596
pair_style beck/gpu command....................................................................1596
pair_style beck/omp command...................................................................1596
pair_style body command...........................................................................1598
pair_style body/rounded/polygon command..............................................1600
pair_style bop command............................................................................1601
pair_style born command...........................................................................1609
pair_style born/omp command...................................................................1609
pair_style born/gpu command....................................................................1609
pair_style born/coul/long command...........................................................1609
pair_style born/coul/long/cs command.......................................................1609
pair_style born/coul/long/gpu command....................................................1609
pair_style born/coul/long/omp command...................................................1609
pair_style born/coul/msm command..........................................................1609
pair_style born/coul/msm/omp command...................................................1609
pair_style born/coul/wolf command...........................................................1609
pair_style born/coul/wolf/cs command.......................................................1609
pair_style born/coul/wolf/gpu command....................................................1609
pair_style born/coul/wolf/omp command...................................................1609
pair_style born/coul/dsf command.............................................................1609
pair_style born/coul/dsf/cs command.........................................................1609
pair_style brownian command...................................................................1613
pair_style brownian/omp command...........................................................1613
xvi

LAMMPS Users Manual

LAMMPS Commands
pair_style brownian/poly command...........................................................1613
pair_style brownian/poly/omp command....................................................1613
pair_style buck command...........................................................................1616
pair_style buck/gpu command...................................................................1616
pair_style buck/intel command..................................................................1616
pair_style buck/kk command......................................................................1616
pair_style buck/omp command...................................................................1616
pair_style buck/coul/cut command.............................................................1616
pair_style buck/coul/cut/gpu command......................................................1616
pair_style buck/coul/cut/intel command....................................................1616
pair_style buck/coul/cut/kk command........................................................1616
pair_style buck/coul/cut/omp command.....................................................1616
pair_style buck/coul/long command...........................................................1616
pair_style buck/coul/long/cs command......................................................1616
pair_style buck/coul/long/gpu command....................................................1616
pair_style buck/coul/long/intel command...................................................1616
pair_style buck/coul/long/kk command......................................................1616
pair_style buck/coul/long/omp command...................................................1616
pair_style buck/coul/msm command..........................................................1616
pair_style buck/coul/msm/omp command..................................................1616
pair_style buck/long/coul/long command...................................................1620
pair_style buck/long/coul/long/omp command...........................................1620
pair_style buck6d/coul/gauss/dsf...............................................................1623
pair_style buck6d/coul/gauss/long.............................................................1623
pair_style lj/charmm/coul/charmm command............................................1626
pair_style lj/charmm/coul/charmm/intel command....................................1626
pair_style lj/charmm/coul/charmm/omp command....................................1626
pair_style lj/charmm/coul/charmm/implicit command...............................1626
pair_style lj/charmm/coul/charmm/implicit/omp command.......................1626
pair_style lj/charmm/coul/long command..................................................1626
pair_style lj/charmm/coul/long/gpu command...........................................1626
pair_style lj/charmm/coul/long/intel command..........................................1626
pair_style lj/charmm/coul/long/opt command............................................1626
pair_style lj/charmm/coul/long/omp command..........................................1626
pair_style lj/charmm/coul/msm command..................................................1626
pair_style lj/charmm/coul/msm/omp command..........................................1626
pair_style lj/charmmfsw/coul/charmmfsh command..................................1626
pair_style lj/charmmfsw/coul/long command.............................................1626
pair_style lj/class2 command.....................................................................1632
pair_style lj/class2/gpu command..............................................................1632
pair_style lj/class2/kk command................................................................1632
pair_style lj/class2/omp command.............................................................1632
pair_style lj/class2/coul/cut command........................................................1632
pair_style lj/class2/coul/cut/kk command...................................................1632
pair_style lj/class2/coul/cut/omp command................................................1632
pair_style lj/class2/coul/long command......................................................1632
pair_style lj/class2/coul/long/gpu command...............................................1632
xvii

LAMMPS Users Manual

LAMMPS Commands
pair_style lj/class2/coul/long/kk command.................................................1632
pair_style lj/class2/coul/long/omp command..............................................1632
pair_style colloid command........................................................................1636
pair_style colloid/gpu command.................................................................1636
pair_style colloid/omp command................................................................1636
pair_style comb command..........................................................................1641
pair_style comb/omp command..................................................................1641
pair_style comb3 command........................................................................1641
pair_style coul/cut command.....................................................................1645
pair_style coul/cut/gpu command..............................................................1645
pair_style coul/cut/kk command.................................................................1645
pair_style coul/cut/omp command..............................................................1645
pair_style coul/debye command.................................................................1645
pair_style coul/debye/gpu command..........................................................1645
pair_style coul/debye/kk command............................................................1645
pair_style coul/debye/omp command.........................................................1645
pair_style coul/dsf command......................................................................1645
pair_style coul/dsf/gpu command...............................................................1645
pair_style coul/dsf/kk command.................................................................1645
pair_style coul/dsf/omp command..............................................................1645
pair_style coul/long command....................................................................1645
pair_style coul/long/cs command...............................................................1645
pair_style coul/long/omp command............................................................1645
pair_style coul/long/gpu command............................................................1645
pair_style coul/long/kk command...............................................................1645
pair_style coul/msm command...................................................................1645
pair_style coul/msm/omp command...........................................................1645
pair_style coul/streitz command................................................................1645
pair_style coul/wolf command....................................................................1645
pair_style coul/wolf/kk command...............................................................1646
pair_style coul/wolf/omp command............................................................1646
pair_style coul/wolf/cs command...............................................................1646
pair_style tip4p/cut command....................................................................1646
pair_style tip4p/long command..................................................................1646
pair_style tip4p/cut/omp command............................................................1646
pair_style tip4p/long/omp command..........................................................1646
pair_style coul/diel command.....................................................................1652
pair_style coul/diel/omp command.............................................................1652
pair_style born/coul/long/cs command.......................................................1654
pair_style buck/coul/long/cs command......................................................1654
pair_style born/coul/dsf/cs command.........................................................1654
pair_style born/coul/wolf/cs command.......................................................1654
pair_style lj/cut/dipole/cut command.........................................................1657
pair_style lj/cut/dipole/cut/gpu command..................................................1657
pair_style lj/cut/dipole/cut/omp command.................................................1657
pair_style lj/sf/dipole/sf command..............................................................1657
pair_style lj/sf/dipole/sf/gpu command.......................................................1657
xviii

LAMMPS Users Manual

LAMMPS Commands
pair_style lj/sf/dipole/sf/omp command......................................................1657
pair_style lj/cut/dipole/long command.......................................................1657
pair_style lj/long/dipole/long command.....................................................1657
pair_style dpd command............................................................................1666
pair_style dpd/gpu command.....................................................................1666
pair_style dpd/intel command....................................................................1666
pair_style dpd/omp command....................................................................1666
pair_style dpd/tstat command....................................................................1666
pair_style dpd/tstat/gpu command.............................................................1666
pair_style dpd/tstat/omp command............................................................1666
pair_style dpd/fdt command.......................................................................1670
pair_style dpd/fdt/energy command...........................................................1670
pair_style dpd/fdt/energy/kk command......................................................1670
pair_style dsmc command..........................................................................1674
pair_style eam command............................................................................1677
pair_style eam/gpu command....................................................................1677
pair_style eam/intel command...................................................................1677
pair_style eam/kk command.......................................................................1677
pair_style eam/omp command....................................................................1677
pair_style eam/opt command.....................................................................1677
pair_style eam/alloy command...................................................................1677
pair_style eam/alloy/gpu command............................................................1677
pair_style eam/alloy/intel command...........................................................1677
pair_style eam/alloy/kk command..............................................................1677
pair_style eam/alloy/omp command...........................................................1677
pair_style eam/alloy/opt command.............................................................1677
pair_style eam/cd command.......................................................................1677
pair_style eam/cd/omp command...............................................................1677
pair_style eam/fs command........................................................................1677
pair_style eam/fs/gpu command.................................................................1677
pair_style eam/fs/intel command...............................................................1677
pair_style eam/fs/kk command...................................................................1677
pair_style eam/fs/omp command................................................................1677
pair_style eam/fs/opt command.................................................................1677
pair_style edip command...........................................................................1686
pair_style edip/multi command..................................................................1686
pair_style eff/cut command........................................................................1690
pair_style eim command............................................................................1696
pair_style eim/omp command....................................................................1696
pair_style exp6/rx command......................................................................1700
pair_style exp6/rx/kk command.................................................................1700
pair_style extep command.........................................................................1704
pair_style gauss command.........................................................................1705
pair_style gauss/gpu command..................................................................1705
pair_style gauss/omp command.................................................................1705
pair_style gauss/cut command...................................................................1705
pair_style gauss/cut/omp command...........................................................1705
xix

LAMMPS Users Manual

LAMMPS Commands
pair_style gayberne command...................................................................1709
pair_style gayberne/gpu command............................................................1709
pair_style gayberne/intel command...........................................................1709
pair_style gayberne/omp command...........................................................1709
pair_style gran/hooke command................................................................1714
pair_style gran/omp command...................................................................1714
pair_style gran/hooke/history command....................................................1714
pair_style gran/hooke/history/omp command............................................1714
pair_style gran/hertz/history command.....................................................1714
pair_style gran/hertz/history/omp command.............................................1714
pair_style lj/gromacs command..................................................................1719
pair_style lj/gromacs/gpu command..........................................................1719
pair_style lj/gromacs/omp command..........................................................1719
pair_style lj/gromacs/coul/gromacs command...........................................1719
pair_style lj/gromacs/coul/gromacs/omp command...................................1719
pair_style gw command..............................................................................1723
pair_style gw/zbl command........................................................................1723
pair_style hbond/dreiding/lj command.......................................................1725
pair_style hbond/dreiding/lj/omp command...............................................1725
pair_style hbond/dreiding/morse command...............................................1725
pair_style hbond/dreiding/morse/omp command.......................................1725
pair_style hybrid command........................................................................1730
pair_style hybrid/omp command................................................................1730
pair_style hybrid/overlay command...........................................................1730
pair_style hybrid/overlay/omp command...................................................1730
pair_style hybrid/overlay/kk command......................................................1730
pair_style kim command............................................................................1737
pair_style kolmogorov/crespi/z command..................................................1740
pair_style lcbop command..........................................................................1742
pair_style line/lj command.........................................................................1744
pair_style list command.............................................................................1747
pair_style lj/cut command..........................................................................1750
pair_style lj/cut/gpu command...................................................................1750
pair_style lj/cut/intel command..................................................................1750
pair_style lj/cut/kk command.....................................................................1750
pair_style lj/cut/opt command....................................................................1750
pair_style lj/cut/omp command..................................................................1750
pair_style lj/cut/coul/cut command............................................................1750
pair_style lj/cut/coul/cut/gpu command.....................................................1750
pair_style lj/cut/coul/cut/omp command....................................................1750
pair_style lj/cut/coul/debye command........................................................1750
pair_style lj/cut/coul/debye/gpu command.................................................1750
pair_style lj/cut/coul/debye/kk command...................................................1750
pair_style lj/cut/coul/debye/omp command................................................1750
pair_style lj/cut/coul/dsf command.............................................................1750
pair_style lj/cut/coul/dsf/gpu command.....................................................1750
pair_style lj/cut/coul/dsf/kk command........................................................1750
xx

LAMMPS Users Manual

LAMMPS Commands
pair_style lj/cut/coul/dsf/omp command.....................................................1750
pair_style lj/cut/coul/long command..........................................................1750
pair_style lj/cut/coul/long/cs command......................................................1750
pair_style lj/cut/coul/long/gpu command...................................................1750
pair_style lj/cut/coul/long/intel command..................................................1750
pair_style lj/cut/coul/long/opt command....................................................1751
pair_style lj/cut/coul/long/omp command..................................................1751
pair_style lj/cut/coul/msm command..........................................................1751
pair_style lj/cut/coul/msm/gpu command...................................................1751
pair_style lj/cut/coul/msm/omp command..................................................1751
pair_style lj/cut/coul/wolf command...........................................................1751
pair_style lj/cut/coul/wolf/omp command...................................................1751
pair_style lj/cut/tip4p/cut command...........................................................1751
pair_style lj/cut/tip4p/cut/omp command...................................................1751
pair_style lj/cut/tip4p/long command.........................................................1751
pair_style lj/cut/tip4p/long/omp command.................................................1751
pair_style lj/cut/tip4p/long/opt command...................................................1751
pair_style lj96/cut command......................................................................1758
pair_style lj96/cut/gpu command...............................................................1758
pair_style lj96/cut/omp command..............................................................1758
pair_style lj/cubic command.......................................................................1760
pair_style lj/cubic/gpu command................................................................1760
pair_style lj/cubic/omp command...............................................................1760
pair_style lj/expand command....................................................................1763
pair_style lj/expand/gpu command.............................................................1763
pair_style lj/expand/omp command............................................................1763
pair_style lj/long/coul/long command.........................................................1765
pair_style lj/long/coul/long/intel command................................................1765
pair_style lj/long/coul/long/omp command.................................................1765
pair_style lj/long/coul/long/opt command..................................................1765
pair_style lj/long/tip4p/long command.......................................................1765
pair_style lj/smooth command....................................................................1769
pair_style lj/smooth/omp command............................................................1769
pair_style lj/smooth/linear command.........................................................1772
pair_style lj/smooth/linear/omp command.................................................1772
pair_style lj/cut/soft command...................................................................1774
pair_style lj/cut/soft/omp command...........................................................1774
pair_style lj/cut/coul/cut/soft command.....................................................1774
pair_style lj/cut/coul/cut/soft/omp command.............................................1774
pair_style lj/cut/coul/long/soft command...................................................1774
pair_style lj/cut/coul/long/soft/omp command...........................................1774
pair_style lj/cut/tip4p/long/soft command..................................................1774
pair_style lj/cut/tip4p/long/soft/omp command..........................................1774
pair_style lj/charmm/coul/long/soft command...........................................1774
pair_style lj/charmm/coul/long/soft/omp command...................................1774
pair_style coul/cut/soft command..............................................................1774
pair_style coul/cut/soft/omp command.......................................................1774
xxi

LAMMPS Users Manual

LAMMPS Commands
pair_style coul/long/soft command.............................................................1774
pair_style coul/long/soft/omp command.....................................................1774
pair_style tip4p/long/soft command...........................................................1774
pair_style tip4p/long/soft/omp command...................................................1774
pair_style lubricate command....................................................................1780
pair_style lubricate/omp command............................................................1780
pair_style lubricate/poly command............................................................1780
pair_style lubricate/poly/omp command....................................................1780
pair_style lubricateU command.................................................................1785
pair_style lubricateU/poly command..........................................................1785
pair_style lj/mdf command.........................................................................1789
pair_style buck/mdf command...................................................................1789
pair_style lennard/mdf command...............................................................1789
pair_style meam command.........................................................................1793
pair_style meam/c command......................................................................1793
pair_style meam/spline...............................................................................1800
pair_style meam/spline/omp.......................................................................1800
pair_style meam/sw/spline.........................................................................1804
pair_style meam/sw/spline/omp.................................................................1804
pair_style edpd command..........................................................................1807
pair_style mdpd command.........................................................................1807
pair_style mdpd/rhosum command............................................................1807
pair_style tdpd command...........................................................................1807
pair_style mgpt command..........................................................................1815
pair_style mie/cut command......................................................................1819
pair_style mie/cut/gpu command...............................................................1819
pair_style momb command........................................................................1821
pair_style morse command........................................................................1823
pair_style morse/gpu command.................................................................1823
pair_style morse/omp command................................................................1823
pair_style morse/opt command..................................................................1823
pair_style morse/smooth/linear command.................................................1823
pair_style morse/smooth/linear/omp command.........................................1823
pair_style morse/soft command.................................................................1823
pair_style morse/kk command....................................................................1823
pair_style multi/lucy command..................................................................1827
pair_style multi/lucy/rx command..............................................................1831
pair_style multi/lucy/rx/kk command.........................................................1831
pair_style nb3b/harmonic command..........................................................1836
pair_style nb3b/harmonic/omp command..................................................1836
pair_style nm/cut command.......................................................................1839
pair_style nm/cut/coul/cut command.........................................................1839
pair_style nm/cut/coul/long command.......................................................1839
pair_style nm/cut/omp command...............................................................1839
pair_style nm/cut/coul/cut/omp command.................................................1839
pair_style nm/cut/coul/long/omp command...............................................1839
pair_style none command..........................................................................1842
xxii

LAMMPS Users Manual

LAMMPS Commands
pair_style oxdna/excv command................................................................1843
pair_style oxdna/stk command...................................................................1843
pair_style oxdna/hbond command..............................................................1843
pair_style oxdna/xstk command.................................................................1843
pair_style oxdna/coaxstk command............................................................1843
pair_style oxdna2/excv command..............................................................1845
pair_style oxdna2/stk command.................................................................1845
pair_style oxdna2/hbond command............................................................1845
pair_style oxdna2/xstk command...............................................................1845
pair_style oxdna2/coaxstk command..........................................................1845
pair_style oxdna2/dh command..................................................................1845
pair_style peri/pmb command....................................................................1848
pair_style peri/pmb/omp command............................................................1848
pair_style peri/lps command......................................................................1848
pair_style peri/lps/omp command..............................................................1848
pair_style peri/ves command......................................................................1848
pair_style peri/eps command.....................................................................1848
pair_style polymorphic command..............................................................1852
pair_style python command.......................................................................1858
pair_style quip command...........................................................................1862
pair_style reax command...........................................................................1864
pair_style reax/c command........................................................................1868
pair_style reax/c/kk command....................................................................1868
pair_style reax/c/omp command................................................................1868
pair_style resquared command..................................................................1874
pair_style resquared/gpu command...........................................................1874
pair_style resquared/omp command..........................................................1874
pair_style lj/sdk command..........................................................................1878
pair_style lj/sdk/gpu command...................................................................1878
pair_style lj/sdk/kk command.....................................................................1878
pair_style lj/sdk/omp command..................................................................1878
pair_style lj/sdk/coul/long command..........................................................1878
pair_style lj/sdk/coul/long/gpu command...................................................1878
pair_style lj/sdk/coul/long/omp command..................................................1878
pair_style smd/hertz command..................................................................1881
pair_style smd/tlsph command...................................................................1882
pair_style smd/tri_surface command.........................................................1884
pair_style smd/ulsph command..................................................................1885
pair_style smtbq command........................................................................1887
pair_style snap command...........................................................................1893
pair_style snap/kk command......................................................................1893
pair_style soft command............................................................................1897
pair_style soft/gpu command.....................................................................1897
pair_style soft/omp command....................................................................1897
pair_style sph/heatconduction command...................................................1900
pair_style sph/idealgas command..............................................................1901
pair_style sph/lj command..........................................................................1903
xxiii

LAMMPS Users Manual

LAMMPS Commands
pair_style sph/rhosum command................................................................1905
pair_style sph/taitwater command.............................................................1906
pair_style sph/taitwater/morris command.................................................1908
pair_style srp command.............................................................................1910
pair_style sw command..............................................................................1913
pair_style sw/gpu command.......................................................................1913
pair_style sw/intel command......................................................................1913
pair_style sw/kk command.........................................................................1913
pair_style sw/omp command......................................................................1913
pair_style table command..........................................................................1917
pair_style table/gpu command...................................................................1917
pair_style table/kk command.....................................................................1917
pair_style table/omp command..................................................................1917
pair_style table/rx command......................................................................1922
pair_style table/rx/kk command.................................................................1922
pair_style tersoff command........................................................................1927
pair_style tersoff/table command...............................................................1927
pair_style tersoff/gpu.................................................................................1927
pair_style tersoff/intel................................................................................1927
pair_style tersoff/kk...................................................................................1927
pair_style tersoff/omp................................................................................1927
pair_style tersoff/table/omp command.......................................................1927
pair_style tersoff/mod command................................................................1933
pair_style tersoff/mod/c command.............................................................1933
pair_style tersoff/mod/gpu command.........................................................1933
pair_style tersoff/mod/kk command...........................................................1933
pair_style tersoff/mod/omp command........................................................1933
pair_style tersoff/mod/c/omp command.....................................................1933
pair_style tersoff/zbl command..................................................................1938
pair_style tersoff/zbl/gpu command...........................................................1938
pair_style tersoff/zbl/kk command.............................................................1938
pair_style tersoff/zbl/omp command..........................................................1938
pair_style thole command..........................................................................1945
pair_style lj/cut/thole/long command.........................................................1945
pair_style lj/cut/thole/long/omp command.................................................1945
pair_style tri/lj command...........................................................................1949
pair_style ufm command............................................................................1951
pair_style ufm/gpu command.....................................................................1951
pair_style ufm/omp command....................................................................1951
pair_style ufm/opt command......................................................................1951
pair_style vashishta command...................................................................1954
pair_style vashishta/gpu command............................................................1954
pair_style vashishta/omp command...........................................................1954
pair_style vashishta/kk command..............................................................1954
pair_style vashishta/table command..........................................................1954
pair_style vashishta/table/omp command..................................................1954
pair_style yukawa command......................................................................1959
xxiv

LAMMPS Users Manual

LAMMPS Commands
pair_style yukawa/gpu command...............................................................1959
pair_style yukawa/omp command..............................................................1959
pair_style yukawa/kk command.................................................................1959
pair_style yukawa/colloid command..........................................................1961
pair_style yukawa/colloid/gpu command...................................................1961
pair_style yukawa/colloid/omp command...................................................1961
pair_style zbl command..............................................................................1964
pair_style zbl/gpu command......................................................................1964
pair_style zbl/kk command.........................................................................1964
pair_style zbl/omp command......................................................................1964
pair_style zero command...........................................................................1967
bond_style class2 command.......................................................................1969
bond_style class2/omp command...............................................................1969
bond_style class2/kk command..................................................................1969
bond_style fene command..........................................................................1971
bond_style fene/intel command..................................................................1971
bond_style fene/kk command.....................................................................1971
bond_style fene/omp command..................................................................1971
bond_style fene/expand command.............................................................1973
bond_style fene/expand/omp command.....................................................1973
bond_style gromos command.....................................................................1975
bond_style gromos/omp command.............................................................1975
bond_style harmonic command..................................................................1977
bond_style harmonic/intel command.........................................................1977
bond_style harmonic/kk command.............................................................1977
bond_style harmonic/omp command..........................................................1977
bond_style harmonic/shift command..........................................................1979
bond_style harmonic/shift/omp command..................................................1979
bond_style harmonic/shift/cut command...................................................1981
bond_style harmonic/shift/cut/omp command...........................................1981
bond_style hybrid command......................................................................1983
bond_style morse command.......................................................................1985
bond_style morse/omp command...............................................................1985
bond_style none command.........................................................................1987
bond_style nonlinear command.................................................................1988
bond_style nonlinear/omp command..........................................................1988
bond_style oxdna/fene command...............................................................1990
bond_style oxdna2/fene command.............................................................1990
bond_style quartic command.....................................................................1992
bond_style quartic/omp command.............................................................1992
bond_style table command.........................................................................1994
bond_style table/omp command.................................................................1994
bond_style zero command..........................................................................1997
angle_style charmm command...................................................................1998
angle_style charmm/intel command...........................................................1998
angle_style charmm/kk command..............................................................1998
angle_style charmm/omp command...........................................................1998
xxv

LAMMPS Users Manual

LAMMPS Commands
angle_style class2 command......................................................................2000
angle_style class2/omp command..............................................................2000
angle_style class2/kk command.................................................................2000
angle_style class2/p6 command.................................................................2000
angle_style cosine command......................................................................2003
angle_style cosine/omp command..............................................................2003
angle_style cosine/buck6d command.........................................................2005
angle_style cosine/delta command.............................................................2007
angle_style cosine/delta/omp command.....................................................2007
angle_style cosine/periodic command........................................................2009
angle_style cosine/periodic/omp command................................................2009
angle_style cosine/shift command..............................................................2011
angle_style cosine/shift/omp command......................................................2011
angle_style cosine/shift/exp command.......................................................2013
angle_style cosine/shift/exp/omp command...............................................2013
angle_style cosine/squared command........................................................2015
angle_style cosine/squared/omp command................................................2015
angle_style dipole command......................................................................2017
angle_style dipole/omp command..............................................................2017
angle_style fourier command.....................................................................2020
angle_style fourier/omp command.............................................................2020
angle_style fourier/simple command.........................................................2022
angle_style fourier/simple/omp command.................................................2022
angle_style harmonic command.................................................................2024
angle_style harmonic/intel command.........................................................2024
angle_style harmonic/kk command............................................................2024
angle_style harmonic/omp command.........................................................2024
angle_style hybrid command......................................................................2026
angle_style none command........................................................................2028
angle_style quartic command....................................................................2029
angle_style quartic/omp command............................................................2029
angle_style sdk command..........................................................................2031
angle_style table command........................................................................2032
angle_style table/omp command................................................................2032
angle_style zero command.........................................................................2035
dihedral_style charmm command..............................................................2036
dihedral_style charmm/intel command......................................................2036
dihedral_style charmm/kk command.........................................................2036
dihedral_style charmm/omp command......................................................2036
dihedral_style charmmfsw command.........................................................2036
dihedral_style class2 command.................................................................2039
dihedral_style class2/omp command..........................................................2039
dihedral_style class2/kk command.............................................................2039
dihedral_style cosine/shift/exp command..................................................2043
dihedral_style cosine/shift/exp/omp command..........................................2043
dihedral_style fourier command................................................................2045
dihedral_style fourier/intel command........................................................2045
xxvi

LAMMPS Users Manual

LAMMPS Commands
dihedral_style fourier/omp command........................................................2045
dihedral_style harmonic command............................................................2047
dihedral_style harmonic/intel command....................................................2047
dihedral_style harmonic/omp command....................................................2047
dihedral_style helix command....................................................................2049
dihedral_style helix/omp command............................................................2049
dihedral_style hybrid command.................................................................2051
dihedral_style multi/harmonic command...................................................2053
dihedral_style multi/harmonic/omp command...........................................2053
dihedral_style nharmonic command..........................................................2055
dihedral_style nharmonic/omp command..................................................2055
dihedral_style none command....................................................................2057
dihedral_style opls command.....................................................................2058
dihedral_style opls/intel command.............................................................2058
dihedral_style opls/kk command................................................................2058
dihedral_style opls/omp command.............................................................2058
dihedral_style spherical command.............................................................2062
dihedral_style table command...................................................................2064
dihedral_style table/omp command...........................................................2064
dihedral_style zero command....................................................................2068
improper_style class2 command................................................................2069
improper_style class2/omp command........................................................2069
improper_style class2/kk command...........................................................2069
improper_style cossq command.................................................................2072
improper_style cossq/omp command.........................................................2072
improper_style cvff command....................................................................2074
improper_style cvff/intel command............................................................2074
improper_style cvff/omp command............................................................2074
improper_style distance command............................................................2076
improper_style fourier command...............................................................2078
improper_style fourier/omp command.......................................................2078
improper_style harmonic command...........................................................2080
improper_style harmonic/intel command...................................................2080
improper_style harmonic/kk command......................................................2080
improper_style harmonic/omp command...................................................2080
improper_style hybrid command................................................................2082
improper_style inversion/harmonic command...........................................2084
improper_style none command..................................................................2086
improper_style ring command...................................................................2087
improper_style ring/omp command...........................................................2087
improper_style umbrella command............................................................2089
improper_style umbrella/omp command....................................................2089
improper_style zero command...................................................................2091
fix atc command.........................................................................................2092
xxvii

LAMMPS Users Manual

LAMMPS Commands
syntax...................................................................................................2098
examples..............................................................................................2098
description...........................................................................................2098
restrictions...........................................................................................2098
related..................................................................................................2098
default..................................................................................................2098
syntax...................................................................................................2098
examples..............................................................................................2098
description...........................................................................................2099
restrictions...........................................................................................2099
related..................................................................................................2099
default..................................................................................................2099
fix_modify AtC atom_element_map............................................................2099
syntax...................................................................................................2099
examples..............................................................................................2099
description...........................................................................................2099
restrictions...........................................................................................2099
related..................................................................................................2099
default..................................................................................................2099
fix_modify AtC atom_weight.......................................................................2100
syntax...................................................................................................2100
examples..............................................................................................2100
description...........................................................................................2100
restrictions...........................................................................................2100
related..................................................................................................2100
default..................................................................................................2100
fix_modify AtC atomic_charge....................................................................2100
syntax...................................................................................................2100
examples..............................................................................................2101
description...........................................................................................2101
restrictions...........................................................................................2101
related..................................................................................................2101
default..................................................................................................2101
fix_modify AtC boundary............................................................................2101
syntax...................................................................................................2101
examples..............................................................................................2101
description...........................................................................................2101
restrictions...........................................................................................2101
default..................................................................................................2101
fix_modify AtC boundary_dynamics...........................................................2102
syntax...................................................................................................2102
description...........................................................................................2102
restrictions...........................................................................................2102
related..................................................................................................2102
default..................................................................................................2102
fix_modify AtC boundary_faceset...............................................................2102
xxviii

LAMMPS Users Manual

LAMMPS Commands
syntax...................................................................................................2102
examples..............................................................................................2102
description...........................................................................................2102
restrictions...........................................................................................2102
related..................................................................................................2103
default..................................................................................................2103
fix_modify AtC output boundary_integral..................................................2103
syntax...................................................................................................2103
examples..............................................................................................2103
description...........................................................................................2103
restrictions...........................................................................................2103
related..................................................................................................2103
default..................................................................................................2103
fix_modify AtC consistent_fe_initialization.................................................2103
syntax...................................................................................................2103
examples..............................................................................................2104
description...........................................................................................2104
restrictions...........................................................................................2104
related..................................................................................................2104
default..................................................................................................2104
fix_modify AtC output contour_integral.....................................................2104
syntax...................................................................................................2104
examples..............................................................................................2104
description...........................................................................................2104
restrictions...........................................................................................2104
related..................................................................................................2104
default..................................................................................................2105
fix_modify AtC control................................................................................2105
syntax...................................................................................................2105
examples..............................................................................................2105
description...........................................................................................2105
restrictions...........................................................................................2105
related..................................................................................................2105
default..................................................................................................2105
fix_modify AtC control momentum.............................................................2106
syntax...................................................................................................2106
examples..............................................................................................2106
description...........................................................................................2106
restrictions...........................................................................................2106
related..................................................................................................2106
default..................................................................................................2106
fix_modify AtC control thermal..................................................................2107
syntax...................................................................................................2107
examples..............................................................................................2107
description...........................................................................................2107
restrictions...........................................................................................2107
related..................................................................................................2107
xxix

LAMMPS Users Manual

LAMMPS Commands
default..................................................................................................2108
fix_modify AtC control thermal correction_max_iterations........................2108
syntax...................................................................................................2108
examples..............................................................................................2108
description...........................................................................................2108
restrictions...........................................................................................2108
related..................................................................................................2108
default..................................................................................................2108
fix_modify AtC decomposition....................................................................2108
syntax...................................................................................................2108
examples..............................................................................................2109
description...........................................................................................2109
restrictions...........................................................................................2109
related..................................................................................................2109
default..................................................................................................2109
fix_modify AtC extrinsic electron_integration............................................2109
syntax...................................................................................................2109
examples..............................................................................................2109
description...........................................................................................2109
restrictions...........................................................................................2109
default..................................................................................................2110
fix_modify AtC equilibrium_start...............................................................2110
syntax...................................................................................................2110
examples..............................................................................................2110
description...........................................................................................2110
restrictions...........................................................................................2110
related..................................................................................................2110
default..................................................................................................2110
fix_modify AtC extrinsic exchange.............................................................2110
syntax...................................................................................................2110
examples..............................................................................................2110
description...........................................................................................2111
restrictions...........................................................................................2111
related..................................................................................................2111
default..................................................................................................2111
fix_modify AtC fe_md_boundary.................................................................2111
syntax...................................................................................................2111
examples..............................................................................................2111
description...........................................................................................2111
restrictions...........................................................................................2111
related..................................................................................................2111
default..................................................................................................2112
fix_modify AtC fem create mesh................................................................2112
syntax...................................................................................................2112
examples..............................................................................................2112
description...........................................................................................2112
restrictions...........................................................................................2112
xxx

LAMMPS Users Manual

LAMMPS Commands
related..................................................................................................2112
default..................................................................................................2112
fix_modify AtC filter scale..........................................................................2112
syntax...................................................................................................2112
examples..............................................................................................2112
description...........................................................................................2113
restrictions...........................................................................................2113
related..................................................................................................2113
default..................................................................................................2113
fix_modify AtC filter type...........................................................................2113
syntax...................................................................................................2113
examples..............................................................................................2113
description...........................................................................................2113
restrictions...........................................................................................2113
related..................................................................................................2113
default..................................................................................................2113
fix atc command.........................................................................................2114
syntax...................................................................................................2114
examples..............................................................................................2114
description...........................................................................................2114
restrictions...........................................................................................2116
related..................................................................................................2116
default..................................................................................................2118
fix_modify AtC fix_flux................................................................................2118
syntax...................................................................................................2118
examples..............................................................................................2118
description...........................................................................................2119
restrictions...........................................................................................2119
related..................................................................................................2119
default..................................................................................................2119
fix_modify AtC fix.......................................................................................2119
syntax...................................................................................................2119
examples..............................................................................................2119
description...........................................................................................2119
restrictions...........................................................................................2119
related..................................................................................................2119
default..................................................................................................2119
fix_modify AtC computes............................................................................2120
syntax...................................................................................................2120
examples..............................................................................................2120
description...........................................................................................2120
restrictions...........................................................................................2120
related..................................................................................................2120
default..................................................................................................2120
fix_modify AtC fields..................................................................................2121
syntax...................................................................................................2121
examples..............................................................................................2121
xxxi

LAMMPS Users Manual

LAMMPS Commands
description...........................................................................................2121
restrictions...........................................................................................2122
related..................................................................................................2122
default..................................................................................................2122
syntax...................................................................................................2122
examples..............................................................................................2122
description...........................................................................................2122
restrictions...........................................................................................2122
related..................................................................................................2122
default..................................................................................................2122
fix_modify AtC kernel.................................................................................2123
syntax...................................................................................................2123
examples..............................................................................................2123
description...........................................................................................2123
restrictions...........................................................................................2123
related..................................................................................................2123
default..................................................................................................2123
fix_modify AtC on_the_fly...........................................................................2123
syntax...................................................................................................2124
examples..............................................................................................2124
description...........................................................................................2124
restrictions...........................................................................................2124
related..................................................................................................2124
default..................................................................................................2124
fix_modify AtC rates...................................................................................2124
syntax...................................................................................................2124
examples..............................................................................................2125
description...........................................................................................2125
restrictions...........................................................................................2125
related..................................................................................................2125
default..................................................................................................2125
fix_modify AtC initial..................................................................................2125
syntax...................................................................................................2125
examples..............................................................................................2125
description...........................................................................................2125
restrictions...........................................................................................2125
default..................................................................................................2126
fix_modify AtC internal_atom_integrate.....................................................2126
syntax...................................................................................................2126
description...........................................................................................2126
default..................................................................................................2126
fix_modify AtC internal_element_set..........................................................2126
syntax...................................................................................................2126
examples..............................................................................................2126
description...........................................................................................2126
restrictions...........................................................................................2127
xxxii

LAMMPS Users Manual

LAMMPS Commands
related..................................................................................................2127
default..................................................................................................2127
syntax...................................................................................................2127
examples..............................................................................................2127
description...........................................................................................2127
optional................................................................................................2127
restrictions...........................................................................................2127
related..................................................................................................2127
default..................................................................................................2127
fix_modify AtC kernel.................................................................................2128
syntax...................................................................................................2128
examples..............................................................................................2128
description...........................................................................................2128
restrictions...........................................................................................2128
related..................................................................................................2128
default..................................................................................................2128
fix_modify AtC control localized_lambda...................................................2128
syntax...................................................................................................2128
examples..............................................................................................2129
description...........................................................................................2129
restrictions...........................................................................................2129
related..................................................................................................2129
default..................................................................................................2129
fix_modify AtC control lumped_lambda_solve............................................2129
syntax...................................................................................................2129
examples..............................................................................................2129
description...........................................................................................2129
restrictions...........................................................................................2129
related..................................................................................................2129
default..................................................................................................2129
syntax...................................................................................................2130
examples..............................................................................................2130
description...........................................................................................2130
restrictions...........................................................................................2130
related..................................................................................................2130
default..................................................................................................2130
fix_modify AtC mass_matrix.......................................................................2130
syntax...................................................................................................2130
examples..............................................................................................2130
description...........................................................................................2130
restrictions...........................................................................................2130
related..................................................................................................2130
default..................................................................................................2131
fix_modify AtC material..............................................................................2131
syntax...................................................................................................2131
xxxiii

LAMMPS Users Manual

LAMMPS Commands
examples..............................................................................................2131
description...........................................................................................2131
restrictions...........................................................................................2131
related..................................................................................................2131
default..................................................................................................2131
syntax...................................................................................................2131
examples..............................................................................................2132
description...........................................................................................2132
restrictions...........................................................................................2132
related..................................................................................................2132
default..................................................................................................2132
fix_modify AtC mesh create.......................................................................2132
syntax...................................................................................................2132
examples..............................................................................................2132
description...........................................................................................2132
restrictions...........................................................................................2132
related..................................................................................................2132
default..................................................................................................2132
fix_modify AtC mesh create_elementset....................................................2133
syntax...................................................................................................2133
examples..............................................................................................2133
description...........................................................................................2133
restrictions...........................................................................................2133
related..................................................................................................2133
default..................................................................................................2133
fix_modify AtC mesh create_faceset box....................................................2133
syntax...................................................................................................2133
examples..............................................................................................2134
description...........................................................................................2134
restrictions...........................................................................................2134
related..................................................................................................2134
default..................................................................................................2134
fix_modify AtC mesh create_faceset plane.................................................2134
syntax...................................................................................................2134
examples..............................................................................................2134
description...........................................................................................2134
restrictions...........................................................................................2134
related..................................................................................................2134
default..................................................................................................2135
fix_modify AtC mesh create_nodeset.........................................................2135
syntax...................................................................................................2135
examples..............................................................................................2135
description...........................................................................................2135
restrictions...........................................................................................2135
related..................................................................................................2135
default..................................................................................................2135
xxxiv

LAMMPS Users Manual

LAMMPS Commands
fix_modify AtC mesh delete_elements........................................................2135
syntax...................................................................................................2135
examples..............................................................................................2136
description...........................................................................................2136
restrictions...........................................................................................2136
related..................................................................................................2136
default..................................................................................................2136
fix_modify AtC mesh nodeset_to_elementset.............................................2136
syntax...................................................................................................2136
examples..............................................................................................2136
description...........................................................................................2136
restrictions...........................................................................................2136
related..................................................................................................2136
default..................................................................................................2136
fix_modify AtC mesh output.......................................................................2137
syntax...................................................................................................2137
examples..............................................................................................2137
description...........................................................................................2137
restrictions...........................................................................................2137
related..................................................................................................2137
default..................................................................................................2137
syntax...................................................................................................2137
examples..............................................................................................2137
description...........................................................................................2137
restrictions...........................................................................................2138
related..................................................................................................2138
default..................................................................................................2138
syntax...................................................................................................2138
examples..............................................................................................2138
description...........................................................................................2138
restrictions...........................................................................................2138
related..................................................................................................2138
default..................................................................................................2138
fix_modify AtC mesh write.........................................................................2138
syntax...................................................................................................2138
examples..............................................................................................2139
description...........................................................................................2139
restrictions...........................................................................................2139
related..................................................................................................2139
default..................................................................................................2139
fix_modify AtC time_integration (momentum)...........................................2139
syntax...................................................................................................2139
description...........................................................................................2139
examples..............................................................................................2139
description...........................................................................................2139
xxxv

LAMMPS Users Manual

LAMMPS Commands
related..................................................................................................2139
default..................................................................................................2140
fix_modify AtC output.................................................................................2140
syntax...................................................................................................2140
examples..............................................................................................2140
description...........................................................................................2140
restrictions...........................................................................................2140
related..................................................................................................2140
default..................................................................................................2140
fix_modify AtC output elementset..............................................................2141
syntax...................................................................................................2141
examples..............................................................................................2141
description...........................................................................................2141
restrictions...........................................................................................2141
related..................................................................................................2141
default..................................................................................................2141
fix_modify AtC output nodeset...................................................................2141
syntax...................................................................................................2141
examples..............................................................................................2141
description...........................................................................................2142
restrictions...........................................................................................2142
related..................................................................................................2142
default..................................................................................................2142
fix_modify AtC pair_interactions/bond_interactions..................................2142
syntax...................................................................................................2142
examples..............................................................................................2142
description...........................................................................................2142
restrictions...........................................................................................2142
related..................................................................................................2142
default..................................................................................................2142
fix_modify AtC poisson_solver....................................................................2142
syntax...................................................................................................2143
examples..............................................................................................2143
description...........................................................................................2143
restrictions...........................................................................................2143
related..................................................................................................2143
default..................................................................................................2143
syntax...................................................................................................2143
examples..............................................................................................2143
description...........................................................................................2143
restrictions...........................................................................................2143
related..................................................................................................2144
default..................................................................................................2144
fix_modify AtC remove_molecule...............................................................2144
syntax...................................................................................................2144
examples..............................................................................................2144
xxxvi

LAMMPS Users Manual

LAMMPS Commands
description...........................................................................................2144
restrictions...........................................................................................2144
related..................................................................................................2144
default..................................................................................................2144
fix_modify AtC remove_source...................................................................2144
syntax...................................................................................................2144
examples..............................................................................................2145
description...........................................................................................2145
restrictions...........................................................................................2145
related..................................................................................................2145
default..................................................................................................2145
fix_modify AtC remove_species..................................................................2145
syntax...................................................................................................2145
examples..............................................................................................2145
description...........................................................................................2145
restrictions...........................................................................................2145
related..................................................................................................2145
default..................................................................................................2145
fix_modify AtC reset_atomic_reference_positions......................................2146
syntax...................................................................................................2146
examples..............................................................................................2146
description...........................................................................................2146
restrictions...........................................................................................2146
related..................................................................................................2146
default..................................................................................................2146
fix_modify AtC reset_time..........................................................................2146
syntax...................................................................................................2146
examples..............................................................................................2146
description...........................................................................................2146
restrictions...........................................................................................2146
related..................................................................................................2146
default..................................................................................................2146
syntax...................................................................................................2147
examples..............................................................................................2147
description...........................................................................................2147
restrictions...........................................................................................2147
related..................................................................................................2147
default..................................................................................................2147
fix_modify AtC sample_frequency..............................................................2147
syntax...................................................................................................2147
examples..............................................................................................2147
description...........................................................................................2147
restrictions...........................................................................................2147
related..................................................................................................2148
default..................................................................................................2148
fix_modify AtC set......................................................................................2148
syntax...................................................................................................2148
xxxvii

LAMMPS Users Manual

LAMMPS Commands
examples..............................................................................................2148
description...........................................................................................2148
restrictions...........................................................................................2148
related..................................................................................................2148
default..................................................................................................2148
fix_modify AtC source................................................................................2149
syntax...................................................................................................2149
examples..............................................................................................2149
description...........................................................................................2149
restrictions...........................................................................................2149
related..................................................................................................2149
default..................................................................................................2149
fix_modify AtC source_integration.............................................................2149
syntax...................................................................................................2149
examples..............................................................................................2149
description...........................................................................................2149
restrictions...........................................................................................2149
related..................................................................................................2150
default..................................................................................................2150
fix_modify AtC temperature_definition......................................................2150
syntax...................................................................................................2150
examples..............................................................................................2150
description...........................................................................................2150
restrictions...........................................................................................2150
default..................................................................................................2150
fix_modify AtC time_integration (thermal).................................................2150
syntax...................................................................................................2150
description...........................................................................................2151
examples..............................................................................................2151
description...........................................................................................2151
related..................................................................................................2151
default..................................................................................................2151
fix_modify AtC filter...................................................................................2151
syntax...................................................................................................2151
examples..............................................................................................2151
description...........................................................................................2151
restrictions...........................................................................................2151
related..................................................................................................2152
default..................................................................................................2152
fix_modify AtC track_displacement............................................................2152
syntax...................................................................................................2152
examples..............................................................................................2152
description...........................................................................................2152
restrictions...........................................................................................2152
default..................................................................................................2152
fix_modify AtC unfix_flux...........................................................................2152
syntax...................................................................................................2152
xxxviii

LAMMPS Users Manual

LAMMPS Commands
examples..............................................................................................2153
description...........................................................................................2153
restrictions...........................................................................................2153
related..................................................................................................2153
default..................................................................................................2153
fix_modify AtC unfix...................................................................................2153
syntax...................................................................................................2153
examples..............................................................................................2153
description...........................................................................................2153
restrictions...........................................................................................2153
related..................................................................................................2153
default..................................................................................................2153
fix_modify AtC write_atom_weights...........................................................2154
syntax...................................................................................................2154
examples..............................................................................................2154
description...........................................................................................2154
restrictions...........................................................................................2154
related..................................................................................................2154
default..................................................................................................2154
fix_modify AtC write_restart......................................................................2154
syntax...................................................................................................2154
examples..............................................................................................2154
description...........................................................................................2154
restrictions...........................................................................................2154
related..................................................................................................2155
default..................................................................................................2155

xxxix

LAMMPS Documentation
16 Mar 2018 version
Version info:
The LAMMPS "version" is the date when it was released, such as 1 May 2010.
LAMMPS is updated continuously. Whenever we fix a bug or add a feature, we release
it immediately, and post a notice on this page of the WWW site. Every 2-4 months one
of the incremental releases is subjected to more thorough testing and labeled as a
stable version.
Each dated copy of LAMMPS contains all the features and bug-fixes up to and
including that version date. The version date is printed to the screen and logfile every
time you run LAMMPS. It is also in the file src/version.h and in the LAMMPS directory
name created when you unpack a tarball, and at the top of the first page of the manual
• If you browse the HTML doc pages on the LAMMPS WWW site, they always
describe the most current development version of LAMMPS.
• If you browse the HTML doc pages included in your tarball, they describe the
version you have.
• The PDF file on the WWW site or in the tarball is updated about once per
month. This is because it is large, and we don't want it to be part of every patch.
• There is also a Developer.pdf file in the doc directory, which describes the
internal structure and algorithms of LAMMPS.
LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel Simulator.
LAMMPS is a classical molecular dynamics simulation code designed to run efficiently
on parallel computers. It was developed at Sandia National Laboratories, a US
Department of Energy facility, with funding from the DOE. It is an open-source code,
distributed freely under the terms of the GNU Public License (GPL).
The current core group of LAMMPS developers is at Sandia National Labs and Temple
University:
• Steve Plimpton, sjplimp at sandia.gov
• Aidan Thompson, athomps at sandia.gov
• Stan Moore, stamoor at sandia.gov
• Axel Kohlmeyer, akohlmey at gmail.com
Past core developers include Paul Crozier, Ray Shan and Mark Stevens, all at Sandia.
the code and its uses. Interaction with external LAMMPS developers, bug reports and
feature requests are mainly coordinated through the LAMMPS project on GitHub. The
lammps.org domain, currently hosting public continuous integration testing and
precompiled Linux RPM and Windows installer packages is located at Temple
University and managed by Richard Berger, richard.berger at temple.edu.

1

LAMMPS Users Manual
The LAMMPS documentation is organized into the following sections. If you find
errors or omissions in this manual or have suggestions for useful information to add,
please send an email to the developers so we can improve the LAMMPS
documentation.
Once you are familiar with LAMMPS, you may want to bookmark this page at
LAMMPS commands.
PDF file of the entire manual, generated by htmldoc
1. Introduction
1.1 What is LAMMPS
1.2 LAMMPS features
1.3 LAMMPS non-features
1.4 Open source distribution
1.5 Acknowledgments and citations
2. Getting started
2.1 What's in the LAMMPS distribution
2.2 Making LAMMPS
2.3 Making LAMMPS with optional packages
2.4 Building LAMMPS as a library
2.5 Running LAMMPS
2.6 Command-line options
2.7 Screen output
2.8 Tips for users of previous versions
3. Commands
3.1 LAMMPS input script
3.2 Parsing rules
3.3 Input script structure
3.4 Commands listed by category
3.5 Commands listed alphabetically
4. Packages
4.1 Standard packages
4.2 User packages
5. Accelerating LAMMPS performance
5.1 Measuring performance
5.2 Algorithms and code options to boost performace
5.3 Accelerator packages with optimized styles
5.3.1 GPU package
5.3.2 USER-INTEL package
5.3.3 KOKKOS package
5.3.4 USER-OMP package
5.3.5 OPT package
5.4 Comparison of various accelerator packages
6. How-to discussions
6.1 Restarting a simulation
6.2 2d simulations
6.3 CHARMM and AMBER force fields
6.4 Running multiple simulations from one input script
6.5 Multi-replica simulations
2

LAMMPS Users Manual

7.
8.
9.
10.

11.

12.

6.6 Granular models
6.7 TIP3P water model
6.8 TIP4P water model
6.9 SPC water model
6.10 Coupling LAMMPS to other codes
6.11 Visualizing LAMMPS snapshots
6.12 Triclinic (non-orthogonal) simulation boxes
6.13 NEMD simulations
6.14 Finite-size spherical and aspherical particles
6.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables)
6.16 Thermostatting, barostatting, and compute temperature
6.17 Walls
6.18 Elastic constants
6.19 Library interface to LAMMPS
6.20 Calculating thermal conductivity
6.21 Calculating viscosity
6.22 Calculating a diffusion coefficient
6.23 Using chunks to calculate system properties
6.24 Setting parameters for pppm/disp
6.25 Polarizable models
6.27 Drude induced dipoles
Example problems
Performance & scalability
Modifying & extending LAMMPS
10.1 Atom styles
10.2 Bond, angle, dihedral, improper potentials
10.3 Compute styles
10.4 Dump styles
10.5 Dump custom output options
10.6 Fix styles
10.7 Input script commands
10.8 Kspace computations
10.9 Minimization styles
10.10 Pairwise potentials
10.11 Region styles
10.12 Body styles
10.13 Thermodynamic output options
10.14 Variable options
10.15 Submitting new features for inclusion in LAMMPS
Python interface
11.1 Overview of running LAMMPS from Python
11.2 Overview of using Python from a LAMMPS script
11.3 Building LAMMPS as a shared library
11.4 Installing the Python wrapper into Python
11.5 Extending Python with MPI to run in parallel
11.6 Testing the Python-LAMMPS interface
11.7 Using LAMMPS from Python
11.8 Example Python scripts that use LAMMPS
Errors
3

LAMMPS Users Manual
12.1 Common problems
12.2 Reporting bugs
12.3 Error & warning messages
13. Future and history
13.1 Coming attractions
13.2 Past versions

4

LAMMPS Users Manual
Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS
Commands - Next Section

1. Introduction
This section provides an overview of what LAMMPS can and can't do, describes what
it means for LAMMPS to be an open-source code, and acknowledges the funding and
people who have contributed to LAMMPS over the years.
1.1
1.2
1.3
1.4
1.5

What is LAMMPS
LAMMPS features
LAMMPS non-features
Open source distribution
Acknowledgments and citations

1.1 What is LAMMPS
LAMMPS is a classical molecular dynamics code that models an ensemble of particles
in a liquid, solid, or gaseous state. It can model atomic, polymeric, biological, metallic,
granular, and coarse-grained systems using a variety of force fields and boundary
conditions.
For examples of LAMMPS simulations, see the Publications page of the LAMMPS
WWW Site.
LAMMPS runs efficiently on single-processor desktop or laptop machines, but is
designed for parallel computers. It will run on any parallel machine that compiles
C++ and supports the MPI message-passing library. This includes distributed- or
shared-memory parallel machines and Beowulf-style clusters.
LAMMPS can model systems with only a few particles up to millions or billions. See
Section 8 for information on LAMMPS performance and scalability, or the Benchmarks
section of the LAMMPS WWW Site.
LAMMPS is a freely-available open-source code, distributed under the terms of the
GNU Public License, which means you can use or modify the code however you wish.
See this section for a brief discussion of the open-source philosophy.
LAMMPS is designed to be easy to modify or extend with new capabilities, such as
new force fields, atom types, boundary conditions, or diagnostics. See Section 10 for
more details.
The current version of LAMMPS is written in C++. Earlier versions were written in
F77 and F90. See Section 13 for more information on different versions. All versions
LAMMPS was originally developed under a US Department of Energy CRADA
(Cooperative Research and Development Agreement) between two DOE labs and 3
5

LAMMPS Users Manual
companies. It is distributed by Sandia National Labs. See this section for more
information on LAMMPS funding and individuals who have contributed to LAMMPS.
In the most general sense, LAMMPS integrates Newton's equations of motion for
collections of atoms, molecules, or macroscopic particles that interact via short- or
long-range forces with a variety of initial and/or boundary conditions. For
computational efficiency LAMMPS uses neighbor lists to keep track of nearby
particles. The lists are optimized for systems with particles that are repulsive at short
distances, so that the local density of particles never becomes too large. On parallel
machines, LAMMPS uses spatial-decomposition techniques to partition the simulation
domain into small 3d sub-domains, one of which is assigned to each processor.
Processors communicate and store "ghost" atom information for atoms that border
their sub-domain. LAMMPS is most efficient (in a parallel sense) for systems whose
particles fill a 3d rectangular box with roughly uniform density. Papers with technical
details of the algorithms used in LAMMPS are listed in this section.

1.2 LAMMPS features
This section highlights LAMMPS features, with pointers to specific commands which
give more details. If LAMMPS doesn't have your favorite interatomic potential,
boundary condition, or atom type, see Section 10, which describes how you can add it
to LAMMPS.
General features

• runs on a single processor or in parallel
• distributed-memory message-passing parallelism (MPI)
• spatial-decomposition of simulation domain for parallelism
• open-source distribution
• highly portable C++
• optional libraries used: MPI and single-processor FFT
• GPU (CUDA and OpenCL), Intel(R) Xeon Phi(TM) coprocessors, and OpenMP
support for many code features
• easy to extend with new features and functionality
• runs from an input script
• syntax for defining and using variables and formulas
• syntax for looping over runs and breaking out of loops
• run one or multiple simulations simultaneously (in parallel) from one script
• build as library, invoke LAMMPS thru library interface or provided Python
wrapper
• couple with other codes: LAMMPS calls other code, other code calls LAMMPS,
umbrella code calls both
Particle and model types

(atom style command)
• atoms
• coarse-grained particles (e.g. bead-spring polymers)
• united-atom polymers or organic molecules
6

LAMMPS Users Manual
• all-atom polymers, organic molecules, proteins, DNA
• metals
• granular materials
• coarse-grained mesoscale models
• finite-size spherical and ellipsoidal particles
• finite-size line segment (2d) and triangle (3d) particles
• point dipole particles
• rigid collections of particles
• hybrid combinations of these
Force fields

(pair style, bond style, angle style, dihedral style, improper style, kspace style
commands)
• pairwise potentials: Lennard-Jones, Buckingham, Morse, Born-Mayer-Huggins,
Yukawa, soft, class 2 (COMPASS), hydrogen bond, tabulated
• charged pairwise potentials: Coulombic, point-dipole
• manybody potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM),
embedded ion method (EIM), EDIP, ADP, Stillinger-Weber, Tersoff, REBO,
AIREBO, ReaxFF, COMB, SNAP, Streitz-Mintmire, 3-body polymorphic
• long-range interactions for charge, point-dipoles, and LJ dispersion: Ewald,
Wolf, PPPM (similar to particle-mesh Ewald)
• polarization models: QEq, core/shell model, Drude dipole model
• charge equilibration (QEq via dynamic, point, shielded, Slater methods)
• coarse-grained potentials: DPD, GayBerne, REsquared, colloidal, DLVO
• mesoscopic potentials: granular, Peridynamics, SPH
• electron force field (eFF, AWPMD)
• bond potentials: harmonic, FENE, Morse, nonlinear, class 2, quartic (breakable)
• angle potentials: harmonic, CHARMM, cosine, cosine/squared, cosine/periodic,
class 2 (COMPASS)
• dihedral potentials: harmonic, CHARMM, multi-harmonic, helix, class 2
(COMPASS), OPLS
• improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS)
• polymer potentials: all-atom, united-atom, bead-spring, breakable
• water potentials: TIP3P, TIP4P, SPC
• implicit solvent potentials: hydrodynamic lubrication, Debye
• force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS,
GROMACS, COMPASS options
• hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can
be used in one simulation
• overlaid potentials: superposition of multiple pair potentials
Atom creation

(read_data, lattice, create_atoms, delete_atoms, displace_atoms, replicate commands)
• read in atom coords from files
• create atoms on one or more lattices (e.g. grain boundaries)
• delete geometric or logical groups of atoms (e.g. voids)
7

LAMMPS Users Manual
• replicate existing atoms multiple times
• displace atoms
Ensembles, constraints, and boundary conditions

(fix command)
• 2d or 3d systems
• orthogonal or non-orthogonal (triclinic symmetry) simulation domains
• constant NVE, NVT, NPT, NPH, Parinello/Rahman integrators
• thermostatting options for groups and geometric regions of atoms
• pressure control via Nose/Hoover or Berendsen barostatting in 1 to 3
dimensions
• simulation box deformation (tensile and shear)
• harmonic (umbrella) constraint forces
• rigid body constraints
• SHAKE bond and angle constraints
• Monte Carlo bond breaking, formation, swapping
• atom/molecule insertion and deletion
• walls of various kinds
• non-equilibrium molecular dynamics (NEMD)
• variety of additional boundary conditions and constraints
Integrators

(run, run_style, minimize commands)
• velocity-Verlet integrator
• Brownian dynamics
• rigid body integration
• energy minimization via conjugate gradient or steepest descent relaxation
• rRESPA hierarchical timestepping
• rerun command for post-processing of dump files
Diagnostics

• see the various flavors of the fix and compute commands
Output

(dump, restart commands)
• log file of thermodynamic info
• text dump files of atom coords, velocities, other per-atom quantities
• binary restart files
• parallel I/O of dump and restart files
• per-atom quantities (energy, stress, centro-symmetry parameter, CNA, etc)
• user-defined system-wide (log file) or per-atom (dump file) calculations
• spatial and time averaging of per-atom quantities
• time averaging of system-wide quantities
• atom snapshots in native, XYZ, XTC, DCD, CFG formats
8

LAMMPS Users Manual
Multi-replica models

nudged elastic band parallel replica dynamics temperature accelerated dynamics
parallel tempering
Pre- and post-processing

• Various pre- and post-processing serial tools are packaged with LAMMPS; see
these doc pages.
• Our group has also written and released a separate toolkit called Pizza.py which
provides tools for doing setup, analysis, plotting, and visualization for LAMMPS
simulations. Pizza.py is written in Python and is available for download from the
Pizza.py WWW site.
Specialized features

LAMMPS can be built with optional packages which implement a variety of additional
capabilities. An overview of all the packages is given here.
These are some LAMMPS capabilities which you may not think of as typical classical
molecular dynamics options:
• generalized aspherical particles
• stochastic rotation dynamics (SRD)
• real-time visualization and interactive MD
• calculate virtual diffraction patterns
• atom-to-continuum coupling with finite elements
• coupled rigid body integration via the POEMS library
• QM/MM coupling
• path-integral molecular dynamics (PIMD) and this as well
• Monte Carlo via GCMC and tfMC atom swapping and bond swapping
• Direct Simulation Monte Carlo for low-density fluids
• Peridynamics mesoscale modeling
• Lattice Boltzmann fluid
• targeted and steered molecular dynamics
• two-temperature electron model

1.3 LAMMPS non-features
LAMMPS is designed to efficiently compute Newton's equations of motion for a system
of interacting particles. Many of the tools needed to pre- and post-process the data for
such simulations are not included in the LAMMPS kernel for several reasons:
• the desire to keep LAMMPS simple
• they are not parallel operations
• other codes already do them
• limited development resources
Specifically, LAMMPS itself does not:
9

LAMMPS Users Manual
• run thru a GUI
• build molecular systems
• assign force-field coefficients automagically
• perform sophisticated analyses of your MD simulation
A few tools for pre- and post-processing tasks are provided as part of the LAMMPS
package; they are described in this section. However, many people use other codes or
write their own tools for these tasks.
As noted above, our group has also written and released a separate toolkit called
Pizza.py which addresses some of the listed bullets. It provides tools for doing setup,
analysis, plotting, and visualization for LAMMPS simulations. Pizza.py is written in
LAMMPS requires as input a list of initial atom coordinates and types, molecular
topology information, and force-field coefficients assigned to all atoms and bonds.
LAMMPS will not build molecular systems and assign force-field parameters for you.
For atomic systems LAMMPS provides a create_atoms command which places atoms
on solid-state lattices (fcc, bcc, user-defined, etc). Assigning small numbers of force
field coefficients can be done via the pair coeff, bond coeff, angle coeff, etc
commands. For molecular systems or more complicated simulation geometries, users
typically use another code as a builder and convert its output to LAMMPS input
format, or write their own code to generate atom coordinate and molecular topology
For complicated molecular systems (e.g. a protein), a multitude of topology
information and hundreds of force-field coefficients must typically be specified. We
suggest you use a program like CHARMM or AMBER or other molecular builders to
setup such problems and dump its information to a file. You can then reformat the file
as LAMMPS input. Some of the tools in this section can assist in this process.
Similarly, LAMMPS creates output files in a simple format. Most users post-process
these files with their own analysis tools or re-format them for input into other
programs, including visualization packages. If you are convinced you need to compute
something on-the-fly as LAMMPS runs, see Section 10 for a discussion of how you can
use the dump and compute and fix commands to print out data of your choosing. Keep
in mind that complicated computations can slow down the molecular dynamics
timestepping, particularly if the computations are not parallel, so it is often better to
leave such analysis to post-processing codes.
For high-quality visualization we recommend the following packages:
• VMD
• AtomEye
• OVITO
• ParaView
• PyMol
• Raster3d
10

LAMMPS Users Manual
• RasMol
Other features that LAMMPS does not yet (and may never) support are discussed in
Section 13.
Finally, these are freely-available molecular dynamics codes, most of them parallel,
which may be well-suited to the problems you want to model. They can also be used in
conjunction with LAMMPS to perform complementary modeling tasks.
• CHARMM
• AMBER
• NAMD
• NWCHEM
• DL_POLY
• Tinker
CHARMM, AMBER, NAMD, NWCHEM, and Tinker are designed primarily for
modeling biological molecules. CHARMM and AMBER use atom-decomposition
(replicated-data) strategies for parallelism; NAMD and NWCHEM use
spatial-decomposition approaches, similar to LAMMPS. Tinker is a serial code.
DL_POLY includes potentials for a variety of biological and non-biological materials;
both a replicated-data and spatial-decomposition version exist.

1.4 Open source distribution
LAMMPS comes with no warranty of any kind. As each source file states in its header,
it is a copyrighted code that is distributed free-of- charge, under the terms of the GNU
Public License (GPL). This is often referred to as open-source distribution - see
www.gnu.org or www.opensource.org for more details. The legal text of the GPL is in
the LICENSE file that is included in the LAMMPS distribution.
Here is a summary of what the GPL means for LAMMPS users:
(1) Anyone is free to use, modify, or extend LAMMPS in any way they choose,
including for commercial purposes.
(2) If you distribute a modified version of LAMMPS, it must remain open-source,
meaning you distribute it under the terms of the GPL. You should clearly annotate
such a code as a derivative version of LAMMPS.
(3) If you release any code that includes LAMMPS source code, then it must also be
open-sourced, meaning you distribute it under the terms of the GPL.
(4) If you give LAMMPS files to someone else, the GPL LICENSE file and source file
headers (including the copyright and GPL notices) should remain part of the code.
In the spirit of an open-source code, these are various ways you can contribute to
making LAMMPS better. You can send email to the developers on any of these items.

11

LAMMPS Users Manual
• Point prospective users to the LAMMPS WWW Site. Mention it in talks or link to
• If you find an error or omission in this manual or on the LAMMPS WWW Site, or
have a suggestion for something to clarify or include, send an email to the
developers.
• If you find a bug, Section 12.2 describes how to report it.
• If you publish a paper using LAMMPS results, send the citation (and any cool
pictures or movies if you like) to add to the Publications, Pictures, and Movies
pages of the LAMMPS WWW Site, with links and attributions back to you.
• Create a new Makefile.machine that can be added to the src/MAKE directory.
• The tools sub-directory of the LAMMPS distribution has various stand-alone
codes for pre- and post-processing of LAMMPS data. More details are given in
Section 9. If you write a new tool that users will find useful, it can be added to
the LAMMPS distribution.
• LAMMPS is designed to be easy to extend with new code for features like
potentials, boundary conditions, diagnostic computations, etc. This section gives
details. If you add a feature of general interest, it can be added to the LAMMPS
distribution.
• The Benchmark page of the LAMMPS WWW Site lists LAMMPS performance on
various platforms. The files needed to run the benchmarks are part of the
LAMMPS distribution. If your machine is sufficiently different from those listed,
• You can send feedback for the User Comments page of the LAMMPS WWW
Site. It might be added to the page. No promises.
• Cash. Small denominations, unmarked bills preferred. Paper sack OK. Leave on
desk. VISA also accepted. Chocolate chip cookies encouraged.
1.5 Acknowledgments and citations
LAMMPS development has been funded by the US Department of Energy (DOE),
through its CRADA, LDRD, ASCI, and Genomes-to-Life programs and its OASCR and
OBER offices.
Specifically, work on the latest version was funded in part by the US Department of
Energy's Genomics:GTL program (www.doegenomestolife.org) under the project,
"Carbon Sequestration in Synechococcus Sp.: From Molecular Machines to
Hierarchical Modeling".
The following paper describe the basic parallel algorithms used in LAMMPS. If you
use LAMMPS results in your published work, please cite this paper and include a
pointer to the LAMMPS WWW Site (http://lammps.sandia.gov):
S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J
Comp Phys, 117, 1-19 (1995).
Other papers describing specific algorithms used in LAMMPS are listed under the
Citing LAMMPS link of the LAMMPS WWW page.
The Publications link on the LAMMPS WWW page lists papers that have cited
LAMMPS. If your paper is not listed there for some reason, feel free to send us the
info. If the simulations in your paper produced cool pictures or animations, we'll be
12

LAMMPS Users Manual
pleased to add them to the Pictures or Movies pages of the LAMMPS WWW site.
The primary LAMMPS developers are at Sandia National Labs and Temple University:
• Steve Plimpton, sjplimp at sandia.gov
• Aidan Thompson, athomps at sandia.gov
• Stan Moore, stamoor at sandia.gov
• Axel Kohlmeyer, akohlmey at gmail.com
Past primary developers include Paul Crozier and Mark Stevens, both at Sandia, and
Ray Shan, now at Materials Design.
The following folks are responsible for significant contributions to the code, or other
aspects of the LAMMPS development effort. Many of the packages they have written
are somewhat unique to LAMMPS and the code would not be as general-purpose as it
is without their expertise and efforts.
• Axel Kohlmeyer (Temple U), akohlmey at gmail.com, SVN and Git repositories,
indefatigable mail list responder, USER-CGSDK, USER-OMP, USER-COLVARS,
USER-MOLFILE, USER-QMMM, USER-TALLY, and COMPRESS packages
• Roy Pollock (LLNL), Ewald and PPPM solvers
• Mike Brown (ORNL), brownw at ornl.gov, GPU and USER-INTEL package
• Greg Wagner (Sandia), gjwagne at sandia.gov, MEAM package for MEAM
potential
• Mike Parks (Sandia), mlparks at sandia.gov, PERI package for Peridynamics
• Rudra Mukherjee (JPL), Rudranarayan.M.Mukherjee at jpl.nasa.gov, POEMS
package for articulated rigid body motion
• Reese Jones (Sandia) and collaborators, rjones at sandia.gov, USER-ATC
package for atom/continuum coupling
• Ilya Valuev (JIHT), valuev at physik.hu-berlin.de, USER-AWPMD package for
wave-packet MD
• Christian Trott (U Tech Ilmenau), christian.trott at tu-ilmenau.de, USER-CUDA
and KOKKOS packages
• Andres Jaramillo-Botero (Caltech), ajaramil at wag.caltech.edu, USER-EFF
package for electron force field
• Christoph Kloss (JKU), Christoph.Kloss at jku.at, USER-LIGGGHTS package for
granular models and granular/fluid coupling
• Metin Aktulga (LBL), hmaktulga at lbl.gov, USER-REAXC package for C version
of ReaxFF
• Georg Gunzenmuller (EMI), georg.ganzenmueller at emi.fhg.de, USER-SMD and
USER-SPH packages
• Colin Denniston (U Western Ontario), cdennist at uwo.ca, USER-LB package
As discussed in Section 13, LAMMPS originated as a cooperative project between
DOE labs and industrial partners. Folks involved in the design and testing of the
original version of LAMMPS were the following:
• John Carpenter (Mayo Clinic, formerly at Cray Research)
• Terry Stouch (Lexicon Pharmaceuticals, formerly at Bristol Myers Squibb)
• Steve Lustig (Dupont)
• Jim Belak (LLNL)
13

LAMMPS Users Manual
Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS
Commands - Next Section

2. Getting Started
This section describes how to build and run LAMMPS, for both new and experienced
users.
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8

What's in the LAMMPS distribution
Making LAMMPS
Making LAMMPS with optional packages
Building LAMMPS as a library
Running LAMMPS
Command-line options
Screen output
Tips for users of previous versions

2.1 What's in the LAMMPS distribution
When you download a LAMMPS tarball you will need to unzip and untar the
downloaded file with the following commands, after placing the tarball in an
appropriate directory.
tar -xzvf lammps*.tar.gz

This will create a LAMMPS directory containing two files and several sub-directories:
bench
benchmark problems
doc
documentation
examples simple test problems
potentials embedded atom method (EAM) potential files
src
source files
tools
pre- and post-processing tools
as well as pre-built packages for several widely used Linux distributions. It also has
instructions for how to download/install LAMMPS for Macs (via Homebrew), and to
download and update LAMMPS from SVN and Git repositories, which gives you access
to the up-to-date sources that are used by the LAMMPS core developers.
The Windows and Linux packages for serial or parallel include only selected packages
download page. If you want an executable with non-included packages or that is more
current, then you'll need to build LAMMPS yourself, as discussed in the next section.
Skip to the Running LAMMPS sections for info on how to launch a LAMMPS Windows
executable on a Windows box.
14

LAMMPS Users Manual
2.2 Making LAMMPS
This section has the following sub-sections:
2.2.1
2.2.1
2.2.3
2.2.4
2.2.5
2.2.6

Steps to build a LAMMPS executable
Common errors that can occur when making LAMMPS
Building for a Mac
Building for Windows

If you want to avoid building LAMMPS yourself, read the preceding section about
Building LAMMPS can be simple or not-so-simple. If all you need are the default
packages installed in LAMMPS, and MPI is already installed on your machine, or you
just want to run LAMMPS in serial, then you can typically use the Makefile.mpi or
Makefile.serial files in src/MAKE by typing one of these lines (from the src dir):
make mpi
make serial

Note that on a facility supercomputer, there are often "modules" loaded in your
environment that provide the compilers and MPI you should use. In this case, the
"mpicxx" compile/link command in Makefile.mpi should simply work by accessing
those modules.
It may be the case that one of the other Makefile.machine files in the src/MAKE
sub-directories is a better match to your system (type "make" to see a list), you can
use it as-is by typing (for example):
make stampede

If any of these builds (with an existing Makefile.machine) works on your system, then
you're done!
If you need to install an optional package with a LAMMPS command you want to use,
and the package does not depend on an extra library, you can simply type
make name

before invoking (or re-invoking) the above steps. "Name" is the lower-case name of the
package, e.g. replica or user-misc.
If you want to do one of the following:
• use a LAMMPS command that requires an extra library (e.g. dump image)
15

LAMMPS Users Manual
• build with a package that requires an extra library
• build with an accelerator package that requires special compiler/linker settings
• run on a machine that has its own compilers, settings, or libraries
then building LAMMPS is more complicated. You may need to find where extra
libraries exist on your machine or install them if they don't. You may need to build
extra libraries that are included in the LAMMPS distribution, before building
LAMMPS itself. You may need to edit a Makefile.machine file to make it compatible
Please read the following sections carefully. If you are not comfortable with makefiles,
or building codes on a Unix platform, or running an MPI job on your machine, please
experience are often not LAMMPS issues - they are peculiar to the user's system,
compilers, libraries, etc. Such questions are better answered by a local expert.
If you have a build problem that you are convinced is a LAMMPS issue (e.g. the
compiler complains about a line of LAMMPS source code), then please post the issue
to the LAMMPS mail list.
If you succeed in building LAMMPS on a new kind of machine, for which there isn't a
similar machine Makefile included in the src/MAKE/MACHINES directory, then send it
to the developers and we can include it in the LAMMPS distribution.
Steps to build a LAMMPS executable
Step 0

The src directory contains the C++ source and header files for LAMMPS. It also
contains a top-level Makefile and a MAKE sub-directory with low-level Makefile.* files
for many systems and machines. See the src/MAKE/README file for a quick overview
of what files are available and what sub-directories they are in.
The src/MAKE dir has a few files that should work as-is on many platforms. The
src/MAKE/OPTIONS dir has more that invoke additional compiler, MPI, and other
setting options commonly used by LAMMPS, to illustrate their syntax. The
src/MAKE/MACHINES dir has many more that have been tweaked or optimized for
specific machines. These files are all good starting points if you find you need to
change them for your machine. Put any file you edit into the src/MAKE/MINE
directory and it will be never be touched by any LAMMPS updates.
>From within the src directory, type "make" or "gmake". You should see a list of
available choices from src/MAKE and all of its sub-directories. If one of those has the
options you want or is the machine you want, you can type a command like:
make mpi

or
make serial

16

LAMMPS Users Manual
or
gmake mac

Note that the corresponding Makefile.machine can exist in src/MAKE or any of its
sub-directories. If a file with the same name appears in multiple places (not a good
idea), the order they are used is as follows: src/MAKE/MINE, src/MAKE,
src/MAKE/OPTIONS, src/MAKE/MACHINES. This gives preference to a file you have
created/edited and put in src/MAKE/MINE.
Note that on a multi-processor or multi-core platform you can launch a parallel make,
by using the "-j" switch with the make command, which will build LAMMPS more
quickly.
If you get no errors and an executable like lmp_mpi or lmp_serial or lmp_mac is
produced, then you're done; it's your lucky day.
Note that by default only a few of LAMMPS optional packages are installed. To build
LAMMPS with optional packages, see this section below.
Step 1

If Step 0 did not work, you will need to create a low-level Makefile for your machine,
like Makefile.foo. You should make a copy of an existing Makefile.* in src/MAKE or
one of its sub-directories as a starting point. The only portions of the file you need to
edit are the first line, the "compiler/linker settings" section, and the
"LAMMPS-specific settings" section. When it works, put the edited file in
src/MAKE/MINE and it will not be altered by any future LAMMPS updates.
Step 2

Change the first line of Makefile.foo to list the word "foo" after the "#", and whatever
other options it will set. This is the line you will see if you just type "make".
Step 3

compiler, including optimization flags. You can use g++, the open-source GNU
compiler, which is available on all Unix systems. You can also use mpicxx which will
typically be available if MPI is installed on your system, though you should check
which actual compiler it wraps. Vendor compilers often produce faster code. On boxes
with Intel CPUs, we suggest using the Intel icc compiler, which can be downloaded
from Intel's compiler site.
If building a C++ code on your machine requires additional libraries, then you should
list them as part of the LIB variable. You should not need to do this if you use mpicxx.
The DEPFLAGS setting is what triggers the C++ compiler to create a dependency list
for a source file. This speeds re-compilation when source (*.cpp) or header (*.h) files
are edited. Some compilers do not support dependency file creation, or may use a
different switch than -D. GNU g++ and Intel icc works with -D. If your compiler can't
create dependency files, then you'll need to create a Makefile.foo patterned after
17

LAMMPS Users Manual
Makefile.storm, which uses different rules that do not involve dependency files. Note
that when you build LAMMPS for the first time on a new platform, a long list of *.d
files will be printed out rapidly. This is not an error; it is the Makefile doing its normal
creation of dependencies.
Step 4

The "system-specific settings" section has several parts. Note that if you change any
-D setting in this section, you should do a full re-compile, after typing "make clean"
(which will describe different clean options).
The LMP_INC variable is used to include options that turn on ifdefs within the
LAMMPS code. The options that are currently recognized are:
• -DLAMMPS_GZIP
• -DLAMMPS_JPEG
• -DLAMMPS_PNG
• -DLAMMPS_FFMPEG
• -DLAMMPS_MEMALIGN
• -DLAMMPS_SMALLBIG
• -DLAMMPS_BIGBIG
• -DLAMMPS_SMALLSMALL
• -DLAMMPS_LONGLONG_TO_LONG
• -DLAMMPS_EXCEPTIONS
• -DPACK_ARRAY
• -DPACK_POINTER
• -DPACK_MEMCPY
The read_data and dump commands will read/write gzipped files if you compile with
-DLAMMPS_GZIP. It requires that your machine supports the "popen()" function in the
standard runtime library and that a gzip executable can be found by LAMMPS during
a run.
NOTE: on some clusters with high-speed networks, using the fork() library calls
(required by popen()) can interfere with the fast communication library and lead to
simulations using compressed output or input to hang or crash. For selected
operations, compressed file I/O is also available using a compression library instead,
which are provided in the COMPRESS package. From more details about compiling
LAMMPS with packages, please see below.
If you use -DLAMMPS_JPEG, the dump image command will be able to write out JPEG
image files. For JPEG files, you must also link LAMMPS with a JPEG library, as
described below. If you use -DLAMMPS_PNG, the dump image command will be able
to write out PNG image files. For PNG files, you must also link LAMMPS with a PNG
library, as described below. If neither of those two defines are used, LAMMPS will
only be able to write out uncompressed PPM image files.
If you use -DLAMMPS_FFMPEG, the dump movie command will be available to
support on-the-fly generation of rendered movies the need to store intermediate image
files. It requires that your machines supports the "popen" function in the standard
runtime library and that an FFmpeg executable can be found by LAMMPS during the
18

LAMMPS Users Manual
run.
NOTE: Similar to the note above, this option can conflict with high-speed networks,
because it uses popen().
Using -DLAMMPS_MEMALIGN= enables the use of the posix_memalign() call instead
of malloc() when large chunks or memory are allocated by LAMMPS. This can help to
make more efficient use of vector instructions of modern CPUS, since dynamically
allocated memory has to be aligned on larger than default byte boundaries (e.g. 16
bytes instead of 8 bytes on x86 type platforms) for optimal performance.
Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG,
-DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG. These
settings refer to use of 4-byte (small) vs 8-byte (big) integers within LAMMPS, as
specified in src/lmptype.h. The only reason to use the BIGBIG setting is to enable
simulation of huge molecular systems (which store bond topology info) with more than
2 billion atoms, or to track the image flags of moving atoms that wrap around a
periodic box more than 512 times. Normally, the only reason to use SMALLSMALL is
if your machine does not support 64-bit integers, though you can use SMALLSMALL
setting if you are running in serial or on a desktop machine or small cluster where you
will never run large systems or for long time (more than 2 billion atoms, more than 2
billion timesteps). See the Additional build tips section below for more details on these
settings.
Note that the USER-ATC package is not currently compatible with
-DLAMMPS_BIGBIG. Also the GPU package requires the lib/gpu library to be compiled
with the same setting, or the link will fail.
The -DLAMMPS_LONGLONG_TO_LONG setting may be needed if your system or MPI
version does not recognize "long long" data types. In this case a "long" data type is
likely already 64-bits, in which case this setting will convert to that data type.
The -DLAMMPS_EXCEPTIONS setting can be used to activate alternative versions of
error handling inside of LAMMPS. This is useful when external codes drive LAMMPS
as a library. Using this option, LAMMPS errors do not kill the caller. Instead, the call
stack is unwound and control returns to the caller. The library interface provides the
lammps_has_error() and lammps_get_last_error_message() functions to detect and find
out more about a LAMMPS error.
Using one of the -DPACK_ARRAY, -DPACK_POINTER, and -DPACK_MEMCPY options
can make for faster parallel FFTs (in the PPPM solver) on some platforms. The
-DPACK_ARRAY setting is the default. See the kspace_style command for info about
PPPM. See Step 6 below for info about building LAMMPS with an FFT library.
Step 5

The 3 MPI variables are used to specify an MPI library to build LAMMPS with. Note
that you do not need to set these if you use the MPI compiler mpicxx for your CC and
LINK setting in the section above. The MPI wrapper knows where to find the needed
files.

19

LAMMPS Users Manual
If you want LAMMPS to run in parallel, you must have an MPI library installed on your
platform. If MPI is installed on your system in the usual place (under /usr/local), you
also may not need to specify these 3 variables, assuming /usr/local is in your path. On
some large parallel machines which use "modules" for their compile/link
environments, you may simply need to include the correct module in your build
environment, before building LAMMPS. Or the parallel machine may have a
vendor-provided MPI which the compiler has no trouble finding.
Failing this, these 3 variables can be used to specify where the mpi.h file (MPI_INC)
and the MPI library file (MPI_PATH) are found and the name of the library file
(MPI_LIB).
If you are installing MPI yourself, we recommend Argonne's MPICH2 or OpenMPI.
from the OpenMPI site. Other MPI packages should also work. If you are running on a
big parallel platform, your system people or the vendor should have already installed a
version of MPI, which is likely to be faster than a self-installed MPICH or OpenMPI, so
find out how to build and link with it. If you use MPICH or OpenMPI, you will have to
configure and build it for your platform. The MPI configure script should have
compiler options to enable you to use the same compiler you are using for the
LAMMPS build, which can avoid problems that can arise when linking LAMMPS to the
MPI library.
If you just want to run LAMMPS on a single processor, you can use the dummy MPI
library provided in src/STUBS, since you don't need a true MPI library installed on
your system. See src/MAKE/Makefile.serial for how to specify the 3 MPI variables in
this case. You will also need to build the STUBS library for your platform before
making LAMMPS itself. Note that if you are building with src/MAKE/Makefile.serial,
e.g. by typing "make serial", then the STUBS library is built for you.
To build the STUBS library from the src directory, type "make mpi-stubs", or from the
src/STUBS dir, type "make". This should create a libmpi_stubs.a file suitable for
linking to LAMMPS. If the build fails, you will need to edit the STUBS/Makefile for
The file STUBS/mpi.c provides a CPU timer function called MPI_Wtime() that calls
gettimeofday() . If your system doesn't support gettimeofday() , you'll need to insert
code to call another timer. Note that the ANSI-standard function clock() rolls over
after an hour or so, and is therefore insufficient for timing long LAMMPS simulations.
Step 6

The 3 FFT variables allow you to specify an FFT library which LAMMPS uses (for
performing 1d FFTs) when running the particle-particle particle-mesh (PPPM) option
for long-range Coulombics via the kspace_style command.
LAMMPS supports common open-source or vendor-supplied FFT libraries for this
purpose. If you leave these 3 variables blank, LAMMPS will use the open-source KISS
FFT library, which is included in the LAMMPS distribution. This library is portable to
all platforms and for typical LAMMPS simulations is almost as fast as FFTW or vendor
optimized libraries. If you are not including the KSPACE package in your build, you
20

LAMMPS Users Manual
can also leave the 3 variables blank.
Otherwise, select which kinds of FFTs to use as part of the FFT_INC setting by a
switch of the form -DFFT_XXX. Recommended values for XXX are: MKL or FFTW3.
FFTW2 and NONE are supported as legacy options. Selecting -DFFT_FFTW will use
the FFTW3 library and -DFFT_NONE will use the KISS library described above.
You may also need to set the FFT_INC, FFT_PATH, and FFT_LIB variables, so the
compiler and linker can find the needed FFT header and library files. Note that on
some large parallel machines which use "modules" for their compile/link
environments, you may simply need to include the correct module in your build
environment. Or the parallel machine may have a vendor-provided FFT library which
the compiler has no trouble finding. See the src/MAKE/OPTIONS/Makefile.fftw file for
an example of how to specify these variables to use the FFTW3 library.
FFTW is fast, portable library that should also work on any platform and typically be
faster than KISS FFT. You can download it from www.fftw.org. Both the legacy version
2.1.X and the newer 3.X versions are supported as -DFFT_FFTW2 or -DFFT_FFTW3.
Building FFTW for your box should be as simple as ./configure; make; make install.
The install command typically requires root privileges (e.g. invoke it via sudo), unless
you specify a local directory with the "--prefix" option of configure. Type "./configure
--help" to see various options.
If you wish to have FFTW support for single-precision FFTs (see below about
-DFFT_SINGLE) in addition to the default double-precision FFTs, you will need to
build FFTW a second time for single-precision. For FFTW3, do this via:
make clean
./configure --enable-single; make; make install

which should produce the additional library libfftw3f.a.
For FFTW2, do this:
make clean
./configure --enable-float --enable-type-prefix; make; make install

sfttw.a. Note that on some platforms FFTW2 has been pre-installed for both singleand double-precision, and may already have these files as well as libdfftw.a and
dfftw.h for double precision.
The FFT_INC variable also allows for a -DFFT_SINGLE setting that will use
single-precision FFTs with PPPM, which can speed-up long-range calculations,
particularly in parallel or on GPUs. Fourier transform and related PPPM operations
are somewhat insensitive to floating point truncation errors and thus do not always
need to be performed in double precision. Using the -DFFT_SINGLE setting trades off
a little accuracy for reduced memory use and parallel communication costs for
transposing 3d FFT data. Note that single precision FFTs have only been tested with
the FFTW3, FFTW2, MKL, and KISS FFT options.

21

LAMMPS Users Manual
When using -DFFT_SINGLE with FFTW3 or FFTW2, you need to build FFTW with
support for single-precision, as explained above. For FFTW3 you also need to include
-lfftw3f with the FFT_LIB setting, in addition to -lfftw3. For FFTW2, you also need to
specify -DFFT_SIZE with the FFT_INC setting and -lsfftw with the FFT_LIB setting (in
place of -lfftw). Similarly, if FFTW2 has been pre-installed with an explicit
double-precision library (libdfftw.a and not the default libfftw.a), then you can specify
-DFFT_SIZE (and not -DFFT_SINGLE), and specify -ldfftw to use double-precision
FFTs.
Step 7

The 3 JPG variables allow you to specify a JPEG and/or PNG library which LAMMPS
uses when writing out JPEG or PNG files via the dump image command. These can be
left blank if you do not use the -DLAMMPS_JPEG or -DLAMMPS_PNG switches
discussed above in Step 4, since in that case JPEG/PNG output will be disabled.
A standard JPEG library usually goes by the name libjpeg.a or libjpeg.so and has an
associated header file jpeglib.h. Whichever JPEG library you have on your platform,
you'll need to set the appropriate JPG_INC, JPG_PATH, and JPG_LIB variables, so that
the compiler and linker can find it.
A standard PNG library usually goes by the name libpng.a or libpng.so and has an
associated header file png.h. Whichever PNG library you have on your platform, you'll
need to set the appropriate JPG_INC, JPG_PATH, and JPG_LIB variables, so that the
compiler and linker can find it.
As before, if these header and library files are in the usual place on your machine, you
may not need to set these variables.
Step 8

Note that by default only a few of LAMMPS optional packages are installed. To build
LAMMPS with optional packages, see this section below, before proceeding to Step 9.
Step 9

That's it. Once you have a correct Makefile.foo, and you have pre-built any other
needed libraries (e.g. MPI, FFT, etc) all you need to do from the src directory is type
something like this:
make foo
make -j N foo
gmake foo
gmake -j N foo

The -j or -j N switches perform a parallel build which can be much faster, depending
on how many cores your compilation machine has. N is the number of cores the build
runs on.
You should get the executable lmp_foo when the build is complete.
Errors that can occur when making LAMMPS :h5
22

LAMMPS Users Manual
If an error occurs when building LAMMPS, the compiler or linker will state very
explicitly what the problem is. The error message should give you a hint as to which of
the steps above has failed, and what you need to do in order to fix it. Building a code
with a Makefile is a very logical process. The compiler and linker need to find the
appropriate files and those files need to be compatible with LAMMPS settings and
source files. When a make fails, there is usually a very simple reason, which you or a
local expert will need to fix.
Here are two non-obvious errors that can occur:
(1) If the make command breaks immediately with errors that indicate it can't find
files with a "*" in their names, this can be because your machine's native make doesn't
support wildcard expansion in a makefile. Try gmake instead of make. If that doesn't
work, try using a -f switch with your make command to use a pre-generated
Makefile.list which explicitly lists all the needed files, e.g.
make makelist
make -f Makefile.list linux
gmake -f Makefile.list mac

The first "make" command will create a current Makefile.list with all the file names in
your src dir. The 2nd "make" command (make or gmake) will use it to build LAMMPS.
Note that you should include/exclude any desired optional packages before using the
"make makelist" command.
(2) If you get an error that says something like 'identifier "atoll" is undefined', then
your machine does not support "long long" integers. Try using the
-DLAMMPS_LONGLONG_TO_LONG setting described above in Step 4.
Building LAMMPS for multiple platforms.

You can make LAMMPS for multiple platforms from the same src directory. Each
target creates its own object sub-directory called Obj_target where it stores the
system-specific *.o files.
Cleaning up.

Typing "make clean-all" or "make clean-machine" will delete *.o object files created
when LAMMPS is built, for either all builds or for a particular machine.
Changing the LAMMPS size limits via -DLAMMPS_SMALLBIG or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL

As explained above, any of these 3 settings can be specified on the LMP_INC line in
The default is -DLAMMPS_SMALLBIG which allows for systems with up to 2^63
atoms and 2^63 timesteps (about 9e18). The atom limit is for atomic systems which
do not store bond topology info and thus do not require atom IDs. If you use atom IDs
for atomic systems (which is the default) or if you use a molecular model, which stores
bond topology info and thus requires atom IDs, the limit is 2^31 atoms (about 2
23

LAMMPS Users Manual
billion). This is because the IDs are stored in 32-bit integers.
Likewise, with this setting, the 3 image flags for each atom (see the dump doc page
for a discussion) are stored in a 32-bit integer, which means the atoms can only wrap
around a periodic box (in each dimension) at most 512 times. If atoms move through
the periodic box more than this many times, the image flags will "roll over", e.g. from
511 to -512, which can cause diagnostics like the mean-squared displacement, as
calculated by the compute msd command, to be faulty.
To allow for larger atomic systems with atom IDs or larger molecular systems or
larger image flags, compile with -DLAMMPS_BIGBIG. This stores atom IDs and image
flags in 64-bit integers. This enables atomic or molecular systems with atom IDS of up
to 2^63 atoms (about 9e18). And image flags will not "roll over" until they reach 2^20
= 1048576.
If your system does not support 8-byte integers, you will need to compile with the
-DLAMMPS_SMALLSMALL setting. This will restrict the total number of atoms (for
atomic or molecular systems) and timesteps to 2^31 (about 2 billion). Image flags will
roll over at 2^9 = 512.
Note that in src/lmptype.h there are definitions of all these data types as well as the
MPI data types associated with them. The MPI types need to be consistent with the
associated C data types, or else LAMMPS will generate a run-time error. As far as we
know, the settings defined in src/lmptype.h are portable and work on every current
system.
In all cases, the size of problem that can be run on a per-processor basis is limited by
4-byte integer storage to 2^31 atoms per processor (about 2 billion). This should not
normally be a limitation since such a problem would have a huge per-processor
memory footprint due to neighbor lists and would run very slowly in terms of CPU
secs/timestep.
Building for a Mac

OS X is a derivative of BSD Unix, so it should just work. See the
src/MAKE/MACHINES/Makefile.mac and Makefile.mac_mpi files.
Building for Windows

If you want to build a Windows version of LAMMPS, you can build it yourself, but it
may require some effort. LAMMPS expects a Unix-like build environment for the
default build procedure. This can be done using either Cygwin or MinGW; the latter
also exists as a ready-to-use Linux-to-Windows cross-compiler in several Linux
distributions. In these cases, you can do the installation after installing several
unix-style commands like make, grep, sed and bash with some shell utilities.
For Cygwin and the MinGW cross-compilers, suitable makefiles are provided in
src/MAKE/MACHINES. When using other compilers, like Visual C++ or Intel
compilers for Windows, you may have to implement your own build system. Due to
differences between the Windows OS and Windows system libraries to Unix-like
environments like Linux or MacOS, when compiling for Windows a few adjustments
24

LAMMPS Users Manual
may be needed:
• Do not set the -DLAMMPS_MEMALIGN define (see LMP_INC makefile variable)
• Add -lwsock32 -lpsapi to the linker flags (see LIB makefile variable)
• Try adding -static-libgcc or -static or both to the linker flags when your
LAMMPS executable complains about missing .dll files
Since none of the current LAMMPS core developers has significant experience
building executables on Windows, we are happy to distribute contributed instructions
and modifications to improve the situation, but we cannot provide support for those.
With the so-called "Anniversary Update" to Windows 10, there is a Ubuntu Linux
subsystem available for Windows, that can be installed and then used to
compile/install LAMMPS as if you are running on a Ubuntu Linux system instead of
Windows.
packages.lammps.org/windows.html. These executables are built with most optional
tools and many examples, but no source code.
2.3 Making LAMMPS with optional packages
This section has the following sub-sections:
2.3.1 Package basics
2.3.2 Including/excluding packages
2.3.3 Packages that require extra libraries
Package basics:

The source code for LAMMPS is structured as a set of core files which are always
included, plus optional packages. Packages are groups of files that enable a specific
set of features. For example, force fields for molecular systems or granular systems
are in packages.
Section 4 in the manual has details about all the packages, which come in two flavors:
standard and user packages. It also has specific instructions for building LAMMPS
with any package which requires an extra library. General instructions are below.
You can see the list of all packages by typing "make package" from within the src
directory of the LAMMPS distribution. It will also list various make commands that
can be used to manage packages.
If you use a command in a LAMMPS input script that is part of a package, you must
have built LAMMPS with that package, else you will get an error that the style is
invalid or the command is unknown. Every command's doc page specifies if it is part
of a package. You can type
lmp_machine -h

25

LAMMPS Users Manual
to run your executable with the optional -h command-line switch for "help", which will
list the styles and commands known to your executable, and immediately exit.
Including/excluding packages

To use (or not use) a package you must install it (or un-install it) before building
LAMMPS. From the src directory, this is as simple as:
make yes-colloid
make mpi

or
make no-user-omp
make mpi

NOTE: You should NOT install/un-install packages and build LAMMPS in a single
make command using multiple targets, e.g. make yes-colloid mpi. This is because the
make procedure creates a list of source files that will be out-of-date for the build if the
package configuration changes within the same command.
Any package can be installed or not in a LAMMPS build, independent of all other
packages. However, some packages include files derived from files in other packages.
LAMMPS checks for this and does the right thing. I.e. individual files are only included
if their dependencies are already included. Likewise, if a package is excluded, other
files dependent on that package are also excluded.
NOTE: The one exception is that we do not recommend building with both the
KOKKOS package installed and any of the other acceleration packages (GPU, OPT,
USER-INTEL, USER-OMP) also installed. This is because of how Kokkos sometimes
builds using a wrapper compiler which can make it difficult to invoke all the
compile/link flags correctly for both Kokkos and non-Kokkos files.
If you will never run simulations that use the features in a particular packages, there
is no reason to include it in your build. For some packages, this will keep you from
having to build extra libraries, and will also produce a smaller executable which may
run a bit faster.
When you download a LAMMPS tarball, three packages are pre-installed in the src
directory -- KSPACE, MANYBODY, MOLECULE -- because they are so commonly used.
When you download LAMMPS source files from the SVN or Git repositories, no
packages are pre-installed.
Packages are installed or un-installed by typing
make yes-name
make no-name

where "name" is the name of the package in lower-case, e.g. name = kspace for the
KSPACE package or name = user-atc for the USER-ATC package. You can also type
any of these commands:

26

LAMMPS Users Manual
make yes-all
install all packages
make no-all
un-install all packages
make yes-standard or make yes-std install standard packages
make no-standard or make no-std un-install standard packages
make yes-user
install user packages
make no-user
un-install user packages
make yes-lib
install packages that require extra libraries
make no-lib
un-install packages that require extra libraries
make yes-ext
install packages that require external libraries
make no-ext
un-install packages that require external libraries
which install/un-install various sets of packages. Typing "make package" will list all
the these commands.
NOTE: Installing or un-installing a package works by simply moving files back and
forth between the main src directory and sub-directories with the package name (e.g.
src/KSPACE, src/USER-ATC), so that the files are included or excluded when LAMMPS
is built. After you have installed or un-installed a package, you must re-build LAMMPS
for the action to take effect.
The following make commands help manage files that exist in both the src directory
and in package sub-directories. You do not normally need to use these commands
unless you are editing LAMMPS files or have downloaded a patch from the LAMMPS
web site.
Typing "make package-status" or "make ps" will show which packages are currently
installed. For those that are installed, it will list any files that are different in the src
directory and package sub-directory.
Typing "make package-installed" or "make pi" will list which packages are currently
installed, without listing the status of packages that are not installed.
Typing "make package-update" or "make pu" will overwrite src files with files from the
package sub-directories if the package is installed. It should be used after a patch has
been applied, since patches only update the files in the package sub-directory, but not
the src files.
Typing "make package-overwrite" will overwrite files in the package sub-directories
with src files.
Typing "make package-diff" lists all differences between these files.
Again, just type "make package" to see all of the package-related make options.
Packages that require extra libraries

A few of the standard and user packages require extra libraries. See Section 4 for two
tables of packages which indicate which ones require libraries. For each such
package, the Section 4 doc page gives details on how to build the extra library,
including how to download it if necessary. The basic ideas are summarized here.
27

LAMMPS Users Manual
System libraries:
Packages in the tables Section 4 with a "sys" in the last column link to system libraries
Python library. If your machine does not have the required library, you will have to
Internal libraries:
Packages in the tables Section 4 with an "int" in the last column link to internal
libraries whose source code is included with LAMMPS, in the lib/name directory
where name is the package name. You must first build the library in that directory
before building LAMMPS with that package installed. E.g. the gpu package links to a
library you build in the lib/gpu dir. You can often do the build in one step by typing
"make lib-name args=..." from the src dir, with appropriate arguments. You can leave
off the args to see a help message. See Section 4 for details for each package.
External libraries:
Packages in the tables Section 4 with an "ext" in the last column link to external
libraries whose source code is not included with LAMMPS. You must first download
and install the library before building LAMMPS with that package installed. E.g. the
voronoi package links to the freely available Voro++ library. You can often do the
download/build in one step by typing "make lib-name args=..." from the src dir, with
appropriate arguments. You can leave off the args to see a help message. See Section
4 for details for each package.
Possible errors:
There are various common errors which can occur when building extra libraries or
when building LAMMPS with packages that require the extra libraries.
If you cannot build the extra library itself successfully, you may need to edit or create
an appropriate Makefile for your machine, e.g. with appropriate compiler or system
settings. Provided makefiles are typically in the lib/name directory. E.g. see the
Makefile.* files in lib/gpu.
The LAMMPS build often uses settings in a lib/name/Makefile.lammps file which
either exists in the LAMMPS distribution or is created or copied from a
lib/name/Makefile.lammps.* file when the library is built. If those settings are not
correct for your machine you will need to edit or create an appropriate
Makefile.lammps file.
Package-specific details for these steps are given in Section 4 an in README files in
the lib/name directories.
Compiler options needed for accelerator packages:
Several packages contain code that is optimized for specific hardware, e.g. CPU, KNL,
or GPU. These are the OPT, GPU, KOKKOS, USER-INTEL, and USER-OMP packages.
Compiling and linking the source files in these accelerator packages for optimal
28

LAMMPS Users Manual
performance requires specific settings in the Makefile.machine file you use.
A summary of the Makefile.machine settings needed for each of these packages is
given in Section 4. More info is given on the doc pages that describe each package in
detail:
5.3.1
5.3.2
5.3.3
5.3.4
5.3.5

USER-INTEL package
GPU package
KOKKOS package
USER-OMP package
OPT package

You can also use or examine the following machine Makefiles in src/MAKE/OPTIONS,
which include the settings. Note that the USER-INTEL and KOKKOS packages can use
settings that build LAMMPS for different hardware. The USER-INTEL package can be
compiled for Intel CPUs and KNLs; the KOKKOS package builds for CPUs (OpenMP),
GPUs (CUDA), and Intel KNLs.
• Makefile.intel_cpu
• Makefile.intel_phi
• Makefile.kokkos_omp
• Makefile.kokkos_cuda_mpi
• Makefile.kokkos_phi
• Makefile.omp
• Makefile.opt
2.4 Building LAMMPS as a library
LAMMPS can be built as either a static or shared library, which can then be called
from another application or a scripting language. See this section for more info on
coupling LAMMPS to other codes. See this section for more info on wrapping and
running LAMMPS from Python.
Static library

To build LAMMPS as a static library (*.a file on Linux), type
make foo mode=lib

where foo is the machine name. This kind of library is typically used to statically link a
driver application to LAMMPS, so that you can insure all dependencies are satisfied at
compile time. This will use the ARCHIVE and ARFLAGS settings in
src/MAKE/Makefile.foo. The build will create the file liblammps_foo.a which another
application can link to. It will also create a soft link liblammps.a, which will point to
the most recently built static library.
Shared library

To build LAMMPS as a shared library (*.so file on Linux), which can be dynamically

29

LAMMPS Users Manual
make foo mode=shlib

where foo is the machine name. This kind of library is required when wrapping
LAMMPS with Python; see Section 11 for details. This will use the SHFLAGS and
SHLIBFLAGS settings in src/MAKE/Makefile.foo and perform the build in the
directory Obj_shared_foo. This is so that each file can be compiled with the -fPIC flag
which is required for inclusion in a shared library. The build will create the file
liblammps_foo.so which another application can link to dynamically. It will also create
a soft link liblammps.so, which will point to the most recently built shared library. This
is the file the Python wrapper loads by default.
Note that for a shared library to be usable by a calling program, all the auxiliary
libraries it depends on must also exist as shared libraries. This will be the case for
libraries included with LAMMPS, such as the dummy MPI library in src/STUBS or any
package libraries in lib/packages, since they are always built as shared libraries using
the -fPIC switch. However, if a library like MPI or FFTW does not exist as a shared
library, the shared library build will generate an error. This means you will need to
install a shared library version of the auxiliary library. The build instructions for the
library should tell you how to do this.
Here is an example of such errors when the system FFTW or provided lib/colvars
library have not been built as shared libraries:
/usr/bin/ld: /usr/local/lib/libfftw3.a(mapflags.o): relocation
R_X86_64_32 against '.rodata' can not be used when making a shared
object; recompile with -fPIC
/usr/bin/ld: ../../lib/colvars/libcolvars.a(colvarmodule.o):
relocation R_X86_64_32 against '__pthread_key_create' can not be used
when making a shared object; recompile with -fPIC

As an example, here is how to build and install the MPICH library, a popular
open-source version of MPI, distributed by Argonne National Labs, as a shared library
in the default /usr/local/lib location:
./configure --enable-shared
make
make install

You may need to use "sudo make install" in place of the last line if you do not have
write privileges for /usr/local/lib. The end result should be the file
/usr/local/lib/libmpich.so.
Additional requirement for using a shared library:

The operating system finds shared libraries to load at run-time using the environment
variable LD_LIBRARY_PATH. So you may wish to copy the file src/liblammps.so or
src/liblammps_g++.so (for example) to a place the system can find it by default, such
as /usr/local/lib, or you may wish to add the LAMMPS src directory to
LD_LIBRARY_PATH, so that the current version of the shared library is always
available to programs that use it.
30

LAMMPS Users Manual
For the csh or tcsh shells, you would add something like this to your ~/.cshrc file:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/sjplimp/lammps/src Calling the LAMMPS library Either flavor of library (static or shared) allows one or more LAMMPS objects to be instantiated from the calling program. When used from a C++ program, all of LAMMPS is wrapped in a LAMMPS_NS namespace; you can safely use any of its classes and methods from within the calling code, as needed. When used from a C or Fortran program or a scripting language like Python, the library has a simple function-style interface, provided in src/library.cpp and src/library.h. See the sample codes in examples/COUPLE/simple for examples of C++ and C and Fortran codes that invoke LAMMPS thru its library interface. There are other examples as well in the COUPLE directory which are discussed in Section 6.10 of the manual. See Section 11 of the manual for a description of the Python wrapper provided with LAMMPS that operates through the LAMMPS library interface. The files src/library.cpp and library.h define the C-style API for using LAMMPS as a library. See Section 6.19 of the manual for a description of the interface and how to extend it for your needs. 2.5 Running LAMMPS By default, LAMMPS runs by reading commands from standard input. Thus if you run the LAMMPS executable by itself, e.g. lmp_linux it will simply wait, expecting commands from the keyboard. Typically you should put commands in an input script and use I/O redirection, e.g. lmp_linux Run... , then typing "cmd". • Move to the directory where you have your input, e.g. a copy of the in.lj input from the bench folder. (e.g. by typing: cd "Documents"). • At the command prompt, type "lmp_serial -in in.lj", replacing in.lj with the name of your LAMMPS input script. The serial executable includes support for multi-threading parallelization from the styles in the USER-OMP packages. To run with, e.g. 4 threads, type "lmp_serial -in in.lj -pk omp 4 -sf omp" For the MPI version, which allows you to run LAMMPS under Windows with the more general message passing parallel library (LAMMPS has been designed from ground up to use MPI efficiently), follow these steps: • Download and install a compatible MPI library binary package: for 32-bit Windows mpich2-1.4.1p1-win-ia32.msi and for 64-bit Windows mpich2-1.4.1p1-win-x86-64.msi The LAMMPS Windows installer packages will automatically adjust your path for the default location of this MPI package. After the installation of the MPICH2 software, it needs to be integrated into the system. For this you need to start a Command Prompt in Administrator Mode (right click on the icon and select it). Change into the MPICH2 installation directory, then into the subdirectory bin and execute smpd.exe -install. Exit the command window. • Get a new, regular command prompt by going to Start->Run... , then typing "cmd". • Move to the directory where you have your input file (e.g. by typing: cd "Documents"). Then type something like this: mpiexec -localonly 4 lmp_mpi -in in.lj 32 LAMMPS Users Manual or mpiexec -np 4 lmp_mpi -in in.lj • replacing in.lj with the name of your LAMMPS input script. For the latter case, you may be prompted to enter your password. • In this mode, output may not immediately show up on the screen, so if your input script takes a long time to execute, you may need to be patient before the output shows up. The parallel executable can also run on a single processor by typing something like: lmp_mpi -in in.lj And the parallel executable also includes OpenMP multi-threading, which can be combined with MPI using something like: mpiexec -localonly 2 lmp_mpi -in in.lj -pk omp 2 -sf omp The screen output from LAMMPS is described in a section below. As it runs, LAMMPS also writes a log.lammps file with the same information. Note that this sequence of commands copies the LAMMPS executable (lmp_linux) to the directory with the input files. This may not be necessary, but some versions of MPI reset the working directory to where the executable is, rather than leave it as the directory where you launch mpirun from (if you launch lmp_linux on its own and not under mpirun). If that happens, LAMMPS will look for additional input files and write its output files to the executable directory, rather than your working directory, which is probably not what you want. If LAMMPS encounters errors in the input script or while running a simulation it will print an ERROR message and stop or a WARNING message and continue. See Section 12 for a discussion of the various kinds of errors LAMMPS can or can't detect, a list of all ERROR and WARNING messages, and what to do about them. LAMMPS can run a problem on any number of processors, including a single processor. In theory you should get identical answers on any number of processors and on any machine. In practice, numerical round-off can cause slight differences and eventual divergence of molecular dynamics phase space trajectories. LAMMPS can run as large a problem as will fit in the physical memory of one or more processors. If you run out of memory, you must run on more processors or setup a smaller problem. 2.6 Command-line options At run time, LAMMPS recognizes several optional command-line switches which may be used in any order. Either the full word or a one-or-two letter abbreviation can be used: • -e or -echo 33 LAMMPS Users Manual • -h or -help • -i or -in • -k or -kokkos • -l or -log • -nc or -nocite • -pk or -package • -p or -partition • -pl or -plog • -ps or -pscreen • -r or -restart • -ro or -reorder • -sc or -screen • -sf or -suffix • -v or -var For example, lmp_ibm might be launched as follows: mpirun -np 16 lmp_ibm -v f tmp.out -l my.log -sc none -in in.alloy mpirun -np 16 lmp_ibm -var f tmp.out -log my.log -screen none -in in.alloy Here are the details on the options: -echo style Set the style of command echoing. The style can be none or screen or log or both. Depending on the style, each command read from the input script will be echoed to the screen and/or logfile. This can be useful to figure out which line of your script is causing an input error. The default value is log. The echo style can also be set by using the echo command in the input script itself. -help Print a brief help summary and a list of options compiled into this executable for each LAMMPS style (atom_style, fix, compute, pair_style, bond_style, etc). This can tell you if the command you want to use was included via the appropriate package at compile time. LAMMPS will print the info and immediately exit if this switch is used. -in file Specify a file to use as an input script. This is an optional switch when running LAMMPS in one-partition mode. If it is not specified, LAMMPS reads its script from standard input, typically from a script via I/O redirection; e.g. lmp_linux < in.run. I/O redirection should also work in parallel, but if it does not (in the unlikely case that an MPI implementation does not support it), then use the -in flag. Note that this is a required switch when running LAMMPS in multi-partition mode, since multiple processors cannot all read from stdin. -kokkos on/off keyword/value ... Explicitly enable or disable KOKKOS support, as provided by the KOKKOS package. Even if LAMMPS is built with this package, as described above in Section 2.3, this switch must be set to enable running with the KOKKOS-enabled styles the package 34 LAMMPS Users Manual provides. If the switch is not set (the default), LAMMPS will operate as if the KOKKOS package were not installed; i.e. you can run standard LAMMPS or with the GPU or USER-OMP packages, for testing or benchmarking purposes. Additional optional keyword/value pairs can be specified which determine how Kokkos will use the underlying hardware on your platform. These settings apply to each MPI task you launch via the "mpirun" or "mpiexec" command. You may choose to run one or more MPI tasks per physical node. Note that if you are running on a desktop machine, you typically have one physical node. On a cluster or supercomputer there may be dozens or 1000s of physical nodes. Either the full word or an abbreviation can be used for the keywords. Note that the keywords do not use a leading minus sign. I.e. the keyword is "t", not "-t". Also note that each of the keywords has a default setting. Example of when to use these options and what settings to use on different platforms is given in Section 5.3. • d or device • g or gpus • t or threads • n or numa device Nd This option is only relevant if you built LAMMPS with CUDA=yes, you have more than one GPU per node, and if you are running with only one MPI task per node. The Nd setting is the ID of the GPU on the node to run on. By default Nd = 0. If you have multiple GPUs per node, they have consecutive IDs numbered as 0,1,2,etc. This setting allows you to launch multiple independent jobs on the node, each with a single MPI task per node, and assign each job to run on a different GPU. gpus Ng Ns This option is only relevant if you built LAMMPS with CUDA=yes, you have more than one GPU per node, and you are running with multiple MPI tasks per node (up to one per GPU). The Ng setting is how many GPUs you will use. The Ns setting is optional. If set, it is the ID of a GPU to skip when assigning MPI tasks to GPUs. This may be useful if your desktop system reserves one GPU to drive the screen and the rest are intended for computational work like running LAMMPS. By default Ng = 1 and Ns is not set. Depending on which flavor of MPI you are running, LAMMPS will look for one of these 3 environment variables SLURM_LOCALID (various MPI variants compiled with SLURM support) MV2_COMM_WORLD_LOCAL_RANK (Mvapich) OMPI_COMM_WORLD_LOCAL_RANK (OpenMPI) which are initialized by the "srun", "mpirun" or "mpiexec" commands. The environment variable setting for each MPI rank is used to assign a unique GPU ID to the MPI task. threads Nt 35 LAMMPS Users Manual This option assigns Nt number of threads to each MPI task for performing work when Kokkos is executing in OpenMP or pthreads mode. The default is Nt = 1, which essentially runs in MPI-only mode. If there are Np MPI tasks per physical node, you generally want Np*Nt = the number of physical cores per node, to use your available hardware optimally. This also sets the number of threads used by the host when LAMMPS is compiled with CUDA=yes. numa Nm This option is only relevant when using pthreads with hwloc support. In this case Nm defines the number of NUMA regions (typically sockets) on a node which will be utilized by a single MPI rank. By default Nm = 1. If this option is used the total number of worker-threads per MPI rank is threads*numa. Currently it is always almost better to assign at least one MPI rank per NUMA region, and leave numa set to its default value of 1. This is because letting a single process span multiple NUMA regions induces a significant amount of cross NUMA data traffic which is slow. -log file Specify a log file for LAMMPS to write status information to. In one-partition mode, if the switch is not used, LAMMPS writes to the file log.lammps. If this switch is used, LAMMPS writes to the specified file. In multi-partition mode, if the switch is not used, a log.lammps file is created with hi-level status information. Each partition also writes to a log.lammps.N file where N is the partition ID. If the switch is specified in multi-partition mode, the hi-level logfile is named "file" and each partition also logs information to a file.N. For both one-partition and multi-partition mode, if the specified file is "none", then no log files are created. Using a log command in the input script will override this setting. Option -plog will override the name of the partition log files file.N. -nocite Disable writing the log.cite file which is normally written to list references for specific cite-able features used during a LAMMPS run. See the citation page for more details. -package style args .... Invoke the package command with style and args. The syntax is the same as if the command appeared at the top of the input script. For example "-package gpu 2" or "-pk gpu 2" is the same as package gpu 2 in the input script. The possible styles and args are documented on the package doc page. This switch can be used multiple times, e.g. to set options for the USER-INTEL and USER-OMP packages which can be used together. Along with the "-suffix" command-line switch, this is a convenient mechanism for invoking accelerator packages and their options without having to edit an input script. -partition 8x2 4 5 ... Invoke LAMMPS in multi-partition mode. When LAMMPS is run on P processors and this switch is not used, LAMMPS runs in one partition, i.e. all P processors run a single simulation. If this switch is used, the P processors are split into separate 36 LAMMPS Users Manual partitions and each partition runs its own simulation. The arguments to the switch specify the number of processors in each partition. Arguments of the form MxN mean M partitions, each with N processors. Arguments of the form N mean a single partition with N processors. The sum of processors in all partitions must equal P. Thus the command "-partition 8x2 4 5" has 10 partitions and runs on a total of 25 processors. Running with multiple partitions can e useful for running multi-replica simulations, where each replica runs on on one or a few processors. Note that with MPI installed on a machine (e.g. your desktop), you can run on more (virtual) processors than you have physical processors. To run multiple independent simulations from one input script, using multiple partitions, see Section 6.4 of the manual. World- and universe-style variables are useful in this context. -plog file Specify the base name for the partition log files, so partition N writes log information to file.N. If file is none, then no partition log files are created. This overrides the filename specified in the -log command-line option. This option is useful when working with large numbers of partitions, allowing the partition log files to be suppressed (-plog none) or placed in a sub-directory (-plog replica_files/log.lammps) If this option is not used the log file for partition N is log.lammps.N or whatever is specified by the -log command-line option. -pscreen file Specify the base name for the partition screen file, so partition N writes screen information to file.N. If file is none, then no partition screen files are created. This overrides the filename specified in the -screen command-line option. This option is useful when working with large numbers of partitions, allowing the partition screen files to be suppressed (-pscreen none) or placed in a sub-directory (-pscreen replica_files/screen). If this option is not used the screen file for partition N is screen.N or whatever is specified by the -screen command-line option. -restart restartfile remap datafile keyword value ... Convert the restart file into a data file and immediately exit. This is the same operation as if the following 2-line input script were run: read_restart restartfile remap write_data datafile keyword value ... Note that the specified restartfile and datafile can have wild-card characters ("*",%") as described by the read_restart and write_data commands. But a filename such as file.* will need to be enclosed in quotes to avoid shell expansion of the "*" character. Note that following restartfile, the optional flag remap can be used. This has the same effect as adding it to the read_restart command, as explained on its doc page. This is only useful if the reading of the restart file triggers an error that atoms have been lost. In that case, use of the remap flag should allow the data file to still be produced. 37 LAMMPS Users Manual Also note that following datafile, the same optional keyword/value pairs can be listed as used by the write_data command. -reorder nth N -reorder custom filename Reorder the processors in the MPI communicator used to instantiate LAMMPS, in one of several ways. The original MPI communicator ranks all P processors from 0 to P-1. The mapping of these ranks to physical processors is done by MPI before LAMMPS begins. It may be useful in some cases to alter the rank order. E.g. to insure that cores within each node are ranked in a desired order. Or when using the run_style verlet/split command with 2 partitions to insure that a specific Kspace processor (in the 2nd partition) is matched up with a specific set of processors in the 1st partition. See the Section 5 doc pages for more details. If the keyword nth is used with a setting N, then it means every Nth processor will be moved to the end of the ranking. This is useful when using the run_style verlet/split command with 2 partitions via the -partition command-line switch. The first set of processors will be in the first partition, the 2nd set in the 2nd partition. The -reorder command-line switch can alter this so that the 1st N procs in the 1st partition and one proc in the 2nd partition will be ordered consecutively, e.g. as the cores on one physical node. This can boost performance. For example, if you use "-reorder nth 4" and "-partition 9 3" and you are running on 12 processors, the processors will be reordered from 0 1 2 3 4 5 6 7 8 9 10 11 to 0 1 2 4 5 6 8 9 10 3 7 11 so that the processors in each partition will be 0 1 2 4 5 6 8 9 10 3 7 11 See the "processors" command for how to insure processors from each partition could then be grouped optimally for quad-core nodes. If the keyword is custom, then a file that specifies a permutation of the processor ranks is also specified. The format of the reorder file is as follows. Any number of initial blank or comment lines (starting with a "#" character) can be present. These should be followed by P lines of the form: I J where P is the number of processors LAMMPS was launched with. Note that if running in multi-partition mode (see the -partition switch above) P is the total number of processors in all partitions. The I and J values describe a permutation of the P processors. Every I and J should be values from 0 to P-1 inclusive. In the set of P I values, every proc ID should appear exactly once. Ditto for the set of P J values. A single I,J pairing means that the physical processor with rank I in the original MPI 38 LAMMPS Users Manual communicator will have rank J in the reordered communicator. Note that rank ordering can also be specified by many MPI implementations, either by environment variables that specify how to order physical processors, or by config files that specify what physical processors to assign to each MPI rank. The -reorder switch simply gives you a portable way to do this without relying on MPI itself. See the processors out command for how to output info on the final assignment of physical processors to the LAMMPS simulation domain. -screen file Specify a file for LAMMPS to write its screen information to. In one-partition mode, if the switch is not used, LAMMPS writes to the screen. If this switch is used, LAMMPS writes to the specified file instead and you will see no screen output. In multi-partition mode, if the switch is not used, hi-level status information is written to the screen. Each partition also writes to a screen.N file where N is the partition ID. If the switch is specified in multi-partition mode, the hi-level screen dump is named "file" and each partition also writes screen information to a file.N. For both one-partition and multi-partition mode, if the specified file is "none", then no screen output is performed. Option -pscreen will override the name of the partition screen files file.N. -suffix style args Use variants of various styles if they exist. The specified style can be cuda, gpu, intel, kk, omp, opt, or hybrid. These refer to optional packages that LAMMPS can be built with, as described above in Section 2.3. The "gpu" style corresponds to the GPU package, the "intel" style to the USER-INTEL package, the "kk" style to the KOKKOS package, the "opt" style to the OPT package, and the "omp" style to the USER-OMP package. The hybrid style is the only style that accepts arguments. It allows for two packages to be specified. The first package specified is the default and will be used if it is available. If no style is available for the first package, the style for the second package will be used if available. For example, "-suffix hybrid intel omp" will use styles from the USER-INTEL package if they are installed and available, but styles for the USER-OMP package otherwise. Along with the "-package" command-line switch, this is a convenient mechanism for invoking accelerator packages and their options without having to edit an input script. As an example, all of the packages provide a pair_style lj/cut variant, with style names lj/cut/gpu, lj/cut/intel, lj/cut/kk, lj/cut/omp, and lj/cut/opt. A variant style can be specified explicitly in your input script, e.g. pair_style lj/cut/gpu. If the -suffix switch is used the specified suffix (gpu,intel,kk,omp,opt) is automatically appended whenever your input script command creates a new atom, pair, fix, compute, or run style. If the variant version does not exist, the standard version is created. For the GPU package, using this command-line switch also invokes the default GPU settings, as if the command "package gpu 1" were used at the top of your input script. These settings can be changed by using the "-package gpu" command-line switch or the package gpu command in your script. 39 LAMMPS Users Manual For the USER-INTEL package, using this command-line switch also invokes the default USER-INTEL settings, as if the command "package intel 1" were used at the top of your input script. These settings can be changed by using the "-package intel" command-line switch or the package intel command in your script. If the USER-OMP package is also installed, the hybrid style with "intel omp" arguments can be used to make the omp suffix a second choice, if a requested style is not available in the USER-INTEL package. It will also invoke the default USER-OMP settings, as if the command "package omp 0" were used at the top of your input script. These settings can be changed by using the "-package omp" command-line switch or the package omp command in your script. For the KOKKOS package, using this command-line switch also invokes the default KOKKOS settings, as if the command "package kokkos" were used at the top of your input script. These settings can be changed by using the "-package kokkos" command-line switch or the package kokkos command in your script. For the OMP package, using this command-line switch also invokes the default OMP settings, as if the command "package omp 0" were used at the top of your input script. These settings can be changed by using the "-package omp" command-line switch or the package omp command in your script. The suffix command can also be used within an input script to set a suffix, or to turn off or back on any suffix setting made via the command line. -var name value1 value2 ... Specify a variable that will be defined for substitution purposes when the input script is read. This switch can be used multiple times to define multiple variables. "Name" is the variable name which can be a single character (referenced as$x in the input
script) or a full string (referenced as ${abc}). An index-style variable will be created and populated with the subsequent values, e.g. a set of filenames. Using this command-line option is equivalent to putting the line "variable name index value1 value2 ..." at the beginning of the input script. Defining an index variable as a command-line argument overrides any setting for the same index variable in the input script, since index variables cannot be re-defined. See the variable command for more info on defining index and other kinds of variables and this section for more info on using variables in input scripts. NOTE: Currently, the command-line parser looks for arguments that start with "-" to indicate new switches. Thus you cannot specify multiple variable values if any of they start with a "-", e.g. a negative numeric value. It is OK if the first value1 starts with a "-", since it is automatically skipped. 2.7 LAMMPS screen output As LAMMPS reads an input script, it prints information to both the screen and a log file about significant actions it takes to setup a simulation. When the simulation is ready to begin, LAMMPS performs various initializations and prints the amount of memory (in MBytes per processor) that the simulation requires. It also prints details of the initial thermodynamic state of the system. During the run itself, thermodynamic information is printed periodically, every few timesteps. When the run concludes, 40 LAMMPS Users Manual LAMMPS prints the final thermodynamic state and a total run time for the simulation. It then appends statistics about the CPU time and storage requirements for the simulation. An example set of statistics is shown here: Loop time of 2.81192 on 4 procs for 300 steps with 2004 atoms Performance: 18.436 ns/day 1.302 hours/ns 106.689 timesteps/s 97.0% CPU use with 4 MPI tasks x no OpenMP threads MPI task timings breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------Pair | 1.9808 | 2.0134 | 2.0318 | 1.4 | 71.60 Bond | 0.0021894 | 0.0060319 | 0.010058 | 4.7 | 0.21 Kspace | 0.3207 | 0.3366 | 0.36616 | 3.1 | 11.97 Neigh | 0.28411 | 0.28464 | 0.28516 | 0.1 | 10.12 Comm | 0.075732 | 0.077018 | 0.07883 | 0.4 | 2.74 Output | 0.00030518 | 0.00042665 | 0.00078821 | 1.0 | 0.02 Modify | 0.086606 | 0.086631 | 0.086668 | 0.0 | 3.08 Other | | 0.007178 | | | 0.26 Nlocal: Histogram: Nghost: Histogram: Neighs: Histogram: 501 ave 508 max 490 min 1 0 0 0 0 0 1 1 0 1 6586.25 ave 6628 max 6548 min 1 0 1 0 0 0 1 0 0 1 177007 ave 180562 max 170212 min 1 0 0 0 0 0 0 1 1 1 Total # of neighbors = 708028 Ave neighs/atom = 353.307 Ave special neighs/atom = 2.34032 Neighbor list builds = 26 Dangerous builds = 0 The first section provides a global loop timing summary. The loop time is the total wall time for the section. The Performance line is provided for convenience to help predicting the number of loop continuations required and for comparing performance with other, similar MD codes. The CPU use line provides the CPU utilization per MPI task; it should be close to 100% times the number of OpenMP threads (or 1 of no OpenMP). Lower numbers correspond to delays due to file I/O or insufficient thread utilization. The MPI task section gives the breakdown of the CPU run time (in seconds) into major categories: • Pair stands for all non-bonded force computation • Bond stands for bonded interactions: bonds, angles, dihedrals, impropers • Kspace stands for reciprocal space interactions: Ewald, PPPM, MSM • Neigh stands for neighbor list construction • Comm stands for communicating atoms and their properties • Output stands for writing dumps and thermo output • Modify stands for fixes and computes called by them • Other is the remaining time 41 LAMMPS Users Manual For each category, there is a breakdown of the least, average and most amount of wall time a processor spent on this section. Also you have the variation from the average time. Together these numbers allow to gauge the amount of load imbalance in this segment of the calculation. Ideally the difference between minimum, maximum and average is small and thus the variation from the average close to zero. The final column shows the percentage of the total loop time is spent in this section. When using the timer full setting, an additional column is present that also prints the CPU utilization in percent. In addition, when using timer full and the package omp command are active, a similar timing summary of time spent in threaded regions to monitor thread utilization and load balance is provided. A new entry is the Reduce section, which lists the time spent in reducing the per-thread data elements to the storage for non-threaded computation. These thread timings are taking from the first MPI rank only and and thus, as the breakdown for MPI tasks can change from MPI rank to MPI rank, this breakdown can be very different for individual ranks. Here is an example output for this section: Thread timings breakdown (MPI rank 0): Total threaded time 0.6846 / 90.6% Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------Pair | 0.5127 | 0.5147 | 0.5167 | 0.3 | 75.18 Bond | 0.0043139 | 0.0046779 | 0.0050418 | 0.5 | 0.68 Kspace | 0.070572 | 0.074541 | 0.07851 | 1.5 | 10.89 Neigh | 0.084778 | 0.086969 | 0.089161 | 0.7 | 12.70 Reduce | 0.0036485 | 0.003737 | 0.0038254 | 0.1 | 0.55 The third section lists the number of owned atoms (Nlocal), ghost atoms (Nghost), and pair-wise neighbors stored per processor. The max and min values give the spread of these values across processors with a 10-bin histogram showing the distribution. The total number of histogram counts is equal to the number of processors. The last section gives aggregate statistics for pair-wise neighbors and special neighbors that LAMMPS keeps track of (see the special_bonds command). The number of times neighbor lists were rebuilt during the run is given as well as the number of potentially "dangerous" rebuilds. If atom movement triggered neighbor list rebuilding (see the neigh_modify command), then dangerous reneighborings are those that were triggered on the first timestep atom movement was checked for. If this count is non-zero you may wish to reduce the delay factor to insure no force interactions are missed by atoms moving beyond the neighbor skin distance before a rebuild takes place. If an energy minimization was performed via the minimize command, additional information is printed, e.g. Minimization stats: Stopping criterion = linesearch alpha is zero Energy initial, next-to-last, final = -6372.3765206 -8328.46998942 -8328.46998942 Force two-norm initial, final = 1059.36 5.36874 Force max component initial, final = 58.6026 1.46872 Final line search alpha, max atom move = 2.7842e-10 4.0892e-10 Iterations, force evaluations = 701 1516 42 LAMMPS Users Manual The first line prints the criterion that determined the minimization to be completed. The third line lists the initial and final energy, as well as the energy on the next-to-last iteration. The next 2 lines give a measure of the gradient of the energy (force on all atoms). The 2-norm is the "length" of this force vector; the inf-norm is the largest component. Then some information about the line search and statistics on how many iterations and force-evaluations the minimizer required. Multiple force evaluations are typically done at each iteration to perform a 1d line minimization in the search direction. If a kspace_style long-range Coulombics solve was performed during the run (PPPM, Ewald), then additional information is printed, e.g. FFT time (% of Kspce) = 0.200313 (8.34477) FFT Gflps 3d 1d-only = 2.31074 9.19989 The first line gives the time spent doing 3d FFTs (4 per timestep) and the fraction it represents of the total KSpace time (listed above). Each 3d FFT requires computation (3 sets of 1d FFTs) and communication (transposes). The total flops performed is 5Nlog_2(N), where N is the number of points in the 3d grid. The FFTs are timed with and without the communication and a Gflop rate is computed. The 3d rate is with communication; the 1d rate is without (just the 1d FFTs). Thus you can estimate what fraction of your FFT time was spent in communication, roughly 75% in the example above. 2.8 Tips for users of previous LAMMPS versions The current C++ began with a complete rewrite of LAMMPS 2001, which was written in F90. Features of earlier versions of LAMMPS are listed in Section 13. The F90 and F77 versions (2001 and 99) are also freely distributed as open-source codes; check the LAMMPS WWW Site for distribution information if you prefer those versions. The 99 and 2001 versions are no longer under active development; they do not have all the features of C++ LAMMPS. If you are a previous user of LAMMPS 2001, these are the most significant changes you will notice in C++ LAMMPS: (1) The names and arguments of many input script commands have changed. All commands are now a single word (e.g. read_data instead of read data). (2) All the functionality of LAMMPS 2001 is included in C++ LAMMPS, but you may need to specify the relevant commands in different ways. (3) The format of the data file can be streamlined for some problems. See the read_data command for details. The data file section "Nonbond Coeff" has been renamed to "Pair Coeff" in C++ LAMMPS. (4) Binary restart files written by LAMMPS 2001 cannot be read by C++ LAMMPS with a read_restart command. This is because they were output by F90 which writes in a different binary format than C or C++ writes or reads. Use the restart2data tool provided with LAMMPS 2001 to convert the 2001 restart file to a text data file. Then edit the data file as necessary before using the C++ LAMMPS read_data command to 43 LAMMPS Users Manual read it in. (5) There are numerous small numerical changes in C++ LAMMPS that mean you will not get identical answers when comparing to a 2001 run. However, your initial thermodynamic energy and MD trajectory should be close if you have setup the problem for both codes the same. 44 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 3. Commands This section describes how a LAMMPS input script is formatted and the input script commands used to define a LAMMPS simulation. 3.1 3.2 3.3 3.4 3.5 LAMMPS input script Parsing rules Input script structure Commands listed by category Commands listed alphabetically 3.1 LAMMPS input script LAMMPS executes by reading commands from a input script (text file), one line at a time. When the input script ends, LAMMPS exits. Each command causes LAMMPS to take some action. It may set an internal variable, read in a file, or run a simulation. Most commands have default settings, which means you only need to use the command if you wish to change the default. In many cases, the ordering of commands in an input script is not important. However the following rules apply: (1) LAMMPS does not read your entire input script and then perform a simulation with all the settings. Rather, the input script is read one line at a time and each command takes effect when it is read. Thus this sequence of commands: timestep 0.5 run 100 run 100 does something different than this sequence: run 100 timestep 0.5 run 100 In the first case, the specified timestep (0.5 fmsec) is used for two simulations of 100 timesteps each. In the 2nd case, the default timestep (1.0 fmsec) is used for the 1st 100 step simulation and a 0.5 fmsec timestep is used for the 2nd one. (2) Some commands are only valid when they follow other commands. For example you cannot set the temperature of a group of atoms until atoms have been defined and a group command is used to define which atoms belong to the group. (3) Sometimes command B will use values that can be set by command A. This means command A must precede command B in the input script if it is to have the desired 45 LAMMPS Users Manual effect. For example, the read_data command initializes the system by setting up the simulation box and assigning atoms to processors. If default values are not desired, the processors and boundary commands need to be used before read_data to tell LAMMPS how to map processors to the simulation box. Many input script errors are detected by LAMMPS and an ERROR or WARNING message is printed. This section gives more information on what errors mean. The documentation for each command lists restrictions on how the command can be used. 3.2 Parsing rules Each non-blank line in the input script is treated as a command. LAMMPS commands are case sensitive. Command names are lower-case, as are specified command arguments. Upper case letters may be used in file names or user-chosen ID strings. Here is how each line in the input script is parsed by LAMMPS: (1) If the last printable character on the line is a "&" character, the command is assumed to continue on the next line. The next line is concatenated to the previous line by removing the "&" character and line break. This allows long commands to be continued across two or more lines. See the discussion of triple quotes in (6) for how to continue a command across multiple line without using "&" characters. (2) All characters from the first "#" character onward are treated as comment and discarded. See an exception in (6). Note that a comment after a trailing "&" character will prevent the command from continuing on the next line. Also note that for multi-line commands a single leading "#" will comment out the entire command. (3) The line is searched repeatedly for$ characters, which indicate variables that are
replaced with a text string. See an exception in (6).
If the $is followed by curly brackets, then the variable name is the text inside the curly brackets. If no curly brackets follow the$, then the variable name is the single
character immediately following the $. Thus${myTemp} and $x refer to variable names "myTemp" and "x". How the variable is converted to a text string depends on what style of variable it is; see the variable doc page for details. It can be a variable that stores multiple text strings, and return one of them. The returned text string can be multiple "words" (space separated) which will then be interpreted as multiple arguments in the input command. The variable can also store a numeric formula which will be evaluated and its numeric result returned as a string. As a special case, if the$ is followed by parenthesis, then the text inside the
parenthesis is treated as an "immediate" variable and evaluated as an equal-style
variable. This is a way to use numeric formulas in an input script without having to
assign them to variable names. For example, these 3 input script lines:
variable X equal (xlo+xhi)/2+sqrt(v_area)
region 1 block $X 2 INF INF EDGE EDGE 46 LAMMPS Users Manual variable X delete can be replaced by region 1 block$((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE

so that you do not have to define (or discard) a temporary variable X.
Note that neither the curly-bracket or immediate form of variables can contain nested
$characters for other variables to substitute for. Thus you cannot do this: variable variable print a equal 2 b2 equal 4 "B2 =${b$a}" Nor can you specify this$($x-1.0) for an immediate variable, but you could use$(v_x-1.0), since the latter is valid syntax for an equal-style variable.
See the variable command for more details of how strings are assigned to variables
and evaluated, and how they can be used in input script commands.
(4) The line is broken into "words" separated by whitespace (tabs, spaces). Note that
words can thus contain letters, digits, underscores, or punctuation characters.
(5) The first word is the command name. All successive words in the line are
arguments.
(6) If you want text with spaces to be treated as a single argument, it can be enclosed
in either single or double or triple quotes. A long single argument enclosed in single
or double quotes can span multiple lines if the "&" character is used, as described
above. When the lines are concatenated together (and the "&" characters and line
breaks removed), the text will become a single line. If you want multiple lines of an
argument to retain their line breaks, the text can be enclosed in triple quotes, in
which case "&" characters are not needed. For example:
print "Volume = $v" print 'Volume =$v'
if "${steps} > 1000" then quit variable a string "red green blue & purple orange cyan" print """ System volume =$v
System temperature = $t """ In each case, the single, double, or triple quotes are removed when the single argument they enclose is stored internally. See the dump modify format, print, if, and python commands for examples. A "#" or "$" character that is between quotes will not be treated as a comment
indicator in (2) or substituted for as a variable in (3).

47

LAMMPS Users Manual
NOTE: If the argument is itself a command that requires a quoted argument (e.g.
using a print command as part of an if or run every command), then single, double, or
triple quotes can be nested in the usual manner. See the doc pages for those
commands for examples. Only one of level of nesting is allowed, but that should be
sufficient for most use cases.
3.3 Input script structure
This section describes the structure of a typical LAMMPS input script. The "examples"
directory in the LAMMPS distribution contains many sample input scripts; the
corresponding problems are discussed in Section 7, and animated on the LAMMPS
WWW Site.
A LAMMPS input script typically has 4 parts:
1.
2.
3.
4.

Initialization
Atom definition
Settings
Run a simulation

The last 2 parts can be repeated as many times as desired. I.e. run a simulation,
change some settings, run some more, etc. Each of the 4 parts is now described in
more detail. Remember that almost all the commands need only be used if a
non-default value is desired.
(1) Initialization
Set parameters that need to be defined before atoms are created or read-in from a
file.
The relevant commands are units, dimension, newton, processors, boundary,
atom_style, atom_modify.
If force-field parameters appear in the files that will be read, these commands tell
LAMMPS what kinds of force fields are being used: pair_style, bond_style, angle_style,
dihedral_style, improper_style.
(2) Atom definition
There are 3 ways to define atoms in LAMMPS. Read them in from a data or restart file
topology information. Or create atoms on a lattice (with no molecular topology), using
these commands: lattice, region, create_box, create_atoms. The entire set of atoms
can be duplicated to make a larger simulation using the replicate command.
(3) Settings
Once atoms and molecular topology are defined, a variety of settings can be specified:
force field coefficients, simulation parameters, output options, etc.

48

LAMMPS Users Manual
Force field coefficients are set by these commands (they can also be set in the read-in
files): pair_coeff, bond_coeff, angle_coeff, dihedral_coeff, improper_coeff,
kspace_style, dielectric, special_bonds.
Various simulation parameters are set by these commands: neighbor, neigh_modify,
group, timestep, reset_timestep, run_style, min_style, min_modify.
Fixes impose a variety of boundary conditions, time integration, and diagnostic
options. The fix command comes in many flavors.
Various computations can be specified for execution during a simulation using the
compute, compute_modify, and variable commands.
Output options are set by the thermo, dump, and restart commands.
(4) Run a simulation
A molecular dynamics simulation is run using the run command. Energy minimization
(molecular statics) is performed using the minimize command. A parallel tempering
(replica-exchange) simulation can be run using the temper command.

3.4 Commands listed by category
This section lists core LAMMPS commands, grouped by category. The next section
lists all commands alphabetically. The next section also includes (long) lists of style
options for entries that appear in the following categories as a single command (fix,
compute, pair, etc). Commands that are added by user packages are not included in
the categories here, but they are in the next section.
Initialization:
newton, package, processors, suffix, units
Setup simulation box:
boundary, box, change_box, create_box, dimension, lattice, region
Setup atoms:
atom_modify, atom_style, balance, create_atoms, create_bonds, delete_atoms,
Force fields:
angle_coeff, angle_style, bond_coeff, bond_style, bond_write, dielectric, dihedral_coeff,
dihedral_style, improper_coeff, improper_style, kspace_modify, kspace_style,
pair_coeff, pair_modify, pair_style, pair_write, special_bonds
Settings:
49

LAMMPS Users Manual
comm_modify, comm_style, info, min_modify, min_style, neigh_modify, neighbor,
partition, reset_timestep, run_style, timer, timestep
Operations within timestepping (fixes) and diagnostics (computes):
compute, compute_modify, fix, fix_modify, uncompute, unfix
Output:
dump image, dump movie, dump, dump_modify, restart, thermo, thermo_modify,
thermo_style, undump, write_coeff, write_data, write_dump, write_restart
Actions:
minimize, neb, prd, rerun, run, tad, temper
Input script control:
clear, echo, if, include, jump, label, log, next, print, python, quit, shell, variable
3.5 Individual commands
This section lists all LAMMPS commands alphabetically, with a separate listing below
of styles within certain commands. The previous section lists the same commands,
grouped by category. Note that some style options for some commands are part of
specific LAMMPS packages, which means they cannot be used unless the package was
included when LAMMPS was built. Not all packages are included in a default
LAMMPS build. These dependencies are listed as Restrictions in the command's
documentation.
angle_coeff
angle_style atom_modify
atom_style
balance
bond_coeff
bond_style
bond_write
boundary
box
change_box
clear
comm_modify
comm_style
compute compute_modify create_atoms create_bonds
create_box
delete_atoms delete_bonds
dielectric
dihedral_coeff dihedral_style
dimension
displace_atoms
dump
dump image
dump_modify dump movie
echo
fix
fix_modify
group
if
info
improper_coeff improper_style
include
jump
kspace_modify kspace_style
label
lattice
log
mass
minimize
min_modify
min_style
molecule
neb
neigh_modify
neighbor
newton
next
package
pair_coeff
pair_modify
pair_style
pair_write
partition
prd
print
processors
python
quit
region
replicate
rerun
reset_timestep
restart
run
run_style
set
shell
special_bonds
suffix
temper
thermo
thermo_modify
thermo_style
timer
timestep
uncompute
undump
unfix
units
variable
velocity
write_coeff
write_data
write_dump
write_restart
50

LAMMPS Users Manual
These are additional commands in USER packages, which can be used if LAMMPS is
built with the appropriate package.
dump netcdf dump netcdf/mpiio dump vtk
group2ndx
ndx2group
temper/grem
temper/npt
Fix styles
See the fix command for one-line descriptions of each style or click on the style itself
for a full description. Some of the styles have accelerated versions, which can be used
if LAMMPS is built with the appropriate accelerated package. This is indicated by
additional letters in parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o =
USER-OMP, t = OPT.

o

d

re

append/atoms atom/swap
ave/histo/weight
ave/time
balance
controller
deform (k)
deposit
evaporate
external
freeze
indent
latte
langevin (k)
neb

nph (ko)

nphug (o)

npt/body

npt/sphere (o)

nve (kio)

nve/noforce
(o)

nve/sphere
(o)
orient/bcc

nve/tri

aveforce
bond/break
drag
gcmc
lineforce
nph/asphere
(o)

ave/atom
bond/create
dt/reset
gld
momentum (k)

ave/chunk
bond/swap
efield
gravity (o)
move

nph/body

nph/sphere (o)

nve/asphere (i) nve/asphere/noforce
nvt (iko)

nvt/asphere (o)

nve/body
nvt/body

oneway
orient/fcc
planeforce
poems
pour
property/atom
python/invoke python/move qeq/comb (o)
qeq/dynamic
qeq/fire
(k)
ed
qeq/slater
rattle
reax/bonds
recenter
restrain
rigid (o)
rigid/small
o)
rigid/nve (o)
rigid/nvt (o)
rigid/small/nph
rigid/small/npt
rigid/small/nve
(o)
k)
shake
spring
spring/chunk
spring/rg
spring/self
srd
e temp/berendsen
temp/csld
temp/csvr
temp/rescale
tfmc
thermal/conductivity
tune/kspace
vector
viscosity
viscous
wall/colloid
wall/gran
nic
wall/lj1043
wall/lj126
wall/lj93 (k)
wall/piston
wall/reflect (k)
wall/region
These are additional fix styles in USER packages, which can be used if LAMMPS is
built with the appropriate package.

apt/fep
drude
able/rx (k)
ipi
d/pc/sphere
vv/edpd

atc
ave/correlate/long
colvars
drude/transform/direct drude/transform/reverse
edpd/source
eos/cv
filter/corotate
flow/gauss
gle
grem
langevin/drude
langevin/eff
lb/fluid
lb/momentum
lb/viscous
meso
manifoldforce
meso/stationary
mvv/tdpd
nve/dot
nve/dotc/langevin nve/manifold/rattle
51

LAMMPS Users Manual

nifold/rattle
pt/uef
mmm
ed/vtk
angulated/surface
m/mod

nph/eff
nvt/uef
qtb
shardlow (k)
smd/setvel
wall/ees

npt/eff
phonon
reax/c/bonds (k)
smd
smd/wall/surface
wall/region/ees

nve/eff
nvt/eff
pimd
qbmsst
reax/c/species (k)
rhok
smd/integrate/tlsph s
tdpd/source
temp/rescale/eff

Compute styles
See the compute command for one-line descriptions of each style or click on the style
itself for a full description. Some of the styles have accelerated versions, which can be
used if LAMMPS is built with the appropriate accelerated package. This is indicated
by additional letters in parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o =
USER-OMP, t = OPT.

aggregate/atom
angle
angle/local angmom/chunk
body/local
bond
bond/local
centro/atom
chunk/atom
cluster/atom
cna/atom
com
com/chunk
contact/atom
coord/atom
damage/atom
dihedral
dihedral/local
dilatation/atom
dipole/chunk
displace/atom erotate/asphere erotate/rigid erotate/sphere
erotate/sphere/atom event/displace fragment/atom global/atom
group/group
gyration
gyration/chunk
heat/flux
hexorder/atom
improper
improper/local inertia/chunk
ke
ke/atom
ke/rigid
msd
msd/chunk
msd/nongauss
omega/chunk
orientorder/atom
pair
pair/local
pe
pe/atom
plasticity/atom
pressure
property/atom property/local property/chunk
rdf
reduce
reduce/region
rigid/local
slice
sna/atom
snav/atom
stress/atom
temp (k)
temp/asphere
temp/body
temp/chunk
temp/com
temp/deform
temp/partial
temp/profile
temp/ramp
temp/region
temp/sphere
ti
torque/chunk
vacf
vcm/chunk
voronoi/atom
These are additional compute styles in USER packages, which can be used if LAMMPS
is built with the appropriate package.

nd/atom
basal/atom
cnp/atom
dpd
dpd/atom
edp
ep
force/tally
heat/flux/tally
ke/eff
ke/atom/eff
m
ho/atom
meso/t/atom
pe/tally
pe/mol/tally
pressure/uef
smd/damage
smd/hourglass/error
smd/internal/energy smd/plastic/strain smd/pl
d/rho
smd/tlsph/dt
smd/tlsph/num/neighs smd/tlsph/shape
smd
/strain/rate smd/tlsph/stress smd/triangle/mesh/vertices smd/ulsph/num/neighs smd/ulsph/strain smd/u
ph/stress
smd/vol
stress/tally
tdpd/cc/atom
temp/drude
eform/eff
temp/region/eff
temp/rotate
temp/uef
xrd
Pair_style potentials
See the pair_style command for an overview of pair potentials. Click on the style itself
for a full description. Many of the styles have accelerated versions, which can be used
if LAMMPS is built with the appropriate accelerated package. This is indicated by
52

LAMMPS Users Manual
additional letters in parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o =
USER-OMP, t = OPT.
none
body
born/coul/dsf/cs
born/coul/wolf (go)
buck (giko)
buck/coul/msm (o)
comb3
coul/long (gko)
coul/wolf (ko)
dsmc

zero
airebo (oi)
bop
born/coul/long (go)
born/coul/wolf/cs
buck/coul/cut (giko)
buck/long/coul/long (o)
coul/cut (gko)
coul/long/cs
coul/wolf/cs
eam (gikot)

hybrid
airebo/morse (oi)
born (go)
born/coul/long/cs
brownian (o)
buck/coul/long (giko)
colloid (go)
coul/debye (gko)
coul/msm
dpd (gio)
eam/alloy (gikot)

eim (o)

gauss (go)

gayberne (gio)

gran/hooke (o)
hbond/dreiding/lj
(o)

gran/hooke/history (o)

gw

hybrid/overlay (k
beck (go)
born/coul/dsf
born/coul/msm (o
brownian/poly (o
buck/coul/long/cs
comb (o)
coul/dsf (gko)
coul/streitz
dpd/tstat (go)
eam/fs (gikot)
gran/hertz/histor
(o)
gw/zbl

hbond/dreiding/morse (o)

kim

lcbop

lj/charmm/coul/charmm/implicit lj/charmm/coul/lon
(ko)
(giko)
lj/charmm/coul/msm lj/charmmfsw/coul/charmmfsh
lj/charmmfsw/coul/long
lj/class2 (gko)
lj/class2/coul/cut
lj/class2/coul/long (gko)
lj/cubic (go)
lj/cut (gikot)
(ko)
lj/cut/coul/long
lj/cut/coul/cut (gko)
lj/cut/coul/debye (gko)
lj/cut/coul/dsf (gko)
(gikot)
lj/cut/dipole/cut
lj/cut/coul/long/cs
lj/cut/coul/msm (go)
lj/cut/coul/wolf (o)
(go)
lj/cut/dipole/long
lj/cut/tip4p/cut (o)
lj/cut/tip4p/long (ot)
lj/expand (gko)
lj/gromacs (gko)
lj/gromacs/coul/gromacs (ko)
lj/long/coul/long (io)
lj/long/dipole/lon
lj/long/tip4p/long
lj/smooth (o)
lj/smooth/linear (o)
lj96/cut (go)
lubricate (o)
lubricate/poly (o)
lubricateU
lubricateU/poly
meam
mie/cut (o)
morse (gkot)
nb3b/harmonic (o
nm/cut (o)
nm/cut/coul/cut (o)
nm/cut/coul/long (o)
peri/eps
peri/lps (o)
peri/pmb (o)
peri/ves
polymorphic
python
reax
rebo (oi)
resquared (go)
snap (k)
soft (go)
sw (giko)
table (gko)
tersoff (giko)
tersoff/mod (gko)
tersoff/mod/c (o)
tersoff/zbl (gko)
tip4p/cut (o)
tip4p/long (o)
tri/lj
ufm (got)
vashishta (ko)
vashishta/table (o)
yukawa (gok)
yukawa/colloid (g
zbl (gok)
These are additional pair styles in USER packages, which can be used if LAMMPS is
built with the appropriate package.
line/lj

lj/charmm/coul/charmm (iko)

53

LAMMPS Users Manual
agni (o)
coul/diel (o)
eam/cd (o)
eff/cut

awpmd/cut
coul/long/soft (o)
edip (o)
exp6/rx (k)

buck/mdf
dpd/fdt
edip/multi
extep

kolmogorov/crespi/z

lennard/mdf

list

lj/cut/coul/cut/soft
(o)

lj/cut/coul/long/soft
lj/cut/dipole/sf (go)
(o)
lj/cut/tip4p/long/soft
lj/cut/thole/long (o)
lj/mdf
(o)
lj/sdk/coul/long (go) lj/sdk/coul/msm (o)
mdpd
meam/c
meam/spline (o)
meam/sw/spline
momb
morse/smooth/linear
morse/soft
multi/lucy/rx (k)
oxdna/coaxstk
oxdna/excv
oxdna/stk
oxdna/xstk
oxdna2/coaxstk
oxdna2/excv
oxdna2/stk
quip
smd/hertz
smd/tlsph
smd/triangulated/surface
smtbq
snap (k)
sph/heatconduction
sph/lj
sph/rhosum
sph/taitwater
srp
table/rx (k)
tdpd
thole
tip4p/long/soft (o)

coul/cut/soft (o)
dpd/fdt/energy (k)
edpd
gauss/cut
lj/charmm/coul/long/soft
(o)
lj/cut/soft (o)
lj/sdk (gko)
mdpd/rhosum
mgpt
multi/lucy
oxdna/hbond
oxdna2/dh
reax/c (ko)
smd/ulsph
sph/idealgas
sph/taitwater/morris
tersoff/table (o)

Bond_style potentials
See the bond_style command for an overview of bond potentials. Click on the style
itself for a full description. Some of the styles have accelerated versions, which can be
used if LAMMPS is built with the appropriate accelerated package. This is indicated
by additional letters in parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o =
USER-OMP, t = OPT.
none
zero
hybrid
class2 (ko)
fene (iko) fene/expand (o) gromos (o) harmonic (ko)
morse (o) nonlinear (o) quartic (o)
table (o)
These are additional bond styles in USER packages, which can be used if LAMMPS is
built with the appropriate package.
harmonic/shift (o)

harmonic/shift/cut
oxdna/fene oxdna2/fene
(o)

Angle_style potentials
See the angle_style command for an overview of angle potentials. Click on the style
itself for a full description. Some of the styles have accelerated versions, which can be
used if LAMMPS is built with the appropriate accelerated package. This is indicated
by additional letters in parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o =
USER-OMP, t = OPT.
54

LAMMPS Users Manual
none
zero
hybrid
charmm (ko)
class2 (ko)
cosine (o)
cosine/delta (o) cosine/periodic (o)
cosine/squared (o) harmonic (iko)
table (o)
These are additional angle styles in USER packages, which can be used if LAMMPS is
built with the appropriate package.
cosine/shift (o) cosine/shift/exp (o) dipole (o) fourier (o)
fourier/simple (o)
quartic (o)
sdk
Dihedral_style potentials
See the dihedral_style command for an overview of dihedral potentials. Click on the
style itself for a full description. Some of the styles have accelerated versions, which
can be used if LAMMPS is built with the appropriate accelerated package. This is
indicated by additional letters in parenthesis: g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
none
zero
hybrid
charmm (iko)
charmmfsw
class2 (ko) harmonic (io)
helix (o)
multi/harmonic (o) opls (iko)
These are additional dihedral styles in USER packages, which can be used if LAMMPS
is built with the appropriate package.
cosine/shift/exp (o) fourier (io) nharmonic (o)
spherical (o)

(o)

table (o)

Improper_style potentials
See the improper_style command for an overview of improper potentials. Click on the
style itself for a full description. Some of the styles have accelerated versions, which
can be used if LAMMPS is built with the appropriate accelerated package. This is
indicated by additional letters in parenthesis: g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
none
zero
hybrid
class2 (ko)
cvff (io) harmonic (iko) umbrella (o)
These are additional improper styles in USER packages, which can be used if
LAMMPS is built with the appropriate package.
cossq (o) distance fourier (o) ring (o)
Kspace solvers
See the kspace_style command for an overview of Kspace solvers. Click on the style
itself for a full description. Some of the styles have accelerated versions, which can be
used if LAMMPS is built with the appropriate accelerated package. This is indicated
55

LAMMPS Users Manual
by additional letters in parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o =
USER-OMP, t = OPT.
ewald (o)
ewald/disp
msm (o)
msm/cg (o)
pppm (gok)
pppm/cg (o) pppm/disp (i) pppm/disp/tip4p
pppm/stagger pppm/tip4p (o)

56

LAMMPS Users Manual
Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS
Commands - Next Section

4. Packages
This section gives an overview of the optional packages that extend LAMMPS
functionality with instructions on how to build LAMMPS with each of them. Packages
are groups of files that enable a specific set of features. For example, force fields for
molecular systems or granular systems are in packages. You can see the list of all
packages and "make" commands to manage them by typing "make package" from
within the src directory of the LAMMPS distribution. Section 2.3 gives general info on
how to install and un-install packages as part of the LAMMPS build process.
There are two kinds of packages in LAMMPS, standard and user packages:
• Table of standard packages
• Table of user packages
Either of these kinds of packages may work as is, may require some additional code
compiled located in the lib folder, or may require an external library to be
and additional compiler flags. You can often do the build of the internal or external
libraries in one step by typing "make lib-name args='...'" from the src dir, with
appropriate arguments included in args='...'. If you just type "make lib-name" you
should see a help message about supported flags and some examples. For more details
packages.
Standard packages are supported by the LAMMPS developers and are written in a
syntax and style consistent with the rest of LAMMPS. This means the developers will
answer questions about them, debug and fix them if necessary, and keep them
compatible with future changes to LAMMPS.
User packages have been contributed by users, and begin with the "user" prefix. If
they are a single command (single file), they are typically in the user-misc package.
User packages don't necessarily meet the requirements of the standard packages. This
means the developers will try to keep things working and usually can answer technical
questions about compiling the package. If you have problems using a feature provided
in a user package, you may need to contact the contributor directly to get help.
Information on how to submit additions you make to LAMMPS as single files or as a
standard or user package are given in this section of the manual.
Following the next two tables is a sub-section for each package. It lists authors (if
applicable) and summarizes the package contents. It has specific instructions on how
library it requires. It also gives links to documentation, example scripts, and
pictures/movies (if available) that illustrate use of the package.
NOTE: To see the complete list of commands a package adds to LAMMPS, just look at
the files in its src directory, e.g. "ls src/GRANULAR". Files with names that start with
57

LAMMPS Users Manual
fix, compute, atom, pair, bond, angle, etc correspond to commands with the same style
names.
In these two tables, the "Example" column is a sub-directory in the examples directory
of the distribution which has an input script that uses the package. E.g. "peptide"
refers to the examples/peptide directory; USER/atc refers to the examples/USER/atc
directory. The "Library" column indicates whether an extra library is needed to build
and use the package:
• dash = no library
• sys = system library: you likely have it on your machine
• int = internal library: provided with LAMMPS, but you may need to build it

Standard packages
Package
ASPHERE
BODY
CLASS2
COLLOID
COMPRESS
CORESHELL

Description
aspherical particle models
body-style particles
class 2 force fields
colloidal particles
I/O compression

Doc page
Example
Library
Section 6.6.14
ellipse
body
body
pair_style lj/class2
atom_style colloid
colloid
dump */gz
sys
Section 6.6.25
coreshell
pair_style
dipole
DIPOLE
point dipole particles
dipole/cut
GPU
GPU-enabled styles
Section 5.3.1
Benchmarks
int
GRANULAR
granular systems
Section 6.6.6
pour
KIM
OpenKIM wrapper
pair_style kim
kim
ext
KOKKOS
Kokkos-enabled styles
Section 5.3.3
Benchmarks
KSPACE
long-range Coulombic solvers
kspace_style
peptide
quantum DFTB forces via
LATTE
fix latte
latte
ext
LATTE
MANYBODY
many-body potentials
pair_style tersoff
shear
MC
Monte Carlo options
fix gcmc
MEAM
modified EAM potential
pair_style meam
meam
int
miscellanous single-file
MISC
commands
MOLECULE molecular system force fields
Section 6.6.3
peptide
MPI parallel I/O dump and
MPIIO
dump
restart
multi-scale coarse-graining
MSCG
fix mscg
mscg
ext
wrapper
OPT
optimized pair styles
Section 5.3.5
Benchmarks
-

58

LAMMPS Users Manual
PERI
POEMS

QEQ
REAX
REPLICA
RIGID
SHOCK
SNAP
SRD

Peridynamics models
coupled rigid body motion
embed Python code in an
input script
QEq charge equilibration
ReaxFF potential (Fortran)
multi-replica methods
rigid bodies and constraints
quantum-fitted potential
stochastic rotation dynamics

VORONOI

Voronoi tesselation

PYTHON

pair_style peri
fix poems

peri
rigid

int

python

python

sys

fix qeq
pair_style reax
Section 6.6.5
fix rigid
fix msst
pair_style snap
fix srd
compute
voronoi/atom

qeq
reax
rigid
snap
srd

int
-

-

ext

USER packages
Package

Description
Doc page
Example
Library
atom-to-continuum
fix atc
USER/atc
int
USER-ATC
coupling
USER-AWPMD
wave-packet MD
pair_style awpmd/cut
USER/awpmd
int
coarse-grained
USER/cgdna
USER-CGDNA
DNA force fields
SDK
USER-CGSDK
coarse-graining
pair_style lj/sdk
USER/cgsdk
model
collective variables
fix colvars
USER/colvars
int
USER-COLVARS
library
virtual x-ray and
compute xrd
USER/diffraction
USER-DIFFRACTION
electron diffraction
reactive dissipative
USER-DPD
USER/dpd
particle dynamics
USER-DRUDE
Drude oscillators
tutorial
USER/drude
USER-EFF
electron force field
pair_style eff/cut
USER/eff
free energy
USER-FEP
compute fep
USER/fep
perturbation
dump output via
USER-H5MD
dump h5md
ext
HDF5
optimized Intel
USER-INTEL
CPU and KNL
Section 5.3.2
Benchmarks
styles
Lattice Boltzmann
USER-LB
fix lb/fluid
USER/lb
fluid
motion on 2d
USER-MANIFOLD
fix manifoldforce
USER/manifold
surfaces
USER-MEAMC
pair_style meam/c
meam
59

LAMMPS Users Manual

USER-MESO
USER-MGPT
USER-MISC
USER-MOFFF
USER-MOLFILE
USER-NETCDF
USER-OMP
USER-PHONON
USER-QMMM
USER-QTB
USER-QUIP
USER-REAXC
USER-SMD
USER-SMTBQ
USER-SPH
USER-TALLY
USER-UEF
USER-VTK

modified EAM
potential (C++)
mesoscale DPD
pair_style edpd
models
fast MGPT
pair_style mgpt
multi-ion potentials
single-file
contributions
styles for MOF-FF
pair_style buck6d/coul/gauss
force field
VMD molfile
dump molfile
plug-ins
dump output via
dump netcdf
NetCDF
OpenMP-enabled
Section 5.3.4
styles
phonon dynamical
fix phonon
matrix
QM/MM coupling
fix qmmm
quantum nuclear
fix qtb fix qbmsst
effects
QUIP/libatoms
pair_style quip
interface
ReaxFF potential
pair_style reaxc
(C/C++)
smoothed Mach
SMD User Guide
dynamics
second moment
tight binding QEq
pair_style smtbq
potential
smoothed particle
SPH User Guide
hydrodynamics
pairwise tally
compute XXX/tally
computes
extensional flow
fix nvt/uef
dump output via
compute vtk
VTK

USER/meso

-

USER/mgpt

-

USER/misc

-

USER/mofff

-

-

ext

-

ext

Benchmarks

-

USER/phonon

-

USER/qmmm

ext

qtb

-

USER/quip

ext

reax

-

USER/smd

ext

USER/smtbq

-

USER/sph

-

USER/tally

-

USER/uef

-

-

ext

ASPHERE package
Contents:
Computes, time-integration fixes, and pair styles for aspherical particle models
including ellipsoids, 2d lines, and 3d triangles.
60

LAMMPS Users Manual
Install or un-install:
make yes-asphere
make machine
make no-asphere
make machine

Supporting info:
• src/ASPHERE: filenames -> commands
• Section 6.14
• pair_style gayberne
• pair_style resquared
• doc/PDF/pair_gayberne_extra.pdf
• doc/PDF/pair_resquared_extra.pdf
• examples/ASPHERE
• examples/ellipse
• http://lammps.sandia.gov/movies.html#line
• http://lammps.sandia.gov/movies.html#tri

BODY package
Contents:
Body-style particles with internal structure. Computes, time-integration fixes, pair
styles, as well as the body styles themselves. See the body doc page for an overview.
Install or un-install:
make yes-body
make machine
make no-body
make machine

Supporting info:
• src/BODY filenames -> commands
• body
• atom_style body
• fix nve/body
• pair_style body
• examples/body

CLASS2 package
Contents:

61

LAMMPS Users Manual
Bond, angle, dihedral, improper, and pair styles for the COMPASS CLASS2 molecular
force field.
Install or un-install:
make yes-class2
make machine
make no-class2
make machine

Supporting info:
• src/CLASS2: filenames -> commands
• bond_style class2
• angle_style class2
• dihedral_style class2
• improper_style class2
• pair_style lj/class2

COLLOID package
Contents:
Coarse-grained finite-size colloidal particles. Pair styles and fix wall styles for colloidal
interactions. Includes the Fast Lubrication Dynamics (FLD) method for hydrodynamic
interactions, which is a simplified approximation to Stokesian dynamics.
Authors: This package includes Fast Lubrication Dynamics pair styles which were
created by Amit Kumar and Michael Bybee from Jonathan Higdon's group at UIUC.
Install or un-install:
make yes-colloid
make machine
make no-colloid
make machine

Supporting info:
• src/COLLOID: filenames -> commands
• fix wall/colloid
• pair_style colloid
• pair_style yukawa/colloid
• pair_style brownian
• pair_style lubricate
• pair_style lubricateU
• examples/colloid
• examples/srd

62

LAMMPS Users Manual
COMPRESS package
Contents:
Compressed output of dump files via the zlib compression library, using dump styles
with a "gz" in their style name.
To use this package you must have the zlib compression library available on your
system.
Author: Axel Kohlmeyer (Temple U).
Install or un-install:
Note that building with this package assumes you have the zlib compression library
available on your system. The LAMMPS build uses the settings in the
lib/compress/Makefile.lammps file in the compile/link process. You should only need to
edit this file if the LAMMPS build fails on your system.
make yes-compress
make machine
make no-compress
make machine

Supporting info:
• src/COMPRESS: filenames -> commands
• dump atom/gz
• dump cfg/gz
• dump custom/gz
• dump xyz/gz

CORESHELL package
Contents:
Compute and pair styles that implement the adiabatic core/shell model for
polarizability. The pair styles augment Born, Buckingham, and Lennard-Jones styles
with core/shell capabilities. The compute temp/cs command calculates the
temperature of a system with core/shell particles. See Section 6.26 for an overview of
how to use this package.
Author: Hendrik Heenen (Technical U of Munich).
Install or un-install:
make yes-coreshell
make machine

63

LAMMPS Users Manual
make no-coreshell
make machine

Supporting info:
• src/CORESHELL: filenames -> commands
• Section 6.26
• Section 6.25
• compute temp/cs
• pair_style born/coul/long/cs
• pair_style buck/coul/long/cs
• pair_style lj/cut/coul/long/cs
• examples/coreshell

DIPOLE package
Contents:
An atom style and several pair styles for point dipole models with short-range or
long-range interactions.
Install or un-install:
make yes-dipole
make machine
make no-dipole
make machine

Supporting info:
• src/DIPOLE: filenames -> commands
• atom_style dipole
• pair_style lj/cut/dipole/cut
• pair_style lj/cut/dipole/long
• pair_style lj/long/dipole/long
• examples/dipole

GPU package
Contents:
Dozens of pair styles and a version of the PPPM long-range Coulombic solver
optimized for GPUs. All such styles have a "gpu" as a suffix in their style name. The
GPU code can be compiled with either CUDA or OpenCL, however the OpenCL
variants are no longer actively maintained and only the CUDA versions are regularly
tested. Section 5.3.1 gives details of what hardware and GPU software is required on
your system, and details on how to build and use this package. Its styles can be
invoked at run time via the "-sf gpu" or "-suffix gpu" command-line switches. See also
64

LAMMPS Users Manual
the KOKKOS package, which has GPU-enabled styles.
Authors: Mike Brown (Intel) while at Sandia and ORNL and Trung Nguyen
(Northwestern U) while at ORNL.
Install or un-install:
Before building LAMMPS with this package, you must first build the GPU library in
lib/gpu from a set of provided C and CUDA files. You can do this manually if you
uses MPI calls, so you have to make certain to use the same MPI library (or the
STUBS library) settings as the main LAMMPS code. That same applies to the
-DLAMMPS_BIGBIG, -DLAMMPS_SMALLBIG, or -DLAMMPS_SMALLSMALL define.
You can also do it in one step from the lammps/src dir, using a command like these,
which simply invoke the lib/gpu/Install.py script with the specified args:
make
make
make
make

lib-gpu
#
lib-gpu args="-b"
#
lib-gpu args="-m xk7 -p
lib-gpu args="-m mpi -p

print help message
build GPU library with default Makefile.linux
single -o xk7.single" # create new Makefile.xk7.single, altered f
mixed -b" # build GPU library with mixed precision using settings

Note that this procedure through the '-m machine' flag starts with one of the existing
Makefile.machine files in lib/gpu. For your convenience, machine makefiles for "mpi"
and "serial" are provided, which have the same settings as the corresponding machine
makefiles in the main LAMMPS source folder. In addition you can alter 4 important
settings in that Makefile, via the -h, -a, -p, -e switches, and also save a copy of the new
Makefile, if desired:
• CUDA_HOME = where NVIDIA CUDA software is installed on your system
• CUDA_ARCH = what GPU hardware you have (see help message for details)
• CUDA_PRECISION = precision (double, mixed, single)
• EXTRAMAKE = which Makefile.lammps.* file to copy to Makefile.lammps
If the library build is successful, at least 3 files should be created: lib/gpu/libgpu.a,
lib/gpu/nvc_get_devices, and lib/gpu/Makefile.lammps. The latter has settings that
enable LAMMPS to link with CUDA libraries. If the settings in Makefile.lammps for
your machine are not correct, the LAMMPS build will fail, and
lib/gpu/Makefile.lammps may need to be edited.
You can then install/un-install the package and build LAMMPS in the usual manner:
make yes-gpu
make machine
make no-gpu
make machine

NOTE: If you re-build the GPU library in lib/gpu, you should always un-install the GPU
package, then re-install it and re-build LAMMPS. This is because the compilation of
files in the GPU package use the library settings from the lib/gpu/Makefile.machine
used to build the GPU library.
65

LAMMPS Users Manual
Supporting info:
• src/GPU: filenames -> commands
• Section 5.3
• Section 5.3.1
• Section 2.6 -sf gpu
• Section 2.6 -pk gpu
• package gpu
• Pair Styles section of Section 3.5 for pair styles followed by (g)
• Benchmarks page of web site

GRANULAR package
Contents:
Pair styles and fixes for finite-size granular particles, which interact with each other
and boundaries via frictional and dissipative potentials.
Install or un-install:
make yes-granular
make machine
make no-granular
make machine

Supporting info:
• src/GRANULAR: filenames -> commands
• Section 6.6,
• fix pour
• fix wall/gran
• pair_style gran/hooke
• pair_style gran/hertz/history
• examples/granregion
• examples/pour
• bench/in.chute
• http://lammps.sandia.gov/pictures.html#jamming
• http://lammps.sandia.gov/movies.html#hopper
• http://lammps.sandia.gov/movies.html#dem
• http://lammps.sandia.gov/movies.html#brazil
• http://lammps.sandia.gov/movies.html#granregion

KIM package
Contents:

66

LAMMPS Users Manual
A pair_style kim command which is a wrapper on the Knowledge Base for Interatomic
Models (KIM) repository of interatomic potentials, enabling any of them to be used in
LAMMPS simulations.
To use this package you must have the KIM library available on your system.
Information about the KIM project can be found at its website: https://openkim.org.
The KIM project is led by Ellad Tadmor and Ryan Elliott (U Minnesota) and James
Sethna (Cornell U).
Authors: Ryan Elliott (U Minnesota) is the main developer for the KIM API which the
pair_style kim command uses. He developed the pair style in collaboration with
Valeriu Smirichinski (U Minnesota).
Install or un-install:
Before building LAMMPS with this package, you must first download and build the
KIM library and include the KIM models that you want to use. You can do this
manually if you prefer; follow the instructions in lib/kim/README. You can also do it
in one step from the lammps/src dir, using a command like these, which simply invoke
the lib/kim/Install.py script with the specified args.
make
make
make
make
make
make
make

lib-kim
lib-kim
lib-kim
lib-kim
lib-kim
lib-kim
lib-kim

args="-b
args="-b
args="-b
args="-n
args="-p
args="-p

# print help message
"
# (re-)install KIM API lib with only example models
-a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
-a everything"
# install KIM API lib with all models
-a EAM_Dynamo_Ackland_W__MO_141627196590_002"
# add one model or mo
/usr/local/kim-api" # use an existing KIM API installation at the provide
/usr/local/kim-api -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto

Note that in LAMMPS lingo, a KIM model driver is a pair style (e.g. EAM or Tersoff). A
KIM model is a pair style for a particular element or alloy and set of parameters, e.g.
EAM for Cu with a specific EAM potential file. Also note that installing the KIM API
library with all its models, may take around 30 min to build. Of course you only need
to do that once.
See the list of KIM model drivers here:
https://openkim.org/kim-items/model-drivers/alphabetical
See the list of all KIM models here:
https://openkim.org/kim-items/models/by-model-drivers
See the list of example KIM models included by default here:
https://openkim.org/kim-api in the "What is in the KIM API source package?" section
You can then install/un-install the package and build LAMMPS in the usual manner:
make yes-kim
make machine
make no-kim
make machine

67

LAMMPS Users Manual
Supporting info:
• src/KIM: filenames -> commands
• pair_style kim
• examples/kim

KOKKOS package
Contents:
Dozens of atom, pair, bond, angle, dihedral, improper, fix, compute styles adapted to
compile using the Kokkos library which can convert them to OpenMP or CUDA code
so that they run efficiently on multicore CPUs, KNLs, or GPUs. All the styles have a
"kk" as a suffix in their style name. Section 5.3.3 gives details of what hardware and
software is required on your system, and how to build and use this package. Its styles
can be invoked at run time via the "-sf kk" or "-suffix kk" command-line switches. Also
see the GPU, OPT, USER-INTEL, and USER-OMP packages, which have styles
optimized for CPUs, KNLs, and GPUs.
You must have a C++11 compatible compiler to use this package.
Authors: The KOKKOS package was created primarily by Christian Trott and Stan
Moore (Sandia), with contributions from other folks as well. It uses the open-source
Kokkos library which was developed by Carter Edwards, Christian Trott, and others at
Sandia, and which is included in the LAMMPS distribution in lib/kokkos.
Install or un-install:
For the KOKKOS package, you have 3 choices when building. You can build with
either CPU or KNL or GPU support. Each choice requires additional settings in your
Makefile.machine for the KOKKOS_DEVICES and KOKKOS_ARCH settings. See the
src/MAKE/OPTIONS/Makefile.kokkos* files for examples.
For multicore CPUs using OpenMP:
KOKKOS_DEVICES = OpenMP
KOKKOS_ARCH = HSW

# HSW = Haswell, SNB = SandyBridge, BDW = Broadwell, etc

For Intel KNLs using OpenMP:
KOKKOS_DEVICES = OpenMP
KOKKOS_ARCH = KNL

For NVIDIA GPUs using CUDA:
KOKKOS_DEVICES = Cuda
KOKKOS_ARCH = Pascal60,Power8
KOKKOS_ARCH = Kepler37,Power8

# P100 hosted by an IBM Power8, etc
# K80 hosted by an IBM Power8, etc

68

LAMMPS Users Manual
For GPUs, you also need these 2 lines in your Makefile.machine before the CC line is
defined, in this case for use with OpenMPI mpicxx. The 2 lines define a nvcc wrapper
compiler, which will use nvcc for compiling CUDA files or use a C++ compiler for
non-Kokkos, non-CUDA files.
KOKKOS_ABSOLUTE_PATH = $(shell cd$(KOKKOS_PATH); pwd)
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper CC = mpicxx Once you have an appropriate Makefile.machine, you can install/un-install the package and build LAMMPS in the usual manner. Note that you cannot build one executable to run on multiple hardware targets (CPU or KNL or GPU). You need to build LAMMPS once for each hardware target, to produce a separate executable. Also note that we do not recommend building with other acceleration packages installed (GPU, OPT, USER-INTEL, USER-OMP) when also building with KOKKOS. make yes-kokkos make machine make no-kokkos make machine Supporting info: • src/KOKKOS: filenames -> commands • src/KOKKOS/README • lib/kokkos/README • Section 5.3 • Section 5.3.3 • Section 2.6 -k on ... • Section 2.6 -sf kk • Section 2.6 -pk kokkos • package kokkos • Styles sections of Section 3.5 for styles followed by (k) • Benchmarks page of web site KSPACE package Contents: A variety of long-range Coulombic solvers, as well as pair styles which compute the corresponding short-range pairwise Coulombic interactions. These include Ewald, particle-particle particle-mesh (PPPM), and multilevel summation method (MSM) solvers. Install or un-install: Building with this package requires a 1d FFT library be present on your system for use by the PPPM solvers. This can be the KISS FFT library provided with LAMMPS, 3rd party libraries like FFTW, or a vendor-supplied FFT library. See step 6 of Section 2.2.2 of the manual for details on how to select different FFT options in your machine 69 LAMMPS Users Manual Makefile. make yes-kspace make machine make no-kspace make machine Supporting info: • src/KSPACE: filenames -> commands • kspace_style • doc/PDF/kspace.pdf • Section 6.7 • Section 6.8 • Section 6.9 • pair_style coul • Pair Styles section of Section 3.5 with "long" or "msm" in pair style name • examples/peptide • bench/in.rhodo LATTE package Contents: A fix command which wraps the LATTE DFTB code, so that molecular dynamics can be run with LAMMPS using density-functional tight-binding quantum forces calculated by LATTE. More information on LATTE can be found at this web site: https://github.com/lanl/LATTE. A brief technical description is given with the fix latte command. Authors: Christian Negre (LANL) and Steve Plimpton (Sandia). LATTE itself is developed at Los Alamos National Laboratory by Marc Cawkwell, Anders Niklasson, and Christian Negre. Install or un-install: Before building LAMMPS with this package, you must first download and build the LATTE library. You can do this manually if you prefer; follow the instructions in lib/latte/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invokes the lib/latte/Install.py script with the specified args: make make make make lib-latte lib-latte args="-b" lib-latte args="-p$HOME/latte"
lib-latte args="-b -m gfortran"

#
#
#
#
#

print help message
use existing LATTE installation in HOME/latte download and build in lib/latte and copy Makefile.lammps.gfortran to Makefile.lammps 70 LAMMPS Users Manual Note that 3 symbolic (soft) links, "includelink" and "liblink" and "filelink.o", are created in lib/latte to point into the LATTE home dir. When LAMMPS builds in src it will use these links. You should also check that the Makefile.lammps file you create is appropriate for the compiler you use on your system to build LATTE. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-latte make machine make no-latte make machine Supporting info: • src/LATTE: filenames -> commands • src/LATTE/README • lib/latte/README • fix latte • examples/latte • LAMMPS-LATTE tutorial MANYBODY package Contents: A variety of manybody and bond-order potentials. These include (AI)REBO, BOP, EAM, EIM, Stillinger-Weber, and Tersoff potentials. Install or un-install: make yes-manybody make machine make no-manybody make machine Supporting info: • src/MANYBODY: filenames -> commands • Pair Styles section of Section 3.5 • examples/comb • examples/eim • examples/nb3d • examples/shear • examples/streitz • examples/vashishta • bench/in.eam 71 LAMMPS Users Manual MC package Contents: Several fixes and a pair style that have Monte Carlo (MC) or MC-like attributes. These include fixes for creating, breaking, and swapping bonds, for performing atomic swaps, and performing grand-canonical MC (GCMC) in conjuction with dynamics. Install or un-install: make yes-mc make machine make no-mc make machine Supporting info: • src/MC: filenames -> commands • fix atom/swap • fix bond/break • fix bond/create • fix bond/swap • fix gcmc • pair_style dsmc • http://lammps.sandia.gov/movies.html#gcmc MEAM package Contents: A pair style for the modified embedded atom (MEAM) potential. Please note that the MEAM package has been superseded by the USER-MEAMC package, which is a direct translation of the MEAM package to C++. USER-MEAMC contains additional optimizations making it run faster than MEAM on most machines, while providing the identical features and USER interface. Author: Greg Wagner (Northwestern U) while at Sandia. Install or un-install: Before building LAMMPS with this package, you must first build the MEAM library in lib/meam. You can do this manually if you prefer; follow the instructions in lib/meam/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/meam/Install.py script with the specified args: make lib-meam # print help message make lib-meam args="-m mpi" # build with default Fortran compiler compatible with your MPI l make lib-meam args="-m serial" # build with compiler compatible with "make serial" (GNU Fortran 72 LAMMPS Users Manual make lib-meam args="-m ifort" # build with Intel Fortran compiler using Makefile.ifort The build should produce two files: lib/meam/libmeam.a and lib/meam/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to link C++ (LAMMPS) with Fortran (MEAM library). Typically the two compilers used for LAMMPS and the MEAM library need to be consistent (e.g. both Intel or both GNU compilers). If necessary, you can edit/create a new lib/meam/Makefile.machine file for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-meam make machine make no-meam make machine NOTE: You should test building the MEAM library with both the Intel and GNU compilers to see if a simulation runs faster with one versus the other on your system. Supporting info: • src/MEAM: filenames -> commands • src/meam/README • lib/meam/README • pair_style meam • examples/meam MISC package Contents: A variety of compute, fix, pair, dump styles with specialized capabilities that don't align with other packages. Do a directory listing, "ls src/MISC", to see the list of commands. NOTE: the MISC package contains styles that require using the -restrict flag, when compiling with Intel compilers. Install or un-install: make yes-misc make machine make no-misc make machine Supporting info: • src/MISC: filenames -> commands 73 LAMMPS Users Manual • compute ti • fix evaporate • fix orient/fcc • fix ttm • fix thermal/conductivity • fix viscosity • examples/KAPPA • examples/VISCOSITY • http://lammps.sandia.gov/pictures.html#ttm • http://lammps.sandia.gov/movies.html#evaporation MOLECULE package Contents: A large number of atom, pair, bond, angle, dihedral, improper styles that are used to model molecular systems with fixed covalent bonds. The pair styles include the Dreiding (hydrogen-bonding) and CHARMM force fields, and a TIP4P water model. Install or un-install: make yes-molecule make machine make no-molecule make machine Supporting info: • src/MOLECULE: filenames -> commands • atom_style • bond_style • angle_style • dihedral_style • improper_style • pair_style hbond/dreiding/lj • pair_style lj/charmm/coul/charmm • Section 6.3 • examples/cmap • examples/dreiding • examples/micelle, • examples/peptide • bench/in.chain • bench/in.rhodo MPIIO package Contents: 74 LAMMPS Users Manual Support for parallel output/input of dump and restart files via the MPIIO library. It adds dump styles with a "mpiio" in their style name. Restart files with an ".mpiio" suffix are also written and read in parallel. Install or un-install: Note that MPIIO is part of the standard message-passing interface (MPI) library, so you should not need any additional compiler or link settings, beyond what LAMMPS normally uses for MPI on your system. make yes-mpiio make machine make no-mpiio make machine Supporting info: • src/MPIIO: filenames -> commands • dump • restart • write_restart • read_restart MSCG package Contents: A fix mscg command which can parameterize a Multi-Scale Coarse-Graining (MSCG) model using the open-source MS-CG library. To use this package you must have the MS-CG library available on your system. Authors: The fix was written by Lauren Abbott (Sandia). The MS-CG library was developed by Jacob Wagner in Greg Voth's group at the University of Chicago. Install or un-install: Before building LAMMPS with this package, you must first download and build the MS-CG library. Building the MS-CG library and using it from LAMMPS requires a C++11 compatible compiler and that the GSL (GNU Scientific Library) headers and libraries are installed on your machine. See the lib/mscg/README and MSCG/Install files for more details. Assuming these libraries are in place, you can do the download and build of MS-CG manually if you prefer; follow the instructions in lib/mscg/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/mscg/Install.py script with the specified args: make lib-mscg # print help message make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master 75 LAMMPS Users Manual # with the settings compatible with "make serial" # download and build in lib/mscg/MSCG-release-master # with the settings compatible with "make mpi" make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/l make lib-mscg args="-b -m mpi" Note that 2 symbolic (soft) links, "includelink" and "liblink", will be created in lib/mscg to point to the MS-CG src/installation dir. When LAMMPS is built in src it will use these links. You should not need to edit the lib/mscg/Makefile.lammps file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-mscg make machine make no-mscg make machine Supporting info: • src/MSCG: filenames -> commands • src/MSCG/README • lib/mscg/README • examples/mscg OPT package Contents: A handful of pair styles which are optimized for improved CPU performance on single or multiple cores. These include EAM, LJ, CHARMM, and Morse potentials. The styles have an "opt" suffix in their style name. Section 5.3.5 gives details of how to build and use this package. Its styles can be invoked at run time via the "-sf opt" or "-suffix opt" command-line switches. See also the KOKKOS, USER-INTEL, and USER-OMP packages, which have styles optimized for CPU performance. Authors: James Fischer (High Performance Technologies), David Richie, and Vincent Natoli (Stone Ridge Technolgy). Install or un-install: make yes-opt make machine make no-opt make machine NOTE: The compile flag "-restrict" must be used to build LAMMPS with the OPT package when using Intel compilers. It should be added to the CCFLAGS line of your Makefile.machine. See Makefile.opt in src/MAKE/OPTIONS for an example. • CCFLAGS: add -restrict for Intel compilers 76 LAMMPS Users Manual Supporting info: • src/OPT: filenames -> commands • Section 5.3 • Section 5.3.5 • Section 2.6 -sf opt • Pair Styles section of Section 3.5 for pair styles followed by (t) • Benchmarks page of web site PERI package Contents: An atom style, several pair styles which implement different Peridynamics materials models, and several computes which calculate diagnostics. Peridynamics is a a particle-based meshless continuum model. Authors: The original package was created by Mike Parks (Sandia). Additional Peridynamics models were added by Rezwanur Rahman and John Foster (UTSA). Install or un-install: make yes-peri make machine make no-peri make machine Supporting info: • src/PERI: filenames -> commands • doc/PDF/PDLammps_overview.pdf • doc/PDF/PDLammps_EPS.pdf • doc/PDF/PDLammps_VES.pdf • atom_style peri • pair_style peri/* • compute damage/atom • compute plasticity/atom • examples/peri • http://lammps.sandia.gov/movies.html#peri POEMS package Contents: A fix that wraps the Parallelizable Open source Efficient Multibody Software (POEMS) library, which is able to simulate the dynamics of articulated body systems. These are systems with multiple rigid bodies (collections of particles) whose motion is coupled by connections at hinge points. 77 LAMMPS Users Manual Author: Rudra Mukherjee (JPL) while at RPI. Install or un-install: Before building LAMMPS with this package, you must first build the POEMS library in lib/poems. You can do this manually if you prefer; follow the instructions in lib/poems/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/poems/Install.py script with the specified args: make make make make lib-poems lib-poems args="-m serial" lib-poems args="-m mpi" lib-poems args="-m icc" # # # # print build build build help with with with message GNU g++ compiler (settings as with "make serial") default MPI C++ compiler (settings as with "make Intel icc compiler The build should produce two files: lib/poems/libpoems.a and lib/poems/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to build LAMMPS with the POEMS library (though typically the settings are just blank). If necessary, you can edit/create a new lib/poems/Makefile.machine file for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-poems make machine make no-meam make machine Supporting info: • src/POEMS: filenames -> commands • src/POEMS/README • lib/poems/README • fix poems • examples/rigid PYTHON package Contents: A python command which allow you to execute Python code from a LAMMPS input script. The code can be in a separate file or embedded in the input script itself. See Section 11.2 for an overview of using Python from LAMMPS in this manner and the entire section for other ways to use LAMMPS and Python together. Install or un-install: make yes-python make machine 78 LAMMPS Users Manual make no-python make machine NOTE: Building with the PYTHON package assumes you have a Python shared library available on your system, which needs to be a Python 2 version, 2.6 or later. Python 3 is not yet supported. See the lib/python/README for more details. Note that the build uses the lib/python/Makefile.lammps file in the compile/link process. You should only need to create a new Makefile.lammps.* file (and copy it to Makefile.lammps) if the LAMMPS build fails. Supporting info: • src/PYTHON: filenames -> commands • Section 11 • lib/python/README • examples/python QEQ package Contents: Several fixes for performing charge equilibration (QEq) via different algorithms. These can be used with pair styles that perform QEq as part of their formulation. Install or un-install: make yes-qeq make machine make no-qeq make machine Supporting info: • src/QEQ: filenames -> commands • fix qeq/* • examples/qeq • examples/streitz REAX package Contents: A pair style which wraps a Fortran library which implements the ReaxFF potential, which is a universal reactive force field. See the USER-REAXC package for an alternate implementation in C/C++. Also a fix reax/bonds command for monitoring molecules as bonds are created and destroyed. Author: Aidan Thompson (Sandia). 79 LAMMPS Users Manual Install or un-install: Before building LAMMPS with this package, you must first build the REAX library in lib/reax. You can do this manually if you prefer; follow the instructions in lib/reax/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/reax/Install.py script with the specified args: make make make make lib-reax lib-reax args="-m serial" lib-reax args="-m mpi" lib-reax args="-m ifort" # # # # print build build build help with with with message GNU Fortran compiler (settings as with "make seri default MPI Fortran compiler (settings as with "m Intel ifort compiler The build should produce two files: lib/reax/libreax.a and lib/reax/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to link C++ (LAMMPS) with Fortran (REAX library). Typically the two compilers used for LAMMPS and the REAX library need to be consistent (e.g. both Intel or both GNU compilers). If necessary, you can edit/create a new lib/reax/Makefile.machine file for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-reax make machine make no-reax make machine Supporting info: • src/REAX: filenames -> commands • lib/reax/README • pair_style reax • fix reax/bonds • examples/reax REPLICA package Contents: A collection of multi-replica methods which can be used when running multiple LAMMPS simulations (replicas). See Section 6.5 for an overview of how to run multi-replica simulations in LAMMPS. Methods in the package include nudged elastic band (NEB), parallel replica dynamics (PRD), temperature accelerated dynamics (TAD), parallel tempering, and a verlet/split algorithm for performing long-range Coulombics on one set of processors, and the remainder of the force field calcalation on another set. Install or un-install: 80 LAMMPS Users Manual make yes-replica make machine make no-replica make machine Supporting info: • src/REPLICA: filenames -> commands • Section 6.5 • neb • prd • tad • temper, • run_style verlet/split • examples/neb • examples/prd • examples/tad RIGID package Contents: Fixes which enforce rigid constraints on collections of atoms or particles. This includes SHAKE and RATTLE, as well as varous rigid-body integrators for a few large bodies or many small bodies. Also several computes which calculate properties of rigid bodies. To install/build: make yes-rigid make machine To un-install/re-build: make no-rigid make machine Supporting info: • src/RIGID: filenames -> commands • >compute erotate/rigid • fix shake • fix rattle • fix rigid/* • examples/ASPHERE • examples/rigid • bench/in.rhodo • http://lammps.sandia.gov/movies.html#box • http://lammps.sandia.gov/movies.html#star 81 LAMMPS Users Manual SHOCK package Contents: Fixes for running impact simulations where a shock-wave passes through a material. Install or un-install: make yes-shock make machine make no-shock make machine Supporting info: • src/SHOCK: filenames -> commands • fix append/atoms • fix msst • fix nphug • fix wall/piston • examples/hugoniostat • examples/msst SNAP package Contents: A pair style for the spectral neighbor analysis potential (SNAP). SNAP is methodology for deriving a highly accurate classical potential fit to a large archive of quantum mechanical (DFT) data. Also several computes which analyze attributes of the potential. Author: Aidan Thompson (Sandia). Install or un-install: make yes-snap make machine make no-snap make machine Supporting info: • src/SNAP: filenames -> commands • pair_style snap • compute sna/atom • compute snad/atom • compute snav/atom • examples/snap 82 LAMMPS Users Manual SRD package Contents: A pair of fixes which implement the Stochastic Rotation Dynamics (SRD) method for coarse-graining of a solvent, typically around large colloidal particles. To install/build: make yes-srd make machine To un-install/re-build: make no-srd make machine Supporting info: • src/SRD: filenames -> commands • fix srd • fix wall/srd • examples/srd • examples/ASPHERE • http://lammps.sandia.gov/movies.html#tri • http://lammps.sandia.gov/movies.html#line • http://lammps.sandia.gov/movies.html#poly VORONOI package Contents: A compute command which calculates the Voronoi tesselation of a collection of atoms by wrapping the Voro++ library. This can be used to calculate the local volume or each atoms or its near neighbors. To use this package you must have the Voro++ library available on your system. Author: Daniel Schwen (INL) while at LANL. The open-source Voro++ library was written by Chris Rycroft (Harvard U) while at UC Berkeley and LBNL. Install or un-install: Before building LAMMPS with this package, you must first download and build the Voro++ library. You can do this manually if you prefer; follow the instructions in lib/voronoi/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/voronoi/Install.py script with the specified args: 83 LAMMPS Users Manual make lib-voronoi make lib-voronoi args="-b" # print help message # download and build the default version in lib/voron Note that 2 symbolic (soft) links, "includelink" and "liblink", are created in lib/voronoi to point to the Voro++ src dir. When LAMMPS builds in src it will use these links. You should not need to edit the lib/voronoi/Makefile.lammps file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-voronoi make machine make no-voronoi make machine Supporting info: • src/VORONOI: filenames -> commands • src/VORONOI/README • lib/voronoi/README • compute voronoi/atom • examples/voronoi USER-ATC package Contents: ATC stands for atoms-to-continuum. This package implements a fix atc command to either couple molecular dynamics with continuum finite element equations or perform on-the-fly conversion of atomic information to continuum fields. Authors: Reese Jones, Jeremy Templeton, Jon Zimmerman (Sandia). Install or un-install: Before building LAMMPS with this package, you must first build the ATC library in lib/atc. You can do this manually if you prefer; follow the instructions in lib/atc/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/atc/Install.py script with the specified args: make make make make lib-atc lib-atc args="-m serial" lib-atc args="-m mpi" lib-atc args="-m icc" # # # # print build build build help with with with message GNU g++ compiler and MPI STUBS (settings as with default MPI compiler (settings as with "make mpi Intel icc compiler The build should produce two files: lib/atc/libatc.a and lib/atc/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to build LAMMPS with the ATC library. If necessary, you can edit/create a new lib/atc/Makefile.machine file for your system, which should define an EXTRAMAKE 84 LAMMPS Users Manual variable to specify a corresponding Makefile.lammps.machine file. Note that the Makefile.lammps file has settings for the BLAS and LAPACK linear algebra libraries. As explained in lib/atc/README these can either exist on your system, or you can use the files provided in lib/linalg. In the latter case you also need to build the library in lib/linalg with a command like these: make make make make lib-linalg lib-linalg args="-m serial" lib-linalg args="-m mpi" lib-linalg args="-m gfortran" # # # # print build build build help with with with message GNU Fortran compiler (settings as with "make s default MPI Fortran compiler (settings as with GNU Fortran compiler You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-atc make machine make no-user-atc make machine Supporting info: • src/USER-ATC: filenames -> commands • src/USER-ATC/README • fix atc • examples/USER/atc • http://lammps.sandia.gov/pictures.html#atc USER-AWPMD package Contents: AWPMD stands for Antisymmetrized Wave Packet Molecular Dynamics. This package implements an atom, pair, and fix style which allows electrons to be treated as explicit particles in a classical molecular dynamics model. Author: Ilya Valuev (JIHT, Russia). Install or un-install: Before building LAMMPS with this package, you must first build the AWPMD library in lib/awpmd. You can do this manually if you prefer; follow the instructions in lib/awpmd/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/awpmd/Install.py script with the specified args: make make make make lib-awpmd lib-awpmd args="-m serial" lib-awpmd args="-m mpi" lib-awpmd args="-m icc" # # # # print build build build help with with with message GNU g++ compiler and MPI STUBS (settings as with default MPI compiler (settings as with "make mpi" Intel icc compiler 85 LAMMPS Users Manual The build should produce two files: lib/awpmd/libawpmd.a and lib/awpmd/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to build LAMMPS with the AWPMD library. If necessary, you can edit/create a new lib/awpmd/Makefile.machine file for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. Note that the Makefile.lammps file has settings for the BLAS and LAPACK linear algebra libraries. As explained in lib/awpmd/README these can either exist on your system, or you can use the files provided in lib/linalg. In the latter case you also need to build the library in lib/linalg with a command like these: make make make make lib-linalg lib-linalg args="-m serial" lib-linalg args="-m mpi" lib-linalg args="-m gfortran" # # # # print build build build help with with with message GNU Fortran compiler (settings as with "make s default MPI Fortran compiler (settings as with GNU Fortran compiler You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-awpmd make machine make no-user-awpmd make machine Supporting info: • src/USER-AWPMD: filenames -> commands • src/USER-AWPMD/README • pair_style awpmd/cut • examples/USER/awpmd USER-CGDNA package Contents: Several pair styles, a bond style, and integration fixes for coarse-grained models of single- and double-stranded DNA based on the oxDNA model of Doye, Louis and Ouldridge at the University of Oxford. This includes Langevin-type rigid-body integrators with improved stability. Author: Oliver Henrich (University of Strathclyde, Glasgow). Install or un-install: make yes-user-cgdna make machine make no-user-cgdna make machine Supporting info: 86 LAMMPS Users Manual • src/USER-CGDNA: filenames -> commands • /src/USER-CGDNA/README • pair_style oxdna/* • pair_style oxdna2/* • bond_style oxdna/* • bond_style oxdna2/* • fix nve/dotc/langevin USER-CGSDK package Contents: Several pair styles and an angle style which implement the coarse-grained SDK model of Shinoda, DeVane, and Klein which enables simulation of ionic liquids, electrolytes, lipids and charged amino acids. Author: Axel Kohlmeyer (Temple U). Install or un-install: make yes-user-cgsdk make machine make no-user-cgsdk make machine Supporting info: • src/USER-CGSDK: filenames -> commands • src/USER-CGSDK/README • pair_style lj/sdk/* • angle_style sdk • examples/USER/cgsdk • http://lammps.sandia.gov/pictures.html#cg USER-COLVARS package Contents: COLVARS stands for collective variables, which can be used to implement various enhanced sampling methods, including Adaptive Biasing Force, Metadynamics, Steered MD, Umbrella Sampling and Restraints. A fix colvars command is implemented which wraps a COLVARS library, which implements these methods. simulations. Authors: The COLVARS library is written and maintained by Giacomo Fiorin (ICMS, Temple University, Philadelphia, PA, USA) and Jerome Henin (LISM, CNRS, Marseille, France), originally for the NAMD MD code, but with portability in mind. Axel Kohlmeyer (Temple U) provided the interface to LAMMPS. 87 LAMMPS Users Manual Install or un-install: Before building LAMMPS with this package, you must first build the COLVARS library in lib/colvars. You can do this manually if you prefer; follow the instructions in lib/colvars/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/colvars/Install.py script with the specified args: make make make make lib-colvars lib-colvars args="-m serial" lib-colvars args="-m mpi" lib-colvars args="-m g++-debug" # # # # print build build build help with with with message GNU g++ compiler (settings as with "make ser default MPI compiler (settings as with "make GNU g++ compiler and colvars debugging enabl The build should produce two files: lib/colvars/libcolvars.a and lib/colvars/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to build LAMMPS with the COLVARS library (though typically the settings are just blank). If necessary, you can edit/create a new lib/colvars/Makefile.machine file for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-colvars make machine make no-user-colvars make machine Supporting info: • src/USER-COLVARS: filenames -> commands • doc/PDF/colvars-refman-lammps.pdf • src/USER-COLVARS/README • lib/colvars/README • fix colvars • examples/USER/colvars USER-DIFFRACTION package Contents: Two computes and a fix for calculating x-ray and electron diffraction intensities based on kinematic diffraction theory. Author: Shawn Coleman while at the U Arkansas. Install or un-install: make yes-user-diffraction make machine make no-user-diffraction 88 LAMMPS Users Manual make machine Supporting info: • src/USER-DIFFRACTION: filenames -> commands • compute saed • compute xrd • fix saed/vtk • examples/USER/diffraction USER-DPD package Contents: DPD stands for dissipative particle dynamics. This package implements coarse-grained DPD-based models for energetic, reactive molecular crystalline materials. It includes many pair styles specific to these systems, including for reactive DPD, where each particle has internal state for multiple species and a coupled set of chemical reaction ODEs are integrated each timestep. Highly accurate time integrators for isothermal, isoenergetic, isobaric and isenthalpic conditions are included. These enable long timesteps via the Shardlow splitting algorithm. Authors: Jim Larentzos (ARL), Tim Mattox (Engility Corp), and and John Brennan (ARL). Install or un-install: make yes-user-dpd make machine make no-user-dpd make machine Supporting info: • src/USER-DPD: filenames -> commands • /src/USER-DPD/README • compute dpd • compute dpd/atom • fix eos/cv • fix eos/table • fix eos/table/rx • fix shardlow • fix rx • pair_style table/rx • pair_style dpd/fdt • pair_style dpd/fdt/energy • pair_style exp6/rx • pair_style multi/lucy • pair_style multi/lucy/rx 89 LAMMPS Users Manual • examples/USER/dpd USER-DRUDE package Contents: Fixes, pair styles, and a compute to simulate thermalized Drude oscillators as a model of polarization. See Section 6.27 for an overview of how to use the package. There are auxiliary tools for using this package in tools/drude. Authors: Alain Dequidt (U Blaise Pascal Clermont-Ferrand), Julien Devemy (CNRS), and Agilio Padua (U Blaise Pascal). Install or un-install: make yes-user-drude make machine make no-user-drude make machine Supporting info: • src/USER-DRUDE: filenames -> commands • Section 6.27 • Section 6.25 • src/USER-DRUDE/README • fix drude • fix drude/transform/* • compute temp/drude • pair_style thole • pair_style lj/cut/thole/long • examples/USER/drude • tools/drude USER-EFF package Contents: EFF stands for electron force field which allows a classical MD code to model electrons as particles of variable radius. This package contains atom, pair, fix and compute styles which implement the eFF as described in A. Jaramillo-Botero, J. Su, Q. An, and W.A. Goddard III, JCC, 2010. The eFF potential was first introduced by Su and Goddard, in 2007. There are auxiliary tools for using this package in tools/eff; see its README file. Author: Andres Jaramillo-Botero (CalTech). Install or un-install: 90 LAMMPS Users Manual make yes-user-eff make machine make no-user-eff make machine Supporting info: • src/USER-EFF: filenames -> commands • src/USER-EFF/README • atom_style electron • fix nve/eff • fix nvt/eff • fix npt/eff • fix langevin/eff • compute temp/eff • pair_style eff/cut • pair_style eff/inline • examples/USER/eff • tools/eff/README • tools/eff • http://lammps.sandia.gov/movies.html#eff USER-FEP package Contents: FEP stands for free energy perturbation. This package provides methods for performing FEP simulations by using a fix adapt/fep command with soft-core pair potentials, which have a "soft" in their style name. There are auxiliary tools for using this package in tools/fep; see its README file. Author: Agilio Padua (Universite Blaise Pascal Clermont-Ferrand) Install or un-install: make yes-user-fep make machine make no-user-fep make machine Supporting info: • src/USER-FEP: filenames -> commands • src/USER-FEP/README • fix adapt/fep • compute fep • pair_style */soft • examples/USER/fep • tools/fep/README 91 LAMMPS Users Manual • tools/fep USER-H5MD package Contents: H5MD stands for HDF5 for MD. HDF5 is a portable, binary, self-describing file format, used by many scientific simulations. H5MD is a format for molecular simulations, built on top of HDF5. This package implements a dump h5md command to output LAMMPS snapshots in this format. To use this package you must have the HDF5 library available on your system. Author: Pierre de Buyl (KU Leuven) created both the package and the H5MD format. Install or un-install: Note that to follow these steps to compile and link to the CH5MD library, you need the standard HDF5 software package installed on your system, which should include the h5cc compiler and the HDF5 library. Before building LAMMPS with this package, you must first build the CH5MD library in lib/h5md. You can do this manually if you prefer; follow the instructions in lib/h5md/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/h5md/Install.py script with the specified args: make lib-h5md make lib-hm5d args="-m h5cc" # print help message # build with h5cc compiler The build should produce two files: lib/h5md/libch5md.a and lib/h5md/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to build LAMMPS with the system HDF5 library. If necessary, you can edit/create a new lib/h5md/Makefile.machine file for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-h5md make machine make no-user-h5md make machine Supporting info: • src/USER-H5MD: filenames -> commands • src/USER-H5MD/README • lib/h5md/README • dump h5md 92 LAMMPS Users Manual USER-INTEL package Contents: Dozens of pair, fix, bond, angle, dihedral, improper, and kspace styles which are optimized for Intel CPUs and KNLs (Knights Landing). All of them have an "intel" in their style name. Section 5.3.2 gives details of what hardware and compilers are required on your system, and how to build and use this package. Its styles can be invoked at run time via the "-sf intel" or "-suffix intel" command-line switches. Also see the KOKKOS, OPT, and USER-OMP packages, which have styles optimized for CPUs and KNLs. You need to have an Intel compiler, version 14 or higher to take full advantage of this package. While compilation with GNU compilers is supported, performance will be suboptimal. NOTE: the USER-INTEL package contains styles that require using the -restrict flag, when compiling with Intel compilers. Author: Mike Brown (Intel). Install or un-install: For the USER-INTEL package, you have 2 choices when building. You can build with either CPU or KNL support. Each choice requires additional settings in your Makefile.machine for CCFLAGS and LINKFLAGS and optimized malloc libraries. See the src/MAKE/OPTIONS/Makefile.intel_cpu and src/MAKE/OPTIONS/Makefile.knl files for examples. For CPUs: OPTFLAGS = CCFLAGS = LINKFLAGS = LIB = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict
-g -qopenmp $(OPTFLAGS) -ltbbmalloc -ltbbmalloc_proxy For KNLs: OPTFLAGS = CCFLAGS = LINKFLAGS = LIB = -xMIC-AVX512 -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict$
-g -qopenmp $(OPTFLAGS) -ltbbmalloc Once you have an appropriate Makefile.machine, you can install/un-install the package and build LAMMPS in the usual manner. Note that you cannot build one executable to run on multiple hardware targets (Intel CPUs or KNL). You need to build LAMMPS once for each hardware target, to produce a separate executable. You should also typically install the USER-OMP package, as it can be used in tandem with the USER-INTEL package to good effect, as explained in Section 5.3.2. 93 LAMMPS Users Manual make yes-user-intel yes-user-omp make machine make no-user-intel no-user-omp make machine Supporting info: • src/USER-INTEL: filenames -> commands • src/USER-INTEL/README • Section 5.3 • Section 5.3.2 • Section 2.6 -sf intel • Section 2.6 -pk intel • package intel • Styles sections of Section 3.5 for styles followed by (i) • src/USER-INTEL/TEST • Benchmarks page of web site USER-LB package Contents: Fixes which implement a background Lattice-Boltzmann (LB) fluid, which can be used to model MD particles influenced by hydrodynamic forces. Authors: Frances Mackay and Colin Denniston (University of Western Ontario). Install or un-install: make yes-user-lb make machine make no-user-lb make machine Supporting info: • src/USER-LB: filenames -> commands • src/USER-LB/README • fix lb/fluid • fix lb/momentum • fix lb/viscous • examples/USER/lb USER-MGPT package Contents: 94 LAMMPS Users Manual A pair style which provides a fast implementation of the quantum-based MGPT multi-ion potentials. The MGPT or model GPT method derives from first-principles DFT-based generalized pseudopotential theory (GPT) through a series of systematic approximations valid for mid-period transition metals with nearly half-filled d bands. The MGPT method was originally developed by John Moriarty at LLNL. The pair style in this package calculates forces and energies using an optimized matrix-MGPT algorithm due to Tomas Oppelstrup at LLNL. Authors: Tomas Oppelstrup and John Moriarty (LLNL). Install or un-install: make yes-user-mgpt make machine make no-user-mgpt make machine Supporting info: • src/USER-MGPT: filenames -> commands • src/USER-MGPT/README • pair_style mgpt • examples/USER/mgpt USER-MISC package Contents: A potpourri of (mostly) unrelated features contributed to LAMMPS by users. Each feature is a single fix, compute, pair, bond, angle, dihedral, improper, or command style. Authors: The author for each style in the package is listed in the src/USER-MISC/README file. Install or un-install: make yes-user-misc make machine make no-user-misc make machine Supporting info: • src/USER-MISC: filenames -> commands • src/USER-MISC/README • one doc page per individual command listed in src/USER-MISC/README • examples/USER/misc 95 LAMMPS Users Manual USER-MANIFOLD package Contents: Several fixes and a "manifold" class which enable simulations of particles constrained to a manifold (a 2D surface within the 3D simulation box). This is done by applying the RATTLE constraint algorithm to formulate single-particle constraint functions g(xi,yi,zi) = 0 and their derivative (i.e. the normal of the manifold) n = grad(g). Author: Stefan Paquay (until 2017: Eindhoven University of Technology (TU/e), The Netherlands; since 2017: Brandeis University, Waltham, MA, USA) Install or un-install: make yes-user-manifold make machine make no-user-manifold make machine Supporting info: • src/USER-MANIFOLD: filenames -> commands • src/USER-MANIFOLD/README • doc/manifolds • fix manifoldforce • fix nve/manifold/rattle • fix nvt/manifold/rattle • examples/USER/manifold • http://lammps.sandia.gov/movies.html#manifold USER-MEAMC package Contents: A pair style for the modified embedded atom (MEAM) potential translated from the Fortran version in the MEAM package to plain C++. In contrast to the MEAM package, no library needs to be compiled and the pair style can be instantiated multiple times. Author: Sebastian Huetter, (Otto-von-Guericke University Magdeburg) based on the Fortran version of Greg Wagner (Northwestern U) while at Sandia. Install or un-install: make yes-user-meamc make machine make no-user-meamc make machine 96 LAMMPS Users Manual Supporting info: • src/USER-MEAMC: filenames -> commands • src/USER-MEAMC/README • pair_style meam/c • examples/meam USER-MESO package Contents: Several extensions of the the dissipative particle dynamics (DPD) method. Specifically, energy-conserving DPD (eDPD) that can model non-isothermal processes, many-body DPD (mDPD) for simulating vapor-liquid coexistence, and transport DPD (tDPD) for modeling advection-diffusion-reaction systems. The equations of motion of these DPD extensions are integrated through a modified velocity-Verlet (MVV) algorithm. Author: Zhen Li (Division of Applied Mathematics, Brown University) Install or un-install: make yes-user-meso make machine make no-user-meso make machine Supporting info: • src/USER-MESO: filenames -> commands • src/USER-MESO/README • atom_style edpd • pair_style edpd • pair_style mdpd • pair_style tdpd • fix mvv/dpd • examples/USER/meso • http://lammps.sandia.gov/movies.html#mesodpd USER-MOFFF package Contents: Pair, angle and improper styles needed to employ the MOF-FF force field by Schmid and coworkers with LAMMPS. MOF-FF is a first principles derived force field with the primary aim to simulate MOFs and related porous framework materials, using spherical Gaussian charges. It is described in S. Bureekaew et al., Phys. Stat. Sol. B 2013, 250, 1128-1141. For the usage of MOF-FF see the example in the example directory as well as the MOF+ website. 97 LAMMPS Users Manual Author: Hendrik Heenen (Technical U of Munich), Rochus Schmid (Ruhr-University Bochum). Install or un-install: make yes-user-mofff make machine make no-user-mofff make machine Supporting info: • src/USER-MOFFF: filenames -> commands • src/USER-MOFFF/README • pair_style buck6d/coul/gauss • angle_style class2 • angle_style cosine/buck6d • improper_style inversion/harmonic • examples/USER/mofff USER-MOLFILE package Contents: A dump molfile command which uses molfile plugins that are bundled with the VMD molecular visualization and analysis program, to enable LAMMPS to dump snapshots in formats compatible with various molecular simulation tools. To use this package you must have the desired VMD plugins available on your system. Note that this package only provides the interface code, not the plugins themselves, which will be accessed when requesting a specific plugin via the dump molfile command. Plugins can be obtained from a VMD installation which has to match the platform that you are using to compile LAMMPS for. By adding plugins to VMD, support for new file formats can be added to LAMMPS (or VMD or other programs that use them) without having to recompile the application itself. More information about the VMD molfile plugins can be found at http://www.ks.uiuc.edu/Research/vmd/plugins/molfile. Author: Axel Kohlmeyer (Temple U). Install or un-install: Note that the lib/molfile/Makefile.lammps file has a setting for a dynamic loading library libdl.a that should is typically present on all systems, which is required for LAMMPS to link with this package. If the setting is not valid for your system, you will need to edit the Makefile.lammps file. See lib/molfile/README and lib/molfile/Makefile.lammps for details. make yes-user-molfile 98 LAMMPS Users Manual make machine make no-user-molfile make machine Supporting info: • src/USER-MOLFILE: filenames -> commands • src/USER-MOLFILE/README • lib/molfile/README • dump molfile USER-NETCDF package Contents: Dump styles for writing NetCDF formatted dump files. NetCDF is a portable, binary, self-describing file format developed on top of HDF5. The file contents follow the AMBER NetCDF trajectory conventions (http://ambermd.org/netcdf/nctraj.xhtml), but include extensions. To use this package you must have the NetCDF library available on your system. Note that NetCDF files can be directly visualized with the following tools: • Ovito (Ovito supports the AMBER convention and the extensions mentioned above) • VMD • AtomEye (the libAtoms version of AtomEye contains a NetCDF reader not present in the standard distribution) Author: Lars Pastewka (Karlsruhe Institute of Technology). Install or un-install: Note that to follow these steps, you need the standard NetCDF software package installed on your system. The lib/netcdf/Makefile.lammps file has settings for NetCDF include and library files that LAMMPS needs to compile and linkk with this package. If the settings are not valid for your system, you will need to edit the Makefile.lammps file. See lib/netcdf/README for details. make yes-user-netcdf make machine make no-user-netcdf make machine Supporting info: • src/USER-NETCDF: filenames -> commands • src/USER-NETCDF/README 99 LAMMPS Users Manual • lib/netcdf/README • dump netcdf USER-OMP package Contents: Hundreds of pair, fix, compute, bond, angle, dihedral, improper, and kspace styles which are altered to enable threading on many-core CPUs via OpenMP directives. All of them have an "omp" in their style name. Section 5.3.4 gives details of what hardware and compilers are required on your system, and how to build and use this package. Its styles can be invoked at run time via the "-sf omp" or "-suffix omp" command-line switches. Also see the KOKKOS, OPT, and USER-INTEL packages, which have styles optimized for CPUs. Author: Axel Kohlmeyer (Temple U). NOTE: To enable multi-threading support the compile flag "-fopenmp" and the link flag "-fopenmp" (for GNU compilers, you have to look up the equivalent flags for other compilers) must be used to build LAMMPS. When using Intel compilers, also the "-restrict" flag is required. The USER-OMP package can be compiled without enabling OpenMP; then all code will be compiled as serial and the only improvement over the regular styles are some data access optimization. These flags should be added to the CCFLAGS and LINKFLAGS lines of your Makefile.machine. See src/MAKE/OPTIONS/Makefile.omp for an example. Once you have an appropriate Makefile.machine, you can install/un-install the package and build LAMMPS in the usual manner: Install or un-install: make yes-user-omp make machine make no-user-omp make machine • CCFLAGS: add -fopenmp (and -restrict when using Intel compilers) • LINKFLAGS: add -fopenmp Supporting info: • src/USER-OMP: filenames -> commands • src/USER-OMP/README • Section 5.3 • Section 5.3.4 • Section 2.6 -sf omp • Section 2.6 -pk omp • package omp • Styles sections of Section 3.5 for styles followed by (o) 100 LAMMPS Users Manual • Benchmarks page of web site USER-PHONON package Contents: A fix phonon command that calculates dynamical matrices, which can then be used to compute phonon dispersion relations, directly from molecular dynamics simulations. Author: Ling-Ti Kong (Shanghai Jiao Tong University). Install or un-install: make yes-user-phonon make machine make no-user-phonon make machine Supporting info: • src/USER-PHONON: filenames -> commands • src/USER-PHONON/README • fix phonon • examples/USER/phonon USER-QMMM package Contents: A fix qmmm command which allows LAMMPS to be used in a QM/MM simulation, currently only in combination with the Quantum ESPRESSO package. To use this package you must have Quantum ESPRESSO available on your system. The current implementation only supports an ONIOM style mechanical coupling to the Quantum ESPRESSO plane wave DFT package. Electrostatic coupling is in preparation and the interface has been written in a manner that coupling to other QM codes should be possible without changes to LAMMPS itself. Author: Axel Kohlmeyer (Temple U). Install or un-install: Before building LAMMPS with this package, you must first build the QMMM library in lib/qmmm. You can do this manually if you prefer; follow the first two steps explained in lib/qmmm/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/qmmm/Install.py script with the specified args: 101 LAMMPS Users Manual make make make make lib-qmmm lib-qmmm args="-m serial" lib-qmmm args="-m mpi" lib-qmmm args="-m gfortran" # # # # print build build build help with with with message GNU Fortran compiler (settings as in "make seri default MPI compiler (settings as in "make mpi" GNU Fortran compiler The build should produce two files: lib/qmmm/libqmmm.a and lib/qmmm/Makefile.lammps. The latter is copied from an existing Makefile.lammps.* and has settings needed to build LAMMPS with the QMMM library (though typically the settings are just blank). If necessary, you can edit/create a new lib/qmmm/Makefile.machine file for your system, which should define an EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-qmmm make machine make no-user-qmmm make machine NOTE: The LAMMPS executable these steps produce is not yet functional for a QM/MM simulation. You must also build Quantum ESPRESSO and create a new executable which links LAMMPS and Quantum ESPRESSO together. These are steps 3 and 4 described in the lib/qmmm/README file. Supporting info: • src/USER-QMMM: filenames -> commands • src/USER-QMMM/README • lib/qmmm/README • fix phonon • lib/qmmm/example-ec/README • lib/qmmm/example-mc/README USER-QTB package Contents: Two fixes which provide a self-consistent quantum treatment of vibrational modes in a classical molecular dynamics simulation. By coupling the MD simulation to a colored thermostat, it introduces zero point energy into the system, altering the energy power spectrum and the heat capacity to account for their quantum nature. This is useful when modeling systems at temperatures lower than their classical limits or when temperatures ramp across the classical limits in a simulation. Author: Yuan Shen (Stanford U). Install or un-install: make yes-user-qtb make machine 102 LAMMPS Users Manual make no-user-qtb make machine Supporting info: • src/USER-QTB: filenames -> commands • src/USER-QTB/README • fix qtb • fix qbmsst • examples/USER/qtb USER-QUIP package Contents: A pair_style quip command which wraps the QUIP libAtoms library, which includes a variety of interatomic potentials, including Gaussian Approximation Potential (GAP) models developed by the Cambridge University group. To use this package you must have the QUIP libAtoms library available on your system. Author: Albert Bartok (Cambridge University) Install or un-install: Note that to follow these steps to compile and link to the QUIP library, you must first download and build QUIP on your systems. It can be obtained from GitHub. See step 1 and step 1.1 in the lib/quip/README file for details on how to do this. Note that it requires setting two environment variables, QUIP_ROOT and QUIP_ARCH, which will be accessed by the lib/quip/Makefile.lammps file which is used when you compile and link LAMMPS with this package. You should only need to edit this file if the LAMMPS build can not use its settings to successfully build on your system. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-quip make machine make no-user-quip make machine Supporting info: • src/USER-QUIP: filenames -> commands • src/USER-QUIP/README • pair_style quip • examples/USER/quip 103 LAMMPS Users Manual USER-REAXC package Contents: A pair style which implements the ReaxFF potential in C/C++ (in contrast to the REAX package and its Fortran library). ReaxFF is universal reactive force field. See the src/USER-REAXC/README file for more info on differences between the two packages. Also two fixes for monitoring molecules as bonds are created and destroyed. Author: Hasan Metin Aktulga (MSU) while at Purdue University. Install or un-install: make yes-user-reaxc make machine make no-user-reaxc make machine Supporting info: • src/USER-REAXC: filenames -> commands • src/USER-REAXC/README • pair_style reax/c • fix reax/c/bonds • fix reax/c/species • examples/reax USER-SMD package Contents: An atom style, fixes, computes, and several pair styles which implements smoothed Mach dynamics (SMD) for solids, which is a model related to smoothed particle hydrodynamics (SPH) for liquids (see the USER-SPH package). This package solves solids mechanics problems via a state of the art stabilized meshless method with hourglass control. It can specify hydrostatic interactions independently from material strength models, i.e. pressure and deviatoric stresses are separated. It provides many material models (Johnson-Cook, plasticity with hardening, Mie-Grueneisen, Polynomial EOS) and allows new material models to be added. It implements rigid boundary conditions (walls) which can be specified as surface geometries from *.STL files. Author: Georg Ganzenmuller (Fraunhofer-Institute for High-Speed Dynamics, Ernst Mach Institute, Germany). Install or un-install: 104 LAMMPS Users Manual Before building LAMMPS with this package, you must first download the Eigen library. Eigen is a template library, so you do not need to build it, just download it. You can do this manually if you prefer; follow the instructions in lib/smd/README. You can also do it in one step from the lammps/src dir, using a command like these, which simply invoke the lib/smd/Install.py script with the specified args: make lib-smd # print help message make lib-smd args="-b" # download and build in default lib/smd/eigen-eigen-... make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include Note that a symbolic (soft) link named "includelink" is created in lib/smd to point to the Eigen dir. When LAMMPS builds it will use this link. You should not need to edit the lib/smd/Makefile.lammps file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-smd make machine make no-user-smd make machine Supporting info: • src/USER-SMD: filenames -> commands • src/USER-SMD/README • doc/PDF/SMD_LAMMPS_userguide.pdf • examples/USER/smd • http://lammps.sandia.gov/movies.html#smd USER-SMTBQ package Contents: A pair style which implements a Second Moment Tight Binding model with QEq charge equilibration (SMTBQ) potential for the description of ionocovalent bonds in oxides. Authors: Nicolas Salles, Emile Maras, Olivier Politano, and Robert Tetot (LAAS-CNRS, France). Install or un-install: make yes-user-smtbq make machine make no-user-smtbq make machine Supporting info: 105 LAMMPS Users Manual • src/USER-SMTBQ: filenames -> commands • src/USER-SMTBQ/README • pair_style smtbq • examples/USER/smtbq USER-SPH package Contents: An atom style, fixes, computes, and several pair styles which implements smoothed particle hydrodynamics (SPH) for liquids. See the related USER-SMD package package for smooth Mach dynamics (SMD) for solids. This package contains ideal gas, Lennard-Jones equation of states, Tait, and full support for complete (i.e. internal-energy dependent) equations of state. It allows for plain or Monaghans XSPH integration of the equations of motion. It has options for density continuity or density summation to propagate the density field. It has set command options to set the internal energy and density of particles from the input script and allows the same quantities to be output with thermodynamic output or to dump files via the compute property/atom command. Author: Georg Ganzenmuller (Fraunhofer-Institute for High-Speed Dynamics, Ernst Mach Institute, Germany). Install or un-install: make yes-user-sph make machine make no-user-sph make machine Supporting info: • src/USER-SPH: filenames -> commands • src/USER-SPH/README • doc/PDF/SPH_LAMMPS_userguide.pdf • examples/USER/sph • http://lammps.sandia.gov/movies.html#sph USER-TALLY package Contents: Several compute styles that can be called when pairwise interactions are calculated to tally information (forces, heat flux, energy, stress, etc) about individual interactions. Author: Axel Kohlmeyer (Temple U). 106 LAMMPS Users Manual Install or un-install: make yes-user-tally make machine make no-user-tally make machine Supporting info: • src/USER-TALLY: filenames -> commands • src/USER-TALLY/README • compute */tally • examples/USER/tally USER-UEF package Contents: A fix style for the integration of the equations of motion under extensional flow with proper boundary conditions, as well as several supporting compute styles and an output option. Author: David Nicholson (MIT). Install or un-install: make yes-user-uef make machine make no-user-uef make machine Supporting info: • src/USER-UEF: filenames -> commands • src/USER-UEF/README • fix nvt/uef • fix npt/uef • compute pressure/uef • compute temp/uef • dump cfg/uef • examples/uef USER-VTK package Contents: A dump vtk command which outputs snapshot info in the VTK format, enabling visualization by Paraview or other visualization packages. 107 LAMMPS Users Manual To use this package you must have VTK library available on your system. Authors: Richard Berger (JKU) and Daniel Queteschiner (DCS Computing). Install or un-install: The lib/vtk/Makefile.lammps file has settings for accessing VTK files and its library, which are required for LAMMPS to build and link with this package. If the settings are not valid for your system, check if one of the other lib/vtk/Makefile.lammps.* files is compatible and copy it to Makefile.lammps. If none of the provided files work, you will need to edit the Makefile.lammps file. You can then install/un-install the package and build LAMMPS in the usual manner: make yes-user-vtk make machine make no-user-vtk make machine Supporting info: • src/USER-VTK: filenames -> commands • src/USER-VTK/README • lib/vtk/README • dump vtk 108 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 5. Accelerating LAMMPS performance This section describes various methods for improving LAMMPS performance for different classes of problems running on different kinds of machines. There are two thrusts to the discussion that follows. The first is using code options that implement alternate algorithms that can speed-up a simulation. The second is to use one of the several accelerator packages provided with LAMMPS that contain code optimized for certain kinds of hardware, including multi-core CPUs, GPUs, and Intel Xeon Phi coprocessors. • 5.1 Measuring performance • 5.2 Algorithms and code options to boost performace • 5.3 Accelerator packages with optimized styles • 5.3.1 GPU package • 5.3.2 USER-INTEL package • 5.3.3 KOKKOS package • 5.3.4 USER-OMP package • 5.3.5 OPT package • 5.4 Comparison of various accelerator packages The Benchmark page of the LAMMPS web site gives performance results for the various accelerator packages discussed in Section 5.2, for several of the standard LAMMPS benchmark problems, as a function of problem size and number of compute nodes, on different hardware platforms. 5.1 Measuring performance Before trying to make your simulation run faster, you should understand how it currently performs and where the bottlenecks are. The best way to do this is run the your system (actual number of atoms) for a modest number of timesteps (say 100 steps) on several different processor counts, including a single processor if possible. Do this for an equilibrium version of your system, so that the 100-step timings are representative of a much longer run. There is typically no need to run for 1000s of timesteps to get accurate timings; you can simply extrapolate from short runs. For the set of runs, look at the timing data printed to the screen and log file at the end of each LAMMPS run. This section of the manual has an overview. Running on one (or a few processors) should give a good estimate of the serial performance and what portions of the timestep are taking the most time. Running the same problem on a few different processor counts should give an estimate of parallel scalability. I.e. if the simulation runs 16x faster on 16 processors, its 100% parallel efficient; if it runs 8x faster on 16 processors, it's 50% efficient. 109 LAMMPS Users Manual The most important data to look at in the timing info is the timing breakdown and relative percentages. For example, trying different options for speeding up the long-range solvers will have little impact if they only consume 10% of the run time. If the pairwise time is dominating, you may want to look at GPU or OMP versions of the pair style, as discussed below. Comparing how the percentages change as you increase the processor count gives you a sense of how different operations within the timestep are scaling. Note that if you are running with a Kspace solver, there is additional output on the breakdown of the Kspace time. For PPPM, this includes the fraction spent on FFTs, which can be communication intensive. Another important detail in the timing info are the histograms of atoms counts and neighbor counts. If these vary widely across processors, you have a load-imbalance issue. This often results in inaccurate relative timing data, because processors have to wait when communication occurs for other processors to catch up. Thus the reported times for "Communication" or "Other" may be higher than they really are, due to load-imbalance. If this is an issue, you can uncomment the MPI_Barrier() lines in src/timer.cpp, and recompile LAMMPS, to obtain synchronized timings. 5.2 General strategies NOTE: this section 5.2 is still a work in progress Here is a list of general ideas for improving simulation performance. Most of them are only applicable to certain models and certain bottlenecks in the current performance, so let the timing data you generate be your guide. It is hard, if not impossible, to predict how much difference these options will make, since it is a function of problem size, number of processors used, and your machine. There is no substitute for identifying performance bottlenecks, and trying out various options. • rRESPA • 2-FFT PPPM • Staggered PPPM • single vs double PPPM • partial charge PPPM • verlet/split run style • processor command for proc layout and numa layout • load-balancing: balance and fix balance 2-FFT PPPM, also called analytic differentiation or ad PPPM, uses 2 FFTs instead of the 4 FFTs used by the default ik differentiation PPPM. However, 2-FFT PPPM also requires a slightly larger mesh size to achieve the same accuracy as 4-FFT PPPM. For problems where the FFT cost is the performance bottleneck (typically large problems running on many processors), 2-FFT PPPM may be faster than 4-FFT PPPM. Staggered PPPM performs calculations using two different meshes, one shifted slightly with respect to the other. This can reduce force aliasing errors and increase the accuracy of the method, but also doubles the amount of work required. For high relative accuracy, using staggered PPPM allows one to half the mesh size in each dimension as compared to regular PPPM, which can give around a 4x speedup in the kspace time. However, for low relative accuracy, using staggered PPPM gives little benefit and can be up to 2x slower in the kspace time. For example, the rhodopsin 110 LAMMPS Users Manual benchmark was run on a single processor, and results for kspace time vs. relative accuracy for the different methods are shown in the figure below. For this system, staggered PPPM (using ik differentiation) becomes useful when using a relative accuracy of slightly greater than 1e-5 and above. NOTE: Using staggered PPPM may not give the same increase in accuracy of energy and pressure as it does in forces, so some caution must be used if energy and/or pressure are quantities of interest, such as when using a barostat. 5.3 Packages with optimized styles Accelerated versions of various pair_style, fixes, computes, and other commands have been added to LAMMPS, which will typically run faster than the standard non-accelerated versions. Some require appropriate hardware to be present on your system, e.g. GPUs or Intel Xeon Phi coprocessors. All of these commands are in packages provided with LAMMPS. An overview of packages is give in Section packages. These are the accelerator packages currently in LAMMPS, either as standard or user packages: GPU Package for NVIDIA GPUs as well as OpenCL support USER-INTEL Package for Intel CPUs and Intel Xeon Phi KOKKOS Package for Nvidia GPUs, Intel Xeon Phi, and OpenMP threading USER-OMP Package for OpenMP threading and generic CPU optimizations OPT Package generic CPU optimizations Inverting this list, LAMMPS currently has acceleration support for three kinds of 111 LAMMPS Users Manual hardware, via the listed packages: Many-core CPUs USER-INTEL, KOKKOS, USER-OMP, OPT packages NVIDIA GPUs GPU, KOKKOS packages Intel Phi USER-INTEL, KOKKOS packages Which package is fastest for your hardware may depend on the size problem you are running and what commands (accelerated and non-accelerated) are invoked by your input script. While these doc pages include performance guidelines, there is no substitute for trying out the different packages appropriate to your hardware. Any accelerated style has the same name as the corresponding standard style, except that a suffix is appended. Otherwise, the syntax for the command that uses the style is identical, their functionality is the same, and the numerical results it produces should also be the same, except for precision and round-off effects. For example, all of these styles are accelerated variants of the Lennard-Jones pair_style lj/cut: • pair_style • pair_style • pair_style • pair_style • pair_style lj/cut/gpu lj/cut/intel lj/cut/kk lj/cut/omp lj/cut/opt To see what accelerate styles are currently available, see Section 3.5 of the manual. The doc pages for individual commands (e.g. pair lj/cut or fix nve) also list any accelerated variants available for that style. To use an accelerator package in LAMMPS, and one or more of the styles it provides, follow these general steps. Details vary from package to package and are explained in the individual accelerator doc pages, listed above: build the accelerator library install the accelerator package add compile/link flags to Makefile.machine in src/MAKE re-build LAMMPS prepare and test a regular LAMMPS simulation only for GPU package make yes-opt, make yes-user-intel, etc only for USER-INTEL, KOKKOS, USER-OMP, OPT packages make machine lmp_machine -in in.script; mpirun -np 32 lmp_machine -in in.script enable specific accelerator support via '-k on' only needed for KOKKOS package command-line switch, set any needed options for the package via "-pk" only if defaults need to be changed command-line switch or package command, use accelerated styles in your input via "-sf" lmp_machine -in in.script -sf gpu command-line switch or suffix command Note that the first 4 steps can be done as a single command with suitable make command invocations. This is discussed in Section 4 of the manual, and its use is 112 LAMMPS Users Manual illustrated in the individual accelerator sections. Typically these steps only need to be done once, to create an executable that uses one or more accelerator packages. The last 4 steps can all be done from the command-line when LAMMPS is launched, without changing your input script, as illustrated in the individual accelerator sections. Or you can add package and suffix commands to your input script. NOTE: With a few exceptions, you can build a single LAMMPS executable with all its accelerator packages installed. Note however that the USER-INTEL and KOKKOS packages require you to choose one of their hardware options when building for a specific platform. I.e. CPU or Phi option for the USER-INTEL package. Or the OpenMP, Cuda, or Phi option for the KOKKOS package. These are the exceptions. You cannot build a single executable with: • both the USER-INTEL Phi and KOKKOS Phi options • the USER-INTEL Phi or Kokkos Phi option, and the GPU package See the examples/accelerate/README and make.list files for sample Make.py commands that build LAMMPS with any or all of the accelerator packages. As an example, here is a command that builds with all the GPU related packages installed (GPU, KOKKOS with Cuda), including settings to build the needed auxiliary GPU libraries for Kepler GPUs: Make.py -j 16 -p omp gpu kokkos -cc nvcc wrap=mpi -gpu mode=double arch=35 -kokkos cuda arch= The examples/accelerate directory also has input scripts that can be used with all of the accelerator packages. See its README file for details. Likewise, the bench directory has FERMI and KEPLER and PHI sub-directories with Make.py commands and input scripts for using all the accelerator packages on various machines. See the README files in those dirs. As mentioned above, the Benchmark page of the LAMMPS web site gives performance results for the various accelerator packages for several of the standard LAMMPS benchmark problems, as a function of problem size and number of compute nodes, on different hardware platforms. Here is a brief summary of what the various packages provide. Details are in the individual accelerator sections. • Styles with a "gpu" suffix are part of the GPU package, and can be run on NVIDIA GPUs. The speed-up on a GPU depends on a variety of factors, discussed in the accelerator sections. • Styles with an "intel" suffix are part of the USER-INTEL package. These styles support vectorized single and mixed precision calculations, in addition to full double precision. In extreme cases, this can provide speedups over 3.5x on CPUs. The package also supports acceleration in "offload" mode to Intel(R) Xeon Phi(TM) coprocessors. This can result in additional speedup over 2x depending on the hardware configuration. 113 LAMMPS Users Manual • Styles with a "kk" suffix are part of the KOKKOS package, and can be run using OpenMP on multicore CPUs, on an NVIDIA GPU, or on an Intel Xeon Phi in "native" mode. The speed-up depends on a variety of factors, as discussed on the KOKKOS accelerator page. • Styles with an "omp" suffix are part of the USER-OMP package and allow a pair-style to be run in multi-threaded mode using OpenMP. This can be useful on nodes with high-core counts when using less MPI processes than cores is advantageous, e.g. when running with PPPM so that FFTs are run on fewer MPI processors or when the many MPI tasks would overload the available bandwidth for communication. • Styles with an "opt" suffix are part of the OPT package and typically speed-up the pairwise calculations of your simulation by 5-25% on a CPU. The individual accelerator package doc pages explain: • what hardware and software the accelerated package requires • how to build LAMMPS with the accelerated package • how to run with the accelerated package either via command-line switches or modifying the input script • speed-ups to expect • guidelines for best performance • restrictions 5.4 Comparison of various accelerator packages NOTE: this section still needs to be re-worked with additional KOKKOS and USER-INTEL information. The next section compares and contrasts the various accelerator options, since there are multiple ways to perform OpenMP threading, run on GPUs, and run on Intel Xeon Phi coprocessors. All 3 of these packages accelerate a LAMMPS calculation using NVIDIA hardware, but they do it in different ways. As a consequence, for a particular simulation on specific hardware, one package may be faster than the other. We give guidelines below, but the best way to determine which package is faster for your input script is to try both of them on your machine. See the benchmarking section below for examples where this has been done. Guidelines for using each package optimally: • The GPU package allows you to assign multiple CPUs (cores) to a single GPU (a common configuration for "hybrid" nodes that contain multicore CPU(s) and GPU(s)) and works effectively in this mode. • The GPU package moves per-atom data (coordinates, forces) back-and-forth between the CPU and GPU every timestep. The KOKKOS/CUDA package only does this on timesteps when a CPU calculation is required (e.g. to invoke a fix or compute that is non-GPU-ized). Hence, if you can formulate your input script to only use GPU-ized fixes and computes, and avoid doing I/O too often (thermo output, dump file snapshots, restart files), then the data transfer cost of the 114 LAMMPS Users Manual KOKKOS/CUDA package can be very low, causing it to run faster than the GPU package. • The GPU package is often faster than the KOKKOS/CUDA package, if the number of atoms per GPU is smaller. The crossover point, in terms of atoms/GPU at which the KOKKOS/CUDA package becomes faster depends strongly on the pair style. For example, for a simple Lennard Jones system the crossover (in single precision) is often about 50K-100K atoms per GPU. When performing double precision calculations the crossover point can be significantly smaller. • Both packages compute bonded interactions (bonds, angles, etc) on the CPU. If the GPU package is running with several MPI processes assigned to one GPU, the cost of computing the bonded interactions is spread across more CPUs and hence the GPU package can run faster. • When using the GPU package with multiple CPUs assigned to one GPU, its performance depends to some extent on high bandwidth between the CPUs and the GPU. Hence its performance is affected if full 16 PCIe lanes are not available for each GPU. In HPC environments this can be the case if S2050/70 servers are used, where two devices generally share one PCIe 2.0 16x slot. Also many multi-GPU mainboards do not provide full 16 lanes to each of the PCIe 2.0 16x slots. Differences between the two packages: • The GPU package accelerates only pair force, neighbor list, and PPPM calculations. • The GPU package requires neighbor lists to be built on the CPU when using exclusion lists, hybrid pair styles, or a triclinic simulation box. 115 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands Return to Section accelerate overview 5.3.1 GPU package The GPU package was developed by Mike Brown at ORNL and his collaborators, particularly Trung Nguyen (ORNL). It provides GPU versions of many pair styles, including the 3-body Stillinger-Weber pair style, and for kspace_style pppm for long-range Coulombics. It has the following general features: • It is designed to exploit common GPU hardware configurations where one or more GPUs are coupled to many cores of one or more multi-core CPUs, e.g. within a node of a parallel machine. • Atom-based data (e.g. coordinates, forces) moves back-and-forth between the CPU(s) and GPU every timestep. • Neighbor lists can be built on the CPU or on the GPU • The charge assignment and force interpolation portions of PPPM can be run on the GPU. The FFT portion, which requires MPI communication between processors, runs on the CPU. • Asynchronous force computations can be performed simultaneously on the CPU(s) and GPU. • It allows for GPU computations to be performed in single or double precision, or in mixed-mode precision, where pairwise forces are computed in single precision, but accumulated into double-precision force vectors. • LAMMPS-specific code is in the GPU package. It makes calls to a generic GPU library in the lib/gpu directory. This library provides NVIDIA support as well as more general OpenCL support, so that the same functionality can eventually be supported on a variety of GPU hardware. Here is a quick overview of how to enable and use the GPU package: • build the library in lib/gpu for your GPU hardware with the desired precision settings • install the GPU package and build LAMMPS as usual • use the mpirun command to set the number of MPI tasks/node which determines the number of MPI tasks/GPU • specify the # of GPUs per node • use GPU styles in your input script The latter two steps can be done using the "-pk gpu" and "-sf gpu" command-line switches respectively. Or the effect of the "-pk" or "-sf" switches can be duplicated by adding the package gpu or suffix gpu commands respectively to your input script. Required hardware/software: To use this package, you currently need to have an NVIDIA GPU and install the NVIDIA CUDA software on your system: • Check if you have an NVIDIA GPU: cat /proc/driver/nvidia/gpus/0/information 116 LAMMPS Users Manual • Go to http://www.nvidia.com/object/cuda_get.html • Install a driver and toolkit appropriate for your system (SDK is not necessary) • Run lammps/lib/gpu/nvc_get_devices (after building the GPU library, see below) to list supported devices and properties Building LAMMPS with the GPU package: This requires two steps (a,b): build the GPU library, then build LAMMPS with the GPU package. You can do both these steps in one line as described in Section 4 of the manual. Or you can follow these two (a,b) steps: (a) Build the GPU library The GPU library is in lammps/lib/gpu. Select a Makefile.machine (in lib/gpu) appropriate for your system. You should pay special attention to 3 settings in this makefile. • CUDA_HOME = needs to be where NVIDIA CUDA software is installed on your system • CUDA_ARCH = needs to be appropriate to your GPUs • CUDA_PREC = precision (double, mixed, single) you desire See lib/gpu/Makefile.linux.double for examples of the ARCH settings for different GPU choices, e.g. Fermi vs Kepler. It also lists the possible precision settings: CUDA_PREC = -D_SINGLE_SINGLE CUDA_PREC = -D_DOUBLE_DOUBLE CUDA_PREC = -D_SINGLE_DOUBLE # single precision for all calculations # double precision for all calculations # accumulation of forces, etc, in double The last setting is the mixed mode referred to above. Note that your GPU must support double precision to use either the 2nd or 3rd of these settings. To build the library, type: make -f Makefile.machine If successful, it will produce the files libgpu.a and Makefile.lammps. The latter file has 3 settings that need to be appropriate for the paths and settings for the CUDA system software on your machine. Makefile.lammps is a copy of the file specified by the EXTRAMAKE setting in Makefile.machine. You can change EXTRAMAKE or create your own Makefile.lammps.machine if needed. Note that to change the precision of the GPU library, you need to re-build the entire library. Do a "clean" first, e.g. "make -f Makefile.linux clean", followed by the make command above. (b) Build LAMMPS with the GPU package 117 LAMMPS Users Manual cd lammps/src make yes-gpu make machine No additional compile/link flags are needed in Makefile.machine. Note that if you change the GPU library precision (discussed above) and rebuild the GPU library, then you also need to re-install the GPU package and re-build LAMMPS, so that all affected files are re-compiled and linked to the new GPU library. Run with the GPU package from the command line: The mpirun or mpiexec command sets the total number of MPI tasks used by LAMMPS (one or multiple per compute node) and the number of MPI tasks used per node. E.g. the mpirun command in MPICH does this via its -np and -ppn switches. Ditto for OpenMPI via -np and -npernode. When using the GPU package, you cannot assign more than one GPU to a single MPI task. However multiple MPI tasks can share the same GPU, and in many cases it will be more efficient to run this way. Likewise it may be more efficient to use less MPI tasks/node than the available # of CPU cores. Assignment of multiple MPI tasks to a GPU will happen automatically if you create more MPI tasks/node than there are GPUs/mode. E.g. with 8 MPI tasks/node and 2 GPUs, each GPU will be shared by 4 MPI tasks. Use the "-sf gpu" command-line switch, which will automatically append "gpu" to styles that support it. Use the "-pk gpu Ng" command-line switch to set Ng = # of GPUs/node to use. lmp_machine -sf gpu -pk gpu 1 -in in.script mpirun -np 12 lmp_machine -sf gpu -pk gpu 2 -in in.script mpirun -np 48 -ppn 12 lmp_machine -sf gpu -pk gpu 2 -in in.script # 1 MPI task uses 1 GPU # 12 MPI tasks share 2 GPUs # ditto on 4 16-core nodes Note that if the "-sf gpu" switch is used, it also issues a default package gpu 1 command, which sets the number of GPUs/node to 1. Using the "-pk" switch explicitly allows for setting of the number of GPUs/node to use and additional options. Its syntax is the same as same as the "package gpu" command. See the package command doc page for details, including the default values used for all its options if it is not specified. Note that the default for the package gpu command is to set the Newton flag to "off" pairwise interactions. It does not affect the setting for bonded interactions (LAMMPS default is "on"). The "off" setting for pairwise interaction is currently required for GPU package pair styles. Or run with the GPU package by editing an input script: The discussion above for the mpirun/mpiexec command, MPI tasks/node, and use of multiple MPI tasks/GPU is the same. 118 LAMMPS Users Manual Use the suffix gpu command, or you can explicitly add an "gpu" suffix to individual styles in your input script, e.g. pair_style lj/cut/gpu 2.5 You must also use the package gpu command to enable the GPU package, unless the "-sf gpu" or "-pk gpu" command-line switches were used. It specifies the number of GPUs/node to use, as well as other options. Speed-ups to expect: The performance of a GPU versus a multi-core CPU is a function of your hardware, which pair style is used, the number of atoms/GPU, and the precision used on the GPU (double, single, mixed). See the Benchmark page of the LAMMPS web site for performance of the GPU package on various hardware, including the Titan HPC platform at ORNL. You should also experiment with how many MPI tasks per GPU to use to give the best performance for your problem and machine. This is also a function of the problem size and the pair style being using. Likewise, you should experiment with the precision setting for the GPU library to see if single or mixed precision will give accurate results, since they will typically be faster. Guidelines for best performance: • Using multiple MPI tasks per GPU will often give the best performance, as allowed my most multi-core CPU/GPU configurations. • If the number of particles per MPI task is small (e.g. 100s of particles), it can be more efficient to run with fewer MPI tasks per GPU, even if you do not use all the cores on the compute node. • The package gpu command has several options for tuning performance. Neighbor lists can be built on the GPU or CPU. Force calculations can be dynamically balanced across the CPU cores and GPUs. GPU-specific settings can be made which can be optimized for different hardware. See the packakge command doc page for details. • As described by the package gpu command, GPU accelerated pair styles can perform computations asynchronously with CPU computations. The "Pair" time reported by LAMMPS will be the maximum of the time required to complete the CPU pair style computations and the time required to complete the GPU pair style computations. Any time spent for GPU-enabled pair styles for computations that run simultaneously with bond, angle, dihedral, improper, and long-range calculations will not be included in the "Pair" time. • When the mode setting for the package gpu command is force/neigh, the time for neighbor list calculations on the GPU will be added into the "Pair" time, not the "Neigh" time. An additional breakdown of the times required for various tasks on the GPU (data copy, neighbor calculations, force computations, etc) are output only with the LAMMPS screen output (not in the log file) at the end of each run. These timings represent total time spent on the GPU for each routine, regardless of asynchronous CPU calculations. 119 LAMMPS Users Manual • The output section "GPU Time Info (average)" reports "Max Mem / Proc". This is the maximum memory used at one time on the GPU for data storage by a single MPI process. Restrictions: None. 120 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands Return to Section accelerate overview 5.3.2 USER-INTEL package The USER-INTEL package is maintained by Mike Brown at Intel Corporation. It provides two methods for accelerating simulations, depending on the hardware you have. The first is acceleration on Intel CPUs by running in single, mixed, or double precision with vectorization. The second is acceleration on Intel Xeon Phi coprocessors via offloading neighbor list and non-bonded force calculations to the Phi. The same C++ code is used in both cases. When offloading to a coprocessor from a CPU, the same routine is run twice, once on the CPU and once with an offload flag. This allows LAMMPS to run on the CPU cores and coprocessor cores simultaneously. Currently Available USER-INTEL Styles: • Angle Styles: charmm, harmonic • Bond Styles: fene, fourier, harmonic • Dihedral Styles: charmm, harmonic, opls • Fixes: nve, npt, nvt, nvt/sllod, nve/asphere • Improper Styles: cvff, harmonic • Pair Styles: airebo, airebo/morse, buck/coul/cut, buck/coul/long, buck, dpd, eam, eam/alloy, eam/fs, gayberne, lj/charmm/coul/charmm, lj/charmm/coul/long, lj/cut, lj/cut/coul/long, lj/long/coul/long, rebo, sw, tersoff • K-Space Styles: pppm, pppm/disp Speed-ups to expect: The speedups will depend on your simulation, the hardware, which styles are used, the number of atoms, and the floating-point precision mode. Performance improvements are shown compared to LAMMPS without using other acceleration packages as these are under active development (and subject to performance changes). The measurements were performed using the input files available in the src/USER-INTEL/TEST directory with the provided run script. These are scalable in size; the results given are with 512K particles (524K for Liquid Crystal). Most of the simulations are standard LAMMPS benchmarks (indicated by the filename extension in parenthesis) with modifications to the run length and to add a warmup run (for use with offload benchmarks). 121 LAMMPS Users Manual Results are speedups obtained on Intel Xeon E5-2697v4 processors (code-named Broadwell), Intel Xeon Phi 7250 processors (code-named Knights Landing), and Intel Xeon Gold 6148 processors (code-named Skylake) with "June 2017" LAMMPS built with Intel Parallel Studio 2017 update 2. Results are with 1 MPI task per physical core. See src/USER-INTEL/TEST/README for the raw simulation rates and instructions to reproduce. Accuracy and order of operations: In most molecular dynamics software, parallelization parameters (# of MPI, OpenMP, and vectorization) can change the results due to changing the order of operations with finite-precision calculations. The USER-INTEL package is deterministic. This means that the results should be reproducible from run to run with the same parallel configurations and when using determinstic libraries or library settings (MPI, OpenMP, FFT). However, there are differences in the USER-INTEL package that can change the order of operations compared to LAMMPS without acceleration: • Neighbor lists can be created in a different order • Bins used for sorting atoms can be oriented differently • The default stencil order for PPPM is 7. By default, LAMMPS will calculate other PPPM parameters to fit the desired accuracy with this order • The newton setting applies to all atoms, not just atoms shared between MPI tasks • Vectorization can change the order for adding pairwise forces • When using the -DLMP_USE_MKL_RNG define (all included intel optimized makefiles do) at build time, the random number generator for dissipative particle dynamics (pair style dpd/intel) uses the Mersenne Twister generator included in the Intel MKL library (that should be more robust than the default 122 LAMMPS Users Manual Masaglia random number generator) The precision mode (described below) used with the USER-INTEL package can change the accuracy of the calculations. For the default mixed precision option, calculations between pairs or triplets of atoms are performed in single precision, intended to be within the inherent error of MD simulations. All accumulation is performed in double precision to prevent the error from growing with the number of atoms in the simulation. Single precision mode should not be used without appropriate validation. Quick Start for Experienced Users: LAMMPS should be built with the USER-INTEL package installed. Simulations should be run with 1 MPI task per physical core, not hardware thread. • Edit src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi as necessary. • Set the environment variable KMP_BLOCKTIME=0 • "-pk intel 0 omp$t -sf intel" added to LAMMPS command-line
• $t should be 2 for Intel Xeon CPUs and 2 or 4 for Intel Xeon Phi • For some of the simple 2-body potentials without long-range electrostatics, performance and scalability can be better with the "newton off" setting added to the input script • For simulations on higher node counts, add "processors * * * grid numa" to the beginning of the input script for better scalability • If using kspace_style pppm in the input script, add "kspace_modify diff ad" for better performance For Intel Xeon Phi CPUs: • Runs should be performed using MCDRAM. For simulations using kspace_style pppm on Intel CPUs supporting AVX-512: • Add "kspace_modify diff ad" to the input script • The command-line option should be changed to "-pk intel 0 omp$r lrt yes -sf
intel" where $r is the number of threads minus 1. • Do not use thread affinity (set KMP_AFFINITY=none) • The "newton off" setting may provide better scalability For Intel Xeon Phi coprocessors (Offload): • Edit src/MAKE/OPTIONS/Makefile.intel_coprocessor as necessary • "-pk intel N omp 1" added to command-line where N is the number of coprocessors per node. Required hardware/software: In order to use offload to coprocessors, an Intel Xeon Phi coprocessor and an Intel compiler are required. For this, the recommended version of the Intel compiler is 14.0.1.106 or versions 15.0.2.044 and higher. 123 LAMMPS Users Manual Although any compiler can be used with the USER-INTEL package, currently, vectorization directives are disabled by default when not using Intel compilers due to lack of standard support and observations of decreased performance. The OpenMP standard now supports directives for vectorization and we plan to transition the code to this standard once it is available in most compilers. We expect this to allow improved performance and support with other compilers. For Intel Xeon Phi x200 series processors (code-named Knights Landing), there are multiple configuration options for the hardware. For best performance, we recommend that the MCDRAM is configured in "Flat" mode and with the cluster mode set to "Quadrant" or "SNC4". "Cache" mode can also be used, although the performance might be slightly lower. Notes about Simultaneous Multithreading: Modern CPUs often support Simultaneous Multithreading (SMT). On Intel processors, this is called Hyper-Threading (HT) technology. SMT is hardware support for running multiple threads efficiently on a single core. Hardware threads or logical cores are often used to refer to the number of threads that are supported in hardware. For example, the Intel Xeon E5-2697v4 processor is described as having 36 cores and 72 threads. This means that 36 MPI processes or OpenMP threads can run simultaneously on separate cores, but that up to 72 MPI processes or OpenMP threads can be running on the CPU without costly operating system context switches. Molecular dynamics simulations will often run faster when making use of SMT. If a thread becomes stalled, for example because it is waiting on data that has not yet arrived from memory, another thread can start running so that the CPU pipeline is still being used efficiently. Although benefits can be seen by launching a MPI task for every hardware thread, for multinode simulations, we recommend that OpenMP threads are used for SMT instead, either with the USER-INTEL package, USER-OMP package, or KOKKOS package. In the example above, up to 36X speedups can be observed by using all 36 physical cores with LAMMPS. By using all 72 hardware threads, an additional 10-30% performance gain can be achieved. The BIOS on many platforms allows SMT to be disabled, however, we do not recommend this on modern processors as there is little to no benefit for any software package in most cases. The operating system will report every hardware thread as a separate core allowing one to determine the number of hardware threads available. On Linux systems, this information can normally be obtained with: cat /proc/cpuinfo Building LAMMPS with the USER-INTEL package: NOTE: See the src/USER-INTEL/README file for additional flags that might be needed for best performance on Intel server processors code-named "Skylake". The USER-INTEL package must be installed into the source directory: make yes-user-intel 124 LAMMPS Users Manual Several example Makefiles for building with the Intel compiler are included with LAMMPS in the src/MAKE/OPTIONS/ directory: Makefile.intel_cpu_intelmpi Makefile.knl Makefile.intel_cpu_mpich Makefile.intel_cpu_openpmi Makefile.intel_coprocessor # # # # # Intel Intel Intel Intel Intel Compiler, Compiler, Compiler, Compiler, Compiler, Intel MPI, No Offload Intel MPI, No Offload MPICH, No Offload OpenMPI, No Offload Intel MPI, Offload Makefile.knl is identical to Makefile.intel_cpu_intelmpi except that it explicitly specifies that vectorization should be for Intel Xeon Phi x200 processors making it easier to cross-compile. For users with recent installations of Intel Parallel Studio, the process can be as simple as: make yes-user-intel source /opt/intel/parallel_studio_xe_2016.3.067/psxevars.sh # or psxevars.csh for C-shell make intel_cpu_intelmpi Alternatively this can be done as a single command with suitable make command invocations. This is discussed in Section 4 of the manual. Note that if you build with support for a Phi coprocessor, the same binary can be used on nodes with or without coprocessors installed. However, if you do not have coprocessors on your system, building without offload support will produce a smaller binary. The general requirements for Makefiles with the USER-INTEL package are as follows. When using Intel compilers, "-restrict" is required and "-qopenmp" is highly recommended for CCFLAGS and LINKFLAGS. CCFLAGS should include "-DLMP_INTEL_USELRT" (unless POSIX Threads are not supported in the build environment) and "-DLMP_USE_MKL_RNG" (unless Intel Math Kernel Library (MKL) is not available in the build environment). For Intel compilers, LIB should include "-ltbbmalloc" or if the library is not available, "-DLMP_INTEL_NO_TBB" can be added to CCFLAGS. For builds supporting offload, "-DLMP_INTEL_OFFLOAD" is required for CCFLAGS and "-qoffload" is required for LINKFLAGS. Other recommended CCFLAG options for best performance are "-O2 -fno-alias -ansi-alias -qoverride-limits fp-model fast=2 -no-prec-div". NOTE: The vectorization and math capabilities can differ depending on the CPU. For Intel compilers, the "-x" flag specifies the type of processor for which to optimize. "-xHost" specifies that the compiler should build for the processor used for compiling. For Intel Xeon Phi x200 series processors, this option is "-xMIC-AVX512". For fourth generation Intel Xeon (v4/Broadwell) processors, "-xCORE-AVX2" should be used. For older Intel Xeon processors, "-xAVX" will perform best in general for the different simulations in LAMMPS. The default in most of the example Makefiles is to use "-xHost", however this should not be used when cross-compiling. Running LAMMPS with the USER-INTEL package: Running LAMMPS with the USER-INTEL package is similar to normal use with the exceptions that one should 1) specify that LAMMPS should use the USER-INTEL 125 LAMMPS Users Manual package, 2) specify the number of OpenMP threads, and 3) optionally specify the specific LAMMPS styles that should use the USER-INTEL package. 1) and 2) can be performed from the command-line or by editing the input script. 3) requires editing the input script. Advanced performance tuning options are also described below to get the best performance. When running on a single node (including runs using offload to a coprocessor), best performance is normally obtained by using 1 MPI task per physical core and additional OpenMP threads with SMT. For Intel Xeon processors, 2 OpenMP threads should be used for SMT. For Intel Xeon Phi CPUs, 2 or 4 OpenMP threads should be used (best choice depends on the simulation). In cases where the user specifies that LRT mode is used (described below), 1 or 3 OpenMP threads should be used. For multi-node runs, using 1 MPI task per physical core will often perform best, however, depending on the machine and scale, users might get better performance by decreasing the number of MPI tasks and using more OpenMP threads. For performance, the product of the number of MPI tasks and OpenMP threads should not exceed the number of available hardware threads in almost all cases. NOTE: Setting core affinity is often used to pin MPI tasks and OpenMP threads to a core or group of cores so that memory access can be uniform. Unless disabled at build time, affinity for MPI tasks and OpenMP threads on the host (CPU) will be set by default on the host when using offload to a coprocessor. In this case, it is unnecessary to use other methods to control affinity (e.g. taskset, numactl, I_MPI_PIN_DOMAIN, etc.). This can be disabled with the no_affinity option to the package intel command or by disabling the option at build time (by adding -DINTEL_OFFLOAD_NOAFFINITY to the CCFLAGS line of your Makefile). Disabling this option is not recommended, especially when running on a machine with Intel Hyper-Threading technology disabled. Run with the USER-INTEL package from the command line: To enable USER-INTEL optimizations for all available styles used in the input script, the "-sf intel" command-line switch can be used without any requirement for editing the input script. This switch will automatically append "intel" to styles that support it. It also invokes a default command: package intel 1. This package command is used to set options for the USER-INTEL package. The default package command will specify that USER-INTEL calculations are performed in mixed precision, that the number of OpenMP threads is specified by the OMP_NUM_THREADS environment variable, and that if coprocessors are present and the binary was built with offload support, that 1 coprocessor per node will be used with automatic balancing of work between the CPU and the coprocessor. You can specify different options for the USER-INTEL package by using the "-pk intel Nphi" command-line switch with keyword/value pairs as specified in the documentation. Here, Nphi = # of Xeon Phi coprocessors/node (ignored without offload support). Common options to the USER-INTEL package include omp to override any OMP_NUM_THREADS setting and specify the number of OpenMP threads, mode to set the floating-point precision mode, and lrt to enable Long-Range Thread mode as described below. See the package intel command for details, including the default values used for all its options if not specified, and how to set the number of OpenMP threads via the OMP_NUM_THREADS environment variable if 126 LAMMPS Users Manual desired. Examples (see documentation for your MPI/Machine for differences in launching MPI applications): mpirun -np 72 -ppn 36 lmp_machine -sf intel -in in.script mpirun -np 72 -ppn 36 lmp_machine -sf intel -in in.script -pk intel 0 omp 2 mode double Or run with the USER-INTEL package by editing an input script: As an alternative to adding command-line arguments, the input script can be edited to enable the USER-INTEL package. This requires adding the package intel command to the top of the input script. For the second example above, this would be: package intel 0 omp 2 mode double To enable the USER-INTEL package only for individual styles, you can add an "intel" suffix to the individual style, e.g.: pair_style lj/cut/intel 2.5 Alternatively, the suffix intel command can be added to the input script to enable USER-INTEL styles for the commands that follow in the input script. Tuning for Performance: NOTE: The USER-INTEL package will perform better with modifications to the input script when PPPM is used: kspace_modify diff ad should be added to the input script. Long-Range Thread (LRT) mode is an option to the package intel command that can improve performance when using PPPM for long-range electrostatics on processors with SMT. It generates an extra pthread for each MPI task. The thread is dedicated to performing some of the PPPM calculations and MPI communications. This feature requires setting the preprocessor flag -DLMP_INTEL_USELRT in the makefile when compiling LAMMPS. It is unset in the default makefiles (Makefile.mpi and Makefile.serial) but it is set in all makefiles tuned for the USER-INTEL package. On Intel Xeon Phi x200 series CPUs, the LRT feature will likely improve performance, even on a single node. On Intel Xeon processors, using this mode might result in better performance when using multiple nodes, depending on the specific machine configuration. To enable LRT mode, specify that the number of OpenMP threads is one less than would normally be used for the run and add the "lrt yes" option to the "-pk" command-line suffix or "package intel" command. For example, if a run would normally perform best with "-pk intel 0 omp 4", instead use "-pk intel 0 omp 3 lrt yes". When using LRT, you should set the environment variable "KMP_AFFINITY=none". LRT mode is not supported when using offload. NOTE: Changing the newton setting to off can improve performance and/or scalability for simple 2-body potentials such as lj/cut or when using LRT mode on processors supporting AVX-512. Not all styles are supported in the USER-INTEL package. You can mix the 127 # 2 n # Don LAMMPS Users Manual USER-INTEL package with styles from the OPT package or the USER-OMP package. Of course, this requires that these packages were installed at build time. This can performed automatically by using "-sf hybrid intel opt" or "-sf hybrid intel omp" command-line options. Alternatively, the "opt" and "omp" suffixes can be appended manually in the input script. For the latter, the package omp command must be in the input script or the "-pk omp Nt" command-line switch must be used where Nt is the number of OpenMP threads. The number of OpenMP threads should not be set differently for the different packages. Note that the suffix hybrid intel omp command can also be used within the input script to automatically append the "omp" suffix to styles when USER-INTEL styles are not available. NOTE: For simulations on higher node counts, add processors * * * grid numa to the beginning of the input script for better scalability. When running on many nodes, performance might be better when using fewer OpenMP threads and more MPI tasks. This will depend on the simulation and the machine. Using the verlet/split run style might also give better performance for simulations with PPPM electrostatics. Note that this is an alternative to LRT mode and the two cannot be used together. Currently, when using Intel MPI with Intel Xeon Phi x200 series CPUs, better performance might be obtained by setting the environment variable "I_MPI_SHM_LMT=shm" for Linux kernels that do not yet have full support for AVX-512. Runs on Intel Xeon Phi x200 series processors will always perform better using MCDRAM. Please consult your system documentation for the best approach to specify that MPI runs are performed in MCDRAM. Tuning for Offload Performance: The default settings for offload should give good performance. When using LAMMPS with offload to Intel coprocessors, best performance will typically be achieved with concurrent calculations performed on both the CPU and the coprocessor. This is achieved by offloading only a fraction of the neighbor and pair computations to the coprocessor or using hybrid pair styles where only one style uses the "intel" suffix. For simulations with long-range electrostatics or bond, angle, dihedral, improper calculations, computation and data transfer to the coprocessor will run concurrently with computations and MPI communications for these calculations on the host CPU. This is illustrated in the figure below for the rhodopsin protein benchmark running on E5-2697v2 processors with a Intel Xeon Phi 7120p coprocessor. In this plot, the vertical access is time and routines running at the same time are running concurrently on both the host and the coprocessor. 128 LAMMPS Users Manual The fraction of the offloaded work is controlled by the balance keyword in the package intel command. A balance of 0 runs all calculations on the CPU. A balance of 1 runs all supported calculations on the coprocessor. A balance of 0.5 runs half of the calculations on the coprocessor. Setting the balance to -1 (the default) will enable dynamic load balancing that continously adjusts the fraction of offloaded work throughout the simulation. Because data transfer cannot be timed, this option typically produces results within 5 to 10 percent of the optimal fixed balance. If running short benchmark runs with dynamic load balancing, adding a short warm-up run (10-20 steps) will allow the load-balancer to find a near-optimal setting that will carry over to additional runs. The default for the package intel command is to have all the MPI tasks on a given compute node use a single Xeon Phi coprocessor. In general, running with a large number of MPI tasks on each node will perform best with offload. Each MPI task will automatically get affinity to a subset of the hardware threads available on the coprocessor. For example, if your card has 61 cores, with 60 cores available for offload and 4 hardware threads per core (240 total threads), running with 24 MPI tasks per node will cause each MPI task to use a subset of 10 threads on the coprocessor. Fine tuning of the number of threads to use per MPI task or the number of threads to use per core can be accomplished with keyword settings of the package intel command. The USER-INTEL package has two modes for deciding which atoms will be handled by the coprocessor. This choice is controlled with the ghost keyword of the package intel command. When set to 0, ghost atoms (atoms at the borders between MPI tasks) are not offloaded to the card. This allows for overlap of MPI communication of forces with computation on the coprocessor when the newton setting is "on". The default is dependent on the style being used, however, better performance may be achieved by 129 LAMMPS Users Manual setting this option explicitly. When using offload with CPU Hyper-Threading disabled, it may help performance to use fewer MPI tasks and OpenMP threads than available cores. This is due to the fact that additional threads are generated internally to handle the asynchronous offload tasks. If pair computations are being offloaded to an Intel Xeon Phi coprocessor, a diagnostic line is printed to the screen (not to the log file), during the setup phase of a run, indicating that offload mode is being used and indicating the number of coprocessor threads per MPI task. Additionally, an offload timing summary is printed at the end of each run. When offloading, the frequency for atom sorting is changed to 1 so that the per-atom data is effectively sorted at every rebuild of the neighbor lists. All the available coprocessor threads on each Phi will be divided among MPI tasks, unless the tptask option of the "-pk intel" command-line switch is used to limit the coprocessor threads per MPI task. Restrictions: When offloading to a coprocessor, hybrid styles that require skip lists for neighbor builds cannot be offloaded. Using hybrid/overlay is allowed. Only one intel accelerated style may be used with hybrid styles. Special_bonds exclusion lists are not currently supported with offload, however, the same effect can often be accomplished by setting cutoffs for excluded atom types to 0. None of the pair styles in the USER-INTEL package currently support the "inner", "middle", "outer" options for rRESPA integration via the run_style respa command; only the "pair" option is supported. References: • Brown, W.M., Carrillo, J.-M.Y., Mishra, B., Gavhane, N., Thakker, F.M., De Kraker, A.R., Yamada, M., Ang, J.A., Plimpton, S.J., "Optimizing Classical Molecular Dynamics in LAMMPS," in Intel Xeon Phi Processor High Performance Programming: Knights Landing Edition, J. Jeffers, J. Reinders, A. Sodani, Eds. Morgan Kaufmann. • Brown, W. M., Semin, A., Hebenstreit, M., Khvostov, S., Raman, K., Plimpton, S.J. Increasing Molecular Dynamics Simulation Rates with an 8-Fold Increase in Electrical Power Efficiency. 2016 High Performance Computing, Networking, Storage and Analysis, SC16: International Conference (pp. 82-95). • Brown, W.M., Carrillo, J.-M.Y., Gavhane, N., Thakkar, F.M., Plimpton, S.J. Optimizing Legacy Molecular Dynamics Software with Directive-Based Offload. Computer Physics Communications. 2015. 195: p. 95-101. 130 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands Return to Section accelerate overview 5.3.3 KOKKOS package Kokkos is a templated C++ library that provides abstractions to allow a single implementation of an application kernel (e.g. a pair style) to run efficiently on different kinds of hardware, such as GPUs, Intel Xeon Phis, or many-core CPUs. Kokkos maps the C++ kernel onto different backend languages such as CUDA, OpenMP, or Pthreads. The Kokkos library also provides data abstractions to adjust (at compile time) the memory layout of data structures like 2d and 3d arrays to optimize performance on different hardware. For more information on Kokkos, see Github. Kokkos is part of Trilinos. The Kokkos library was written primarily by Carter Edwards, Christian Trott, and Dan Sunderland (all Sandia). The LAMMPS KOKKOS package contains versions of pair, fix, and atom styles that use data structures and macros provided by the Kokkos library, which is included with LAMMPS in /lib/kokkos. The KOKKOS package was developed primarily by Christian Trott (Sandia) and Stan Moore (Sandia) with contributions of various styles by others, including Sikandar Mashayak (UIUC), Ray Shan (Sandia), and Dan Ibanez (Sandia). For more information on developing using Kokkos abstractions see the Kokkos programmers' guide at /lib/kokkos/doc/Kokkos_PG.pdf. Kokkos currently provides support for 3 modes of execution (per MPI task). These are Serial (MPI-only for CPUs and Intel Phi), OpenMP (threading for many-core CPUs and Intel Phi), and CUDA (for NVIDIA GPUs). You choose the mode at build time to produce an executable compatible with specific hardware. Building LAMMPS with the KOKKOS package: NOTE: Kokkos support within LAMMPS must be built with a C++11 compatible compiler. This means GCC version 4.7.2 or later, Intel 14.0.4 or later, or Clang 3.5.2 or later is required. The recommended method of building the KOKKOS package is to start with the provided Kokkos Makefiles in /src/MAKE/OPTIONS/. You may need to modify the KOKKOS_ARCH variable in the Makefile to match your specific hardware. For example: • for • for • for • for Sandy Bridge CPUs, set KOKKOS_ARCH=SNB Broadwell CPUs, set KOKKOS_ARCH=BWD K80 GPUs, set KOKKOS_ARCH=Kepler37 P100 GPUs and Power8 CPUs, set KOKKOS_ARCH=Pascal60,Power8 See the Advanced Kokkos Options section below for a listing of all KOKKOS_ARCH options. Compile for CPU-only (MPI only, no threading): 131 LAMMPS Users Manual use a C++11 compatible compiler and set KOKKOS_ARCH variable in /src/MAKE/OPTIONS/Makefile.kokkos_mpi_only as described above. Then do the following: cd lammps/src make yes-kokkos make kokkos_mpi_only Compile for CPU-only (MPI plus OpenMP threading): NOTE: To build with Kokkos support for OpenMP threading, your compiler must support the OpenMP interface. You should have one or more multi-core CPUs so that multiple threads can be launched by each MPI task running on a CPU. use a C++11 compatible compiler and set KOKKOS_ARCH variable in /src/MAKE/OPTIONS/Makefile.kokkos_omp as described above. Then do the following: cd lammps/src make yes-kokkos make kokkos_omp Compile for Intel KNL Xeon Phi (Intel Compiler, OpenMPI): use a C++11 compatible compiler and do the following: cd lammps/src make yes-kokkos make kokkos_phi Compile for CPUs and GPUs (with OpenMPI or MPICH): NOTE: To build with Kokkos support for NVIDIA GPUs, NVIDIA CUDA software version 7.5 or later must be installed on your system. See the discussion for the GPU package for details of how to check and do this. use a C++11 compatible compiler and set KOKKOS_ARCH variable in /src/MAKE/OPTIONS/Makefile.kokkos_cuda_mpi for both GPU and CPU as described above. Then do the following: cd lammps/src make yes-kokkos make kokkos_cuda_mpi Alternative Methods of Compiling: Alternatively, the KOKKOS package can be built by specifying Kokkos variables on the make command line. For example: make mpi KOKKOS_DEVICES=OpenMP KOKKOS_ARCH=SNB make kokkos_cuda_mpi KOKKOS_ARCH=Pascal60,Power8 # set the KOKKOS_DEVICES and KOKKOS_ARCH var # set the KOKKOS_ARCH variable explicitly Setting the KOKKOS_DEVICES and KOKKOS_ARCH variables on the make command line requires a GNU-compatible make command. Try "gmake" if your system's 132 LAMMPS Users Manual standard make complains. NOTE: If you build using make line variables and re-build LAMMPS twice with different KOKKOS options and the *same* target, then you *must* perform a "make clean-all" or "make clean-machine" before each build. This is to force all the KOKKOS-dependent files to be re-compiled with the new options. Running LAMMPS with the KOKKOS package: All Kokkos operations occur within the context of an individual MPI task running on a single node of the machine. The total number of MPI tasks used by LAMMPS (one or multiple per compute node) is set in the usual manner via the mpirun or mpiexec commands, and is independent of Kokkos. E.g. the mpirun command in OpenMPI does this via its -np and -npernode switches. Ditto for MPICH via -np and -ppn. Running on a multi-core CPU: Here is a quick overview of how to use the KOKKOS package for CPU acceleration, assuming one or more 16-core nodes. mpirun mpirun mpirun mpirun -np -np -np -np 16 lmp_kokkos_mpi_only -k on -sf kk -in in.lj 2 -ppn 1 lmp_kokkos_omp -k on t 16 -sf kk -in in.lj 2 lmp_kokkos_omp -k on t 8 -sf kk -in in.lj 32 -ppn 4 lmp_kokkos_omp -k on t 4 -sf kk -in in.lj # # # # 1 2 1 8 node, 16 nodes, 1 node, 2 nodes, 4 MPI MPI MPI MPI tasks/node, no task/node, 16 tasks/node, 8 tasks/node, 4 To run using the KOKKOS package, use the "-k on", "-sf kk" and "-pk kokkos" command-line switches in your mpirun command. You must use the "-k on" command-line switch to enable the KOKKOS package. It takes additional arguments for hardware settings appropriate to your system. Those arguments are documented here. For OpenMP use: -k on t Nt The "t Nt" option specifies how many OpenMP threads per MPI task to use with a node. The default is Nt = 1, which is MPI-only mode. Note that the product of MPI tasks * OpenMP threads/task should not exceed the physical number of cores (on a node), otherwise performance will suffer. If hyperthreading is enabled, then the product of MPI tasks * OpenMP threads/task should not exceed the physical number of cores * hardware threads. The "-k on" switch also issues a "package kokkos" command (with no additional arguments) which sets various KOKKOS options to default values, as discussed on the package command doc page. The "-sf kk" command-line switch will automatically append the "/kk" suffix to styles that support it. In this manner no modification to the input script is needed. Alternatively, one can run with the KOKKOS package by editing the input script as described below. NOTE: The default for the package kokkos command is to use "full" neighbor lists and set the Newton flag to "off" for both pairwise and bonded interactions. However, when running on CPUs, it will typically be faster to use "half" neighbor lists and set the Newton flag to "on", just as is the case for non-accelerated pair styles. It can also be faster to use non-threaded communication. Use the "-pk kokkos" command-line switch 133 LAMMPS Users Manual to change the default package kokkos options. See its doc page for details and default settings. Experimenting with its options can provide a speed-up for specific calculations. For example: mpirun -np 16 lmp_kokkos_mpi_only -k on -sf kk -pk kokkos newton on neigh half comm no -in in.l If the newton command is used in the input script, it can also override the Newton flag defaults. Core and Thread Affinity: When using multi-threading, it is important for performance to bind both MPI tasks to physical cores, and threads to physical cores, so they do not migrate during a simulation. If you are not certain MPI tasks are being bound (check the defaults for your MPI installation), binding can be forced with these flags: OpenMPI 1.8: mpirun -np 2 --bind-to socket --map-by socket ./lmp_openmpi ... Mvapich2 2.0: mpiexec -np 2 --bind-to socket --map-by socket ./lmp_mvapich ... For binding threads with KOKKOS OpenMP, use thread affinity environment variables to force binding. With OpenMP 3.1 (gcc 4.7 or later, intel 12 or later) setting the environment variable OMP_PROC_BIND=true should be sufficient. In general, for best performance with OpenMP 4.0 or better set OMP_PROC_BIND=spread and OMP_PLACES=threads. For binding threads with the KOKKOS pthreads option, compile LAMMPS the KOKKOS HWLOC=yes option as described below. Running on Knight's Landing (KNL) Intel Xeon Phi: Here is a quick overview of how to use the KOKKOS package for the Intel Knight's Landing (KNL) Xeon Phi: KNL Intel Phi chips have 68 physical cores. Typically 1 to 4 cores are reserved for the OS, and only 64 or 66 cores are used. Each core has 4 hyperthreads,so there are effectively N = 256 (4*64) or N = 264 (4*66) cores to run on. The product of MPI tasks * OpenMP threads/task should not exceed this limit, otherwise performance will suffer. Note that with the KOKKOS package you do not need to specify how many KNLs there are per node; each KNL is simply treated as running some number of MPI tasks. Examples of mpirun commands that follow these rules are shown below. Intel KNL node with 68 cores (272 threads/node via 4x hardware threading): mpirun -np 64 lmp_kokkos_phi -k on t 4 -sf kk -in in.lj # 1 node, 64 MPI tasks/node, 4 thr mpirun -np 66 lmp_kokkos_phi -k on t 4 -sf kk -in in.lj # 1 node, 66 MPI tasks/node, 4 thr mpirun -np 32 lmp_kokkos_phi -k on t 8 -sf kk -in in.lj # 1 node, 32 MPI tasks/node, 8 thr mpirun -np 512 -ppn 64 lmp_kokkos_phi -k on t 4 -sf kk -in in.lj # 8 nodes, 64 MPI tasks/node, The -np setting of the mpirun command sets the number of MPI tasks/node. The "-k on t Nt" command-line switch sets the number of threads/task as Nt. The product of these two values should be N, i.e. 256 or 264. 134 LAMMPS Users Manual NOTE: The default for the package kokkos command is to use "full" neighbor lists and set the Newton flag to "off" for both pairwise and bonded interactions. When running on KNL, this will typically be best for pair-wise potentials. For manybody potentials, using "half" neighbor lists and setting the Newton flag to "on" may be faster. It can also be faster to use non-threaded communication. Use the "-pk kokkos" command-line switch to change the default package kokkos options. See its doc page for details and default settings. Experimenting with its options can provide a speed-up for specific calculations. For example: mpirun -np 64 lmp_kokkos_phi -k on t 4 -sf kk -pk kokkos comm no -in in.lj # Newton off, mpirun -np 64 lmp_kokkos_phi -k on t 4 -sf kk -pk kokkos newton on neigh half comm no -in in.re NOTE: MPI tasks and threads should be bound to cores as described above for CPUs. NOTE: To build with Kokkos support for Intel Xeon Phi coprocessors such as Knight's Corner (KNC), your system must be configured to use them in "native" mode, not "offload" mode like the USER-INTEL package supports. Running on GPUs: Use the "-k" command-line switch to specify the number of GPUs per node. Typically the -np setting of the mpirun command should set the number of MPI tasks/node to be equal to the # of physical GPUs on the node. You can assign multiple MPI tasks to the same GPU with the KOKKOS package, but this is usually only faster if significant portions of the input script have not been ported to use Kokkos. Using CUDA MPS is recommended in this scenario. As above for multi-core CPUs (and no GPU), if N is the number of physical cores/node, then the number of MPI tasks/node should not exceed N. -k on g Ng Here are examples of how to use the KOKKOS package for GPUs, assuming one or more nodes, each with two GPUs: mpirun -np 2 lmp_kokkos_cuda_openmpi -k on g 2 -sf kk -in in.lj mpirun -np 32 -ppn 2 lmp_kokkos_cuda_openmpi -k on g 2 -sf kk -in in.lj # 1 node, 2 MPI task # 16 nodes, 2 MPI task NOTE: The default for the package kokkos command is to use "full" neighbor lists and set the Newton flag to "off" for both pairwise and bonded interactions, along with threaded communication. When running on Maxwell or Kepler GPUs, this will typically be best. For Pascal GPUs, using "half" neighbor lists and setting the Newton flag to "on" may be faster. For many pair styles, setting the neighbor binsize equal to the ghost atom cutoff will give speedup. Use the "-pk kokkos" command-line switch to change the default package kokkos options. See its doc page for details and default settings. Experimenting with its options can provide a speed-up for specific calculations. For example: mpirun -np 2 lmp_kokkos_cuda_openmpi -k on g 2 -sf kk -pk kokkos binsize 2.8 -in in.lj # S mpirun -np 2 lmp_kokkos_cuda_openmpi -k on g 2 -sf kk -pk kokkos newton on neigh half binsize 2 NOTE: For good performance of the KOKKOS package on GPUs, you must have Kepler generation GPUs (or later). The Kokkos library exploits texture cache options not 135 LAMMPS Users Manual supported by Telsa generation GPUs (or older). NOTE: When using a GPU, you will achieve the best performance if your input script does not use fix or compute styles which are not yet Kokkos-enabled. This allows data to stay on the GPU for multiple timesteps, without being copied back to the host CPU. Invoking a non-Kokkos fix or compute, or performing I/O for thermo or dump output will cause data to be copied back to the CPU incurring a performance penalty. NOTE: To get an accurate timing breakdown between time spend in pair, kspace, etc., you must set the environment variable CUDA_LAUNCH_BLOCKING=1. However, this will reduce performance and is not recommended for production runs. Run with the KOKKOS package by editing an input script: Alternatively the effect of the "-sf" or "-pk" switches can be duplicated by adding the package kokkos or suffix kk commands to your input script. The discussion above for building LAMMPS with the KOKKOS package, the mpirun/mpiexec command, and setting appropriate thread are the same. You must still use the "-k on" command-line switch to enable the KOKKOS package, and specify its additional arguments for hardware options appropriate to your system, as documented above. You can use the suffix kk command, or you can explicitly add a "kk" suffix to individual styles in your input script, e.g. pair_style lj/cut/kk 2.5 You only need to use the package kokkos command if you wish to change any of its option defaults, as set by the "-k on" command-line switch. Using OpenMP threading and CUDA together (experimental): With the KOKKOS package, both OpenMP multi-threading and GPUs can be used together in a few special cases. In the Makefile, the KOKKOS_DEVICES variable must include both "Cuda" and "OpenMP", as is the case for /src/MAKE/OPTIONS/Makefile.kokkos_cuda_mpi KOKKOS_DEVICES=Cuda,OpenMP The suffix "/kk" is equivalent to "/kk/device", and for Kokkos CUDA, using the "-sf kk" in the command line gives the default CUDA version everywhere. However, if the "/kk/host" suffix is added to a specific style in the input script, the Kokkos OpenMP (CPU) version of that specific style will be used instead. Set the number of OpenMP threads as "t Nt" and the number of GPUs as "g Ng" -k on t Nt g Ng For example, the command to run with 1 GPU and 8 OpenMP threads is then: mpiexec -np 1 lmp_kokkos_cuda_openmpi -in in.lj -k on g 1 t 8 -sf kk 136 LAMMPS Users Manual Conversely, if the "-sf kk/host" is used in the command line and then the "/kk" or "/kk/device" suffix is added to a specific style in your input script, then only that specific style will run on the GPU while everything else will run on the CPU in OpenMP mode. Note that the execution of the CPU and GPU styles will NOT overlap, except for a special case: A kspace style and/or molecular topology (bonds, angles, etc.) running on the host CPU can overlap with a pair style running on the GPU. First compile with "--default-stream per-thread" added to CCFLAGS in the Kokkos CUDA Makefile. Then explicitly use the "/kk/host" suffix for kspace and bonds, angles, etc. in the input file and the "kk" suffix (equal to "kk/device") on the command line. Also make sure the environment variable CUDA_LAUNCH_BLOCKING is not set to "1" so CPU/GPU overlap can occur. Speed-ups to expect: The performance of KOKKOS running in different modes is a function of your hardware, which KOKKOS-enable styles are used, and the problem size. Generally speaking, the following rules of thumb apply: • When running on CPUs only, with a single thread per MPI task, performance of a KOKKOS style is somewhere between the standard (un-accelerated) styles (MPI-only mode), and those provided by the USER-OMP package. However the difference between all 3 is small (less than 20%). • When running on CPUs only, with multiple threads per MPI task, performance of a KOKKOS style is a bit slower than the USER-OMP package. • When running large number of atoms per GPU, KOKKOS is typically faster than the GPU package. • When running on Intel hardware, KOKKOS is not as fast as the USER-INTEL package, which is optimized for that hardware. See the Benchmark page of the LAMMPS web site for performance of the KOKKOS package on different hardware. Advanced Kokkos options: There are other allowed options when building with the KOKKOS package. As above, they can be set either as variables on the make command line or in Makefile.machine. This is the full list of options, including those discussed above. Each takes a value shown below. The default value is listed, which is set in the /lib/kokkos/Makefile.kokkos file. • KOKKOS_DEVICES, values = Serial, OpenMP, Pthreads, Cuda, default = OpenMP • KOKKOS_ARCH, values = KNC, SNB, HSW, Kepler30, Kepler32, Kepler35, Kepler37, Maxwell50, Maxwell52, Maxwell53, Pascal60, Pascal61, ARMv80, ARMv81, ARMv81, ARMv8-ThunderX, BGQ, Power7, Power8, Power9, KNL, BDW, SKX, default = none • KOKKOS_DEBUG, values = yes, no, default = no 137 LAMMPS Users Manual • KOKKOS_USE_TPLS, values = hwloc, librt, experimental_memkind, default = none • KOKKOS_CXX_STANDARD, values = c++11, c++1z, default = c++11 • KOKKOS_OPTIONS, values = aggressive_vectorization, disable_profiling, default = none • KOKKOS_CUDA_OPTIONS, values = force_uvm, use_ldg, rdc, enable_lambda, default = enable_lambda KOKKOS_DEVICES sets the parallelization method used for Kokkos code (within LAMMPS). KOKKOS_DEVICES=Serial means that no threading will be used. KOKKOS_DEVICES=OpenMP means that OpenMP threading will be used. KOKKOS_DEVICES=Pthreads means that pthreads will be used. KOKKOS_DEVICES=Cuda means an NVIDIA GPU running CUDA will be used. KOKKOS_ARCH enables compiler switches needed when compiling for a specific hardware: • ARMv80 = ARMv8.0 Compatible CPU • ARMv81 = ARMv8.1 Compatible CPU • ARMv8-ThunderX = ARMv8 Cavium ThunderX CPU • SNB = Intel Sandy/Ivy Bridge CPUs • HSW = Intel Haswell CPUs • BDW = Intel Broadwell Xeon E-class CPUs • SKX = Intel Sky Lake Xeon E-class HPC CPUs (AVX512) • KNC = Intel Knights Corner Xeon Phi • KNL = Intel Knights Landing Xeon Phi • Kepler30 = NVIDIA Kepler generation CC 3.0 • Kepler32 = NVIDIA Kepler generation CC 3.2 • Kepler35 = NVIDIA Kepler generation CC 3.5 • Kepler37 = NVIDIA Kepler generation CC 3.7 • Maxwell50 = NVIDIA Maxwell generation CC 5.0 • Maxwell52 = NVIDIA Maxwell generation CC 5.2 • Maxwell53 = NVIDIA Maxwell generation CC 5.3 • Pascal60 = NVIDIA Pascal generation CC 6.0 • Pascal61 = NVIDIA Pascal generation CC 6.1 • BGQ = IBM Blue Gene/Q CPUs • Power8 = IBM POWER8 CPUs • Power9 = IBM POWER9 CPUs KOKKOS_USE_TPLS=hwloc binds threads to hardware cores, so they do not migrate during a simulation. KOKKOS_USE_TPLS=hwloc should always be used if running with KOKKOS_DEVICES=Pthreads for pthreads. It is not necessary for KOKKOS_DEVICES=OpenMP for OpenMP, because OpenMP provides alternative methods via environment variables for binding threads to hardware cores. More info on binding threads to cores is given in Section 5.3. KOKKOS_USE_TPLS=librt enables use of a more accurate timer mechanism on most Unix platforms. This library is not available on all platforms. KOKKOS_DEBUG is only useful when developing a Kokkos-enabled style within LAMMPS. KOKKOS_DEBUG=yes enables printing of run-time debugging information 138 LAMMPS Users Manual that can be useful. It also enables runtime bounds checking on Kokkos data structures. KOKKOS_CXX_STANDARD and KOKKOS_OPTIONS are typically not changed when building LAMMPS. KOKKOS_CUDA_OPTIONS are additional options for CUDA. The LAMMPS KOKKOS package must be compiled with the enable_lambda option when using GPUs. Restrictions: Currently, there are no precision options with the KOKKOS package. All compilation and computation is performed in double precision. 139 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands Return to Section 5 overview 5.3.4 USER-OMP package The USER-OMP package was developed by Axel Kohlmeyer at Temple University. It provides multi-threaded versions of most pair styles, nearly all bonded styles (bond, angle, dihedral, improper), several Kspace styles, and a few fix styles. The package currently uses the OpenMP interface for multi-threading. Here is a quick overview of how to use the USER-OMP package, assuming one or more 16-core nodes. More details follow. use -fopenmp with CCFLAGS and LINKFLAGS in Makefile.machine make yes-user-omp make mpi # build with USER-OMP package, if settings added to make omp # or Makefile.omp already has settings lmp_mpi -sf omp -pk omp 16 = Coulomb cutoff + 2*(OM distance), to shrink the size of the neighbor list. This leads to slightly larger cost for the long-range calculation, so you can test the trade-off for your model. The OM distance and the LJ and Coulombic cutoffs are set in the pair_style lj/cut/tip4p/long command. Wikipedia also has a nice article on water models. 6.9 SPC water model The SPC water model specifies a 3-site rigid water molecule with charges and Lennard-Jones parameters assigned to each of the 3 atoms. In LAMMPS the fix shake command can be used to hold the two O-H bonds and the H-O-H angle rigid. A bond style of harmonic and an angle style of harmonic or charmm should also be used. These are the additional parameters (in real units) to set for O and H atoms and the water molecule to run a rigid SPC model. O mass = 15.9994 H mass = 1.008 O charge = -0.820 H charge = 0.410 LJ epsilon of OO = 0.1553 LJ sigma of OO = 3.166 LJ epsilon, sigma of OH, HH = 0.0 r0 of OH bond = 1.0 theta of HOH angle = 109.47 Note that as originally proposed, the SPC model was run with a 9 Angstrom cutoff for both LJ and Coulommbic terms. It can also be used with long-range Coulombics (Ewald or PPPM in LAMMPS), without changing any of the parameters above, though it becomes a different model in that mode of usage. The SPC/E (extended) water model is the same, except the partial charge assignments change: O charge = -0.8476 H charge = 0.4238 See the (Berendsen) reference for more details on both the SPC and SPC/E models. Wikipedia also has a nice article on water models. 155 LAMMPS Users Manual 6.10 Coupling LAMMPS to other codes LAMMPS is designed to allow it to be coupled to other codes. For example, a quantum mechanics code might compute forces on a subset of atoms and pass those forces to LAMMPS. Or a continuum finite element (FE) simulation might use atom positions as boundary conditions on FE nodal points, compute a FE solution, and return interpolated forces on MD atoms. LAMMPS can be coupled to other codes in at least 3 ways. Each has advantages and disadvantages, which you'll have to think about in the context of your application. (1) Define a new fix command that calls the other code. In this scenario, LAMMPS is the driver code. During its timestepping, the fix is invoked, and can make library calls to the other code, which has been linked to LAMMPS as a library. This is the way the POEMS package that performs constrained rigid-body motion on groups of atoms is hooked to LAMMPS. See the fix poems command for more details. See this section of the documentation for info on how to add a new fix to LAMMPS. (2) Define a new LAMMPS command that calls the other code. This is conceptually similar to method (1), but in this case LAMMPS and the other code are on a more equal footing. Note that now the other code is not called during the timestepping of a LAMMPS run, but between runs. The LAMMPS input script can be used to alternate LAMMPS runs with calls to the other code, invoked via the new command. The run command facilitates this with its every option, which makes it easy to run a few steps, invoke the command, run a few steps, invoke the command, etc. In this scenario, the other code can be called as a library, as in (1), or it could be a stand-alone code, invoked by a system() call made by the command (assuming your parallel machine allows one or more processors to start up another program). In the latter case the stand-alone code could communicate with LAMMPS thru files that the command writes and reads. See Section 10 of the documentation for how to add a new command to LAMMPS. (3) Use LAMMPS as a library called by another code. In this case the other code is the driver and calls LAMMPS as needed. Or a wrapper code could link and call both LAMMPS and another code as libraries. Again, the run command has options that allow it to be invoked with minimal overhead (no setup or clean-up) if you wish to do multiple short runs, driven by another program. Examples of driver codes that call LAMMPS as a library are included in the examples/COUPLE directory of the LAMMPS distribution; see examples/COUPLE/README for more details: • simple: simple driver programs in C++ and C which invoke LAMMPS as a library • lammps_quest: coupling of LAMMPS and Quest, to run classical MD with quantum forces calculated by a density functional code • lammps_spparks: coupling of LAMMPS and SPPARKS, to couple a kinetic Monte Carlo model for grain growth using MD to calculate strain induced across grain boundaries 156 LAMMPS Users Manual This section of the documentation describes how to build LAMMPS as a library. Once this is done, you can interface with LAMMPS either via C++, C, Fortran, or Python (or any other language that supports a vanilla C-like interface). For example, from C++ you could create one (or more) "instances" of LAMMPS, pass it an input script to process, or execute individual commands, all by invoking the correct class methods in LAMMPS. From C or Fortran you can make function calls to do the same things. See Section 11 of the manual for a description of the Python wrapper provided with LAMMPS that operates through the LAMMPS library interface. The files src/library.cpp and library.h contain the C-style interface to LAMMPS. See Section 6.19 of the manual for a description of the interface and how to extend it for your needs. Note that the lammps_open() function that creates an instance of LAMMPS takes an MPI communicator as an argument. This means that instance of LAMMPS will run on the set of processors in the communicator. Thus the calling code can run LAMMPS on all or a subset of processors. For example, a wrapper script might decide to alternate between LAMMPS and another code, allowing them both to run on all the processors. Or it might allocate half the processors to LAMMPS and half to the other code and run both codes simultaneously before syncing them up periodically. Or it might instantiate multiple instances of LAMMPS to perform different calculations. 6.11 Visualizing LAMMPS snapshots LAMMPS itself does not do visualization, but snapshots from LAMMPS simulations can be visualized (and analyzed) in a variety of ways. LAMMPS snapshots are created by the dump command which can create files in several formats. The native LAMMPS dump format is a text file (see "dump atom" or "dump custom") which can be visualized by several popular visualization tools. The dump image and dump movie styles can output internally rendered images and convert a sequence of them to a movie during the MD run. Several programs included with LAMMPS as auxiliary tools can convert between LAMMPS format files and other formats. See the Section 9 doc page for details. A Python-based toolkit distributed by our group can read native LAMMPS dump files, including custom dump files with additional columns of user-specified atom information, and convert them to various formats or pipe them into visualization software directly. See the Pizza.py WWW site for details. Specifically, Pizza.py can convert LAMMPS dump files into PDB, XYZ, Ensight, and VTK formats. Pizza.py can pipe LAMMPS dump files directly into the Raster3d and RasMol visualization programs. Pizza.py has tools that do interactive 3d OpenGL visualization and one that creates SVG images of dump file snapshots. 6.12 Triclinic (non-orthogonal) simulation boxes By default, LAMMPS uses an orthogonal simulation box to encompass the particles. The boundary command sets the boundary conditions of the box (periodic, 157 LAMMPS Users Manual non-periodic, etc). The orthogonal box has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by a = (xhi-xlo,0,0); b = (0,yhi-ylo,0); c = (0,0,zhi-zlo). The 6 parameters (xlo,xhi,ylo,yhi,zlo,zhi) are defined at the time the simulation box is created, e.g. by the create_box or read_data or read_restart commands. Additionally, LAMMPS defines box size parameters lx,ly,lz where lx = xhi-xlo, and similarly in the y and z dimensions. The 6 parameters, as well as lx,ly,lz, can be output via the thermo_style custom command. LAMMPS also allows simulations to be performed in triclinic (non-orthogonal) simulation boxes shaped as a parallelepiped with triclinic symmetry. The parallelepiped has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by a = (xhi-xlo,0,0); b = (xy,yhi-ylo,0); c = (xz,yz,zhi-zlo). xy,xz,yz can be 0.0 or positive or negative values and are called "tilt factors" because they are the amount of displacement applied to faces of an originally orthogonal box to transform it into the parallelepiped. In LAMMPS the triclinic simulation box edge vectors a, b, and c cannot be arbitrary vectors. As indicated, a must lie on the positive x axis. b must lie in the xy plane, with strictly positive y component. c may have any orientation with strictly positive z component. The requirement that a, b, and c have strictly positive x, y, and z components, respectively, ensures that a, b, and c form a complete right-handed basis. These restrictions impose no loss of generality, since it is possible to rotate/invert any set of 3 crystal basis vectors so that they conform to the restrictions. For example, assume that the 3 vectors A,B,C are the edge vectors of a general parallelepiped, where there is no restriction on A,B,C other than they form a complete right-handed basis i.e. A x B . C > 0. The equivalent LAMMPS a,b,c are a linear rotation of A, B, and C and can be computed as follows: 158 LAMMPS Users Manual where A = | A | indicates the scalar length of A. The hat symbol (^) indicates the corresponding unit vector. beta and gamma are angles between the vectors described below. Note that by construction, a, b, and c have strictly positive x, y, and z components, respectively. If it should happen that A, B, and C form a left-handed basis, then the above equations are not valid for c. In this case, it is necessary to first apply an inversion. This can be achieved by interchanging two basis vectors or by changing the sign of one of them. For consistency, the same rotation/inversion applied to the basis vectors must also be applied to atom positions, velocities, and any other vector quantities. This can be conveniently achieved by first converting to fractional coordinates in the old basis and then converting to distance coordinates in the new basis. The transformation is given by the following equation: 159 LAMMPS Users Manual where V is the volume of the box, X is the original vector quantity and x is the vector in the LAMMPS basis. There is no requirement that a triclinic box be periodic in any dimension, though it typically should be in at least the 2nd dimension of the tilt (y in xy) if you want to enforce a shift in periodic boundary conditions across that boundary. Some commands that work with triclinic boxes, e.g. the fix deform and fix npt commands, require periodicity or non-shrink-wrap boundary conditions in specific dimensions. See the command doc pages for details. The 9 parameters (xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) are defined at the time the simulation box is created. This happens in one of 3 ways. If the create_box command is used with a region of style prism, then a triclinic box is setup. See the region command for details. If the read_data command is used to define the simulation box, and the header of the data file contains a line with the "xy xz yz" keyword, then a triclinic box is setup. See the read_data command for details. Finally, if the read_restart command reads a restart file which was written from a simulation using a triclinic box, then a triclinic box will be setup for the restarted simulation. Note that you can define a triclinic box with all 3 tilt factors = 0.0, so that it is initially orthogonal. This is necessary if the box will become non-orthogonal, e.g. due to the fix npt or fix deform commands. Alternatively, you can use the change_box command to convert a simulation box from orthogonal to triclinic and vice versa. As with orthogonal boxes, LAMMPS defines triclinic box size parameters lx,ly,lz where lx = xhi-xlo, and similarly in the y and z dimensions. The 9 parameters, as well as lx,ly,lz, can be output via the thermo_style custom command. To avoid extremely tilted boxes (which would be computationally inefficient), LAMMPS normally requires that no tilt factor can skew the box more than half the distance of the parallel box length, which is the 1st dimension in the tilt factor (x for xz). This is required both when the simulation box is created, e.g. via the create_box or read_data commands, as well as when the box shape changes dynamically during a simulation, e.g. via the fix deform or fix npt commands. For example, if xlo = 2 and xhi = 12, then the x box length is 10 and the xy tilt factor must be between -5 and 5. Similarly, both xz and yz must be between -(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation, since if the maximum tilt factor is 5 (as in this example), then configurations with tilt = ..., -15, -5, 5, 15, 25, ... are geometrically all equivalent. If the box tilt exceeds this limit during a dynamics run (e.g. via the fix deform command), then the box is "flipped" to an equivalent shape with a tilt factor within the bounds, so the run can continue. See the fix deform doc page for further details. One exception to this rule is if the 1st dimension in the tilt factor (x for xy) is non-periodic. In that case, the limits on the tilt factor are not enforced, since flipping the box in that dimension does not change the atom positions due to non-periodicity. In this mode, if you tilt the system to extreme angles, the simulation will simply become inefficient, due to the highly skewed simulation box. 160 LAMMPS Users Manual The limitation on not creating a simulation box with a tilt factor skewing the box more than half the distance of the parallel box length can be overridden via the box command. Setting the tilt keyword to large allows any tilt factors to be specified. Box flips that may occur using the fix deform or fix npt commands can be turned off using the flip no option with either of the commands. Note that if a simulation box has a large tilt factor, LAMMPS will run less efficiently, due to the large volume of communication needed to acquire ghost atoms around a processor's irregular-shaped sub-domain. For extreme values of tilt, LAMMPS may also lose atoms and generate an error. Triclinic crystal structures are often defined using three lattice constants a, b, and c, and three angles alpha, beta and gamma. Note that in this nomenclature, the a, b, and c lattice constants are the scalar lengths of the edge vectors a, b, and c defined above. The relationship between these 6 quantities (a,b,c,alpha,beta,gamma) and the LAMMPS box sizes (lx,ly,lz) = (xhi-xlo,yhi-ylo,zhi-zlo) and tilt factors (xy,xz,yz) is as follows: The inverse relationship can be written as follows: 161 LAMMPS Users Manual The values of a, b, c , alpha, beta , and gamma can be printed out or accessed by computes using the thermo_style custom keywords cella, cellb, cellc, cellalpha, cellbeta, cellgamma, respectively. As discussed on the dump command doc page, when the BOX BOUNDS for a snapshot is written to a dump file for a triclinic box, an orthogonal bounding box which encloses the triclinic simulation box is output, along with the 3 tilt factors (xy, xz, yz) of the triclinic box, formatted as follows: ITEM: BOX xlo_bound ylo_bound zlo_bound BOUNDS xy xhi_bound yhi_bound zhi_bound xz yz xy xz yz This bounding box is convenient for many visualization programs and is calculated from the 9 triclinic box parameters (xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz) as follows: xlo_bound xhi_bound ylo_bound yhi_bound zlo_bound zhi_bound = = = = = = xlo xhi ylo yhi zlo zhi + + + + MIN(0.0,xy,xz,xy+xz) MAX(0.0,xy,xz,xy+xz) MIN(0.0,yz) MAX(0.0,yz) These formulas can be inverted if you need to convert the bounding box back into the triclinic box parameters, e.g. xlo = xlo_bound - MIN(0.0,xy,xz,xy+xz). One use of triclinic simulation boxes is to model solid-state crystals with triclinic symmetry. The lattice command can be used with non-orthogonal basis vectors to define a lattice that will tile a triclinic simulation box via the create_atoms command. A second use is to run Parinello-Rahman dynamics via the fix npt command, which will adjust the xy, xz, yz tilt factors to compensate for off-diagonal components of the pressure tensor. The analog for an energy minimization is the fix box/relax command. 162 LAMMPS Users Manual A third use is to shear a bulk solid to study the response of the material. The fix deform command can be used for this purpose. It allows dynamic control of the xy, xz, yz tilt factors as a simulation runs. This is discussed in the next section on non-equilibrium MD (NEMD) simulations. 6.13 NEMD simulations Non-equilibrium molecular dynamics or NEMD simulations are typically used to measure a fluid's rheological properties such as viscosity. In LAMMPS, such simulations can be performed by first setting up a non-orthogonal simulation box (see the preceding Howto section). A shear strain can be applied to the simulation box at a desired strain rate by using the fix deform command. The fix nvt/sllod command can be used to thermostat the sheared fluid and integrate the SLLOD equations of motion for the system. Fix nvt/sllod uses compute temp/deform to compute a thermal temperature by subtracting out the streaming velocity of the shearing atoms. The velocity profile or other properties of the fluid can be monitored via the fix ave/chunk command. As discussed in the previous section on non-orthogonal simulation boxes, the amount of tilt or skew that can be applied is limited by LAMMPS for computational efficiency to be 1/2 of the parallel box length. However, fix deform can continuously strain a box by an arbitrary amount. As discussed in the fix deform command, when the tilt value reaches a limit, the box is flipped to the opposite limit which is an equivalent tiling of periodic space. The strain rate can then continue to change as before. In a long NEMD simulation these box re-shaping events may occur many times. In a NEMD simulation, the "remap" option of fix deform should be set to "remap v", since that is what fix nvt/sllod assumes to generate a velocity profile consistent with the applied shear strain rate. An alternative method for calculating viscosities is provided via the fix viscosity command. NEMD simulations can also be used to measure transport properties of a fluid through a pore or channel. Simulations of steady-state flow can be performed using the fix flow/gauss command. 6.14 Finite-size spherical and aspherical particles Typical MD models treat atoms or particles as point masses. Sometimes it is desirable to have a model with finite-size particles such as spheroids or ellipsoids or generalized aspherical bodies. The difference is that such particles have a moment of inertia, rotational energy, and angular momentum. Rotation is induced by torque coming from interactions with other particles. LAMMPS has several options for running simulations with these kinds of particles. The following aspects are discussed in turn: 163 LAMMPS Users Manual • atom styles • pair potentials • time integration • computes, thermodynamics, and dump output • rigid bodies composed of finite-size particles Example input scripts for these kinds of models are in the body, colloid, dipole, ellipse, line, peri, pour, and tri directories of the examples directory in the LAMMPS distribution. Atom styles There are several atom styles that allow for definition of finite-size particles: sphere, dipole, ellipsoid, line, tri, peri, and body. The sphere style defines particles that are spheriods and each particle can have a unique diameter and mass (or density). These particles store an angular velocity (omega) and can be acted upon by torque. The "set" command can be used to modify the diameter and mass of individual particles, after then are created. The dipole style does not actually define finite-size particles, but is often used in conjunction with spherical particles, via a command like atom_style hybrid sphere dipole This is because when dipoles interact with each other, they induce torques, and a particle must be finite-size (i.e. have a moment of inertia) in order to respond and rotate. See the atom_style dipole command for details. The "set" command can be used to modify the orientation and length of the dipole moment of individual particles, after then are created. The ellipsoid style defines particles that are ellipsoids and thus can be aspherical. Each particle has a shape, specified by 3 diameters, and mass (or density). These particles store an angular momentum and their orientation (quaternion), and can be acted upon by torque. They do not store an angular velocity (omega), which can be in a different direction than angular momentum, rather they compute it as needed. The "set" command can be used to modify the diameter, orientation, and mass of individual particles, after then are created. It also has a brief explanation of what quaternions are. The line style defines line segment particles with two end points and a mass (or density). They can be used in 2d simulations, and they can be joined together to form rigid bodies which represent arbitrary polygons. The tri style defines triangular particles with three corner points and a mass (or density). They can be used in 3d simulations, and they can be joined together to form rigid bodies which represent arbitrary particles with a triangulated surface. The peri style is used with Peridynamic models and defines particles as having a volume, that is used internally in the pair_style peri potentials. 164 LAMMPS Users Manual The body style allows for definition of particles which can represent complex entities, such as surface meshes of discrete points, collections of sub-particles, deformable objects, etc. The body style is discussed in more detail on the body doc page. Note that if one of these atom styles is used (or multiple styles via the atom_style hybrid command), not all particles in the system are required to be finite-size or aspherical. For example, in the ellipsoid style, if the 3 shape parameters are set to the same value, the particle will be a sphere rather than an ellipsoid. If the 3 shape parameters are all set to 0.0 or if the diameter is set to 0.0, it will be a point particle. In the line or tri style, if the lineflag or triflag is specified as 0, then it will be a point particle. Some of the pair styles used to compute pairwise interactions between finite-size particles also compute the correct interaction with point particles as well, e.g. the interaction between a point particle and a finite-size particle or between two point particles. If necessary, pair_style hybrid can be used to insure the correct interactions are computed for the appropriate style of interactions. Likewise, using groups to partition particles (ellipsoids versus spheres versus point particles) will allow you to use the appropriate time integrators and temperature computations for each class of particles. See the doc pages for various commands for details. Also note that for 2d simulations, atom styles sphere and ellipsoid still use 3d particles, rather than as circular disks or ellipses. This means they have the same moment of inertia as the 3d object. When temperature is computed, the correct degrees of freedom are used for rotation in a 2d versus 3d system. Pair potentials When a system with finite-size particles is defined, the particles will only rotate and experience torque if the force field computes such interactions. These are the various pair styles that generate torque: • pair_style • pair_style • pair_style • pair_style • pair_style • pair_style • pair_style • pair_style • pair_style • pair_style • pair_style gran/history gran/hertzian gran/no_history dipole/cut gayberne resquared brownian lubricate line/lj tri/lj body The granular pair styles are used with spherical particles. The dipole pair style is used with the dipole atom style, which could be applied to spherical or ellipsoidal particles. The GayBerne and REsquared potentials require ellipsoidal particles, though they will also work if the 3 shape parameters are the same (a sphere). The Brownian and lubrication potentials are used with spherical particles. The line, tri, and body potentials are used with line segment, triangular, and body particles respectively. 165 LAMMPS Users Manual Time integration There are several fixes that perform time integration on finite-size spherical particles, meaning the integrators update the rotational orientation and angular velocity or angular momentum of the particles: • fix nve/sphere • fix nvt/sphere • fix npt/sphere Likewise, there are 3 fixes that perform time integration on ellipsoidal particles: • fix nve/asphere • fix nvt/asphere • fix npt/asphere The advantage of these fixes is that those which thermostat the particles include the rotational degrees of freedom in the temperature calculation and thermostatting. The fix langevin command can also be used with its omgea or angmom options to thermostat the rotational degrees of freedom for spherical or ellipsoidal particles. Other thermostatting fixes only operate on the translational kinetic energy of finite-size particles. These fixes perform constant NVE time integration on line segment, triangular, and body particles: • fix nve/line • fix nve/tri • fix nve/body Note that for mixtures of point and finite-size particles, these integration fixes can only be used with groups which contain finite-size particles. Computes, thermodynamics, and dump output There are several computes that calculate the temperature or rotational energy of spherical or ellipsoidal particles: • compute • compute • compute • compute temp/sphere temp/asphere erotate/sphere erotate/asphere These include rotational degrees of freedom in their computation. If you wish the thermodynamic output of temperature or pressure to use one of these computes (e.g. for a system entirely composed of finite-size particles), then the compute can be defined and the thermo_modify command used. Note that by default thermodynamic quantities will be calculated with a temperature that only includes translational degrees of freedom. See the thermo_style command for details. These commands can be used to output various attributes of finite-size particles: 166 LAMMPS Users Manual • dump custom • compute property/atom • dump local • compute body/local Attributes include the dipole moment, the angular velocity, the angular momentum, the quaternion, the torque, the end-point and corner-point coordinates (for line and tri particles), and sub-particle attributes of body particles. Rigid bodies composed of finite-size particles The fix rigid command treats a collection of particles as a rigid body, computes its inertia tensor, sums the total force and torque on the rigid body each timestep due to forces on its constituent particles, and integrates the motion of the rigid body. If any of the constituent particles of a rigid body are finite-size particles (spheres or ellipsoids or line segments or triangles), then their contribution to the inertia tensor of the body is different than if they were point particles. This means the rotational dynamics of the rigid body will be different. Thus a model of a dimer is different if the dimer consists of two point masses versus two spheroids, even if the two particles have the same mass. Finite-size particles that experience torque due to their interaction with other particles will also impart that torque to a rigid body they are part of. See the "fix rigid" command for example of complex rigid-body models it is possible to define in LAMMPS. Note that the fix shake command can also be used to treat 2, 3, or 4 particles as a rigid body, but it always assumes the particles are point masses. Also note that body particles cannot be modeled with the fix rigid command. Body particles are treated by LAMMPS as single particles, though they can store internal state, such as a list of sub-particles. Individual body partices are typically treated as rigid bodies, and their motion integrated with a command like fix nve/body. Interactions between pairs of body particles are computed via a command like pair_style body. 6.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables) There are four basic kinds of LAMMPS output: • Thermodynamic output, which is a list of quantities printed every few timesteps to the screen and logfile. • Dump files, which contain snapshots of atoms and various per-atom values and are written at a specified frequency. • Certain fixes can output user-specified quantities to files: fix ave/time for time averaging, fix ave/chunk for spatial or other averaging, and fix print for single-line output of variables. Fix print can also output to the screen. • Restart files. 167 LAMMPS Users Manual A simulation prints one set of thermodynamic output and (optionally) restart files. It can generate any number of dump files and fix output files, depending on what dump and fix commands you specify. As discussed below, LAMMPS gives you a variety of ways to determine what quantities are computed and printed when the thermodynamics, dump, or fix commands listed above perform output. Throughout this discussion, note that users can also add their own computes and fixes to LAMMPS which can then generate values that can then be output with these commands. The following sub-sections discuss different LAMMPS command related to output and the kind of data they operate on and produce: • Global/per-atom/local data • Scalar/vector/array data • Thermodynamic output • Dump file output • Fixes that write output files • Computes that process output quantities • Fixes that process output quantities • Computes that generate values to output • Fixes that generate values to output • Variables that generate values to output • Summary table of output options and data flow between commands Global/per-atom/local data Various output-related commands work with three different styles of data: global, per-atom, or local. A global datum is one or more system-wide values, e.g. the temperature of the system. A per-atom datum is one or more values per atom, e.g. the kinetic energy of each atom. Local datums are calculated by each processor based on the atoms it owns, but there may be zero or more per atom, e.g. a list of bond distances. Scalar/vector/array data Global, per-atom, and local datums can each come in three kinds: a single scalar value, a vector of values, or a 2d array of values. The doc page for a "compute" or "fix" or "variable" that generates data will specify both the style and kind of data it produces, e.g. a per-atom vector. When a quantity is accessed, as in many of the output commands discussed below, it can be referenced via the following bracket notation, where ID in this case is the ID of a compute. The leading "c_" would be replaced by "f_" for a fix, or "v_" for a variable: c_ID entire scalar, vector, or array c_ID[I] one element of vector, one column of array c_ID[I][J] one element of array In other words, using one bracket reduces the dimension of the data once (vector -> scalar, array -> vector). Using two brackets reduces the dimension twice (array -> 168 LAMMPS Users Manual scalar). Thus a command that uses scalar values as input can typically also process elements of a vector or array. Thermodynamic output The frequency and format of thermodynamic output is set by the thermo, thermo_style, and thermo_modify commands. The thermo_style command also specifies what values are calculated and written out. Pre-defined keywords can be specified (e.g. press, etotal, etc). Three additional kinds of keywords can also be specified (c_ID, f_ID, v_name), where a compute or fix or variable provides the value to be output. In each case, the compute, fix, or variable must generate global values for input to the thermo_style custom command. Note that thermodynamic output values can be "extensive" or "intensive". The former scale with the number of atoms in the system (e.g. total energy), the latter do not (e.g. temperature). The setting for thermo_modify norm determines whether extensive quantities are normalized or not. Computes and fixes produce either extensive or intensive values; see their individual doc pages for details. Equal-style variables produce only intensive values; you can include a division by "natoms" in the formula if desired, to make an extensive calculation produce an intensive result. Dump file output Dump file output is specified by the dump and dump_modify commands. There are several pre-defined formats (dump atom, dump xtc, etc). There is also a dump custom format where the user specifies what values are output with each atom. Pre-defined atom attributes can be specified (id, x, fx, etc). Three additional kinds of keywords can also be specified (c_ID, f_ID, v_name), where a compute or fix or variable provides the values to be output. In each case, the compute, fix, or variable must generate per-atom values for input to the dump custom command. There is also a dump local format where the user specifies what local values to output. A pre-defined index keyword can be specified to enumerate the local values. Two additional kinds of keywords can also be specified (c_ID, f_ID), where a compute or fix or variable provides the values to be output. In each case, the compute or fix must generate local values for input to the dump local command. Fixes that write output files Several fixes take various quantities as input and can write output files: fix ave/time, fix ave/chunk, fix ave/histo, fix ave/correlate, and fix print. The fix ave/time command enables direct output to a file and/or time-averaging of global scalars or vectors. The user specifies one or more quantities as input. These can be global compute values, global fix values, or variables of any style except the atom style which produces per-atom values. Since a variable can refer to keywords used by the thermo_style custom command (like temp or press) and individual per-atom values, a wide variety of quantities can be time averaged and/or output in this way. If the inputs are one or more scalar values, then the fix generate a global 169 LAMMPS Users Manual scalar or vector of output. If the inputs are one or more vector values, then the fix generates a global vector or array of output. The time-averaged output of this fix can also be used as input to other output commands. The fix ave/chunk command enables direct output to a file of chunk-averaged per-atom quantities like those output in dump files. Chunks can represent spatial bins or other collections of atoms, e.g. individual molecules. The per-atom quantities can be atom density (mass or number) or atom attributes such as position, velocity, force. They can also be per-atom quantities calculated by a compute, by a fix, or by an atom-style variable. The chunk-averaged output of this fix can also be used as input to other output commands. The fix ave/histo command enables direct output to a file of histogrammed quantities, which can be global or per-atom or local quantities. The histogram output of this fix can also be used as input to other output commands. The fix ave/correlate command enables direct output to a file of time-correlated quantities, which can be global values. The correlation matrix output of this fix can also be used as input to other output commands. The fix print command can generate a line of output written to the screen and log file or to a separate file, periodically during a running simulation. The line can contain one or more variable values for any style variable except the vector or atom styles). As explained above, variables themselves can contain references to global values generated by thermodynamic keywords, computes, fixes, or other variables, or to per-atom values for a specific atom. Thus the fix print command is a means to output a wide variety of quantities separate from normal thermodynamic or dump file output. Computes that process output quantities The compute reduce and compute reduce/region commands take one or more per-atom or local vector quantities as inputs and "reduce" them (sum, min, max, ave) to scalar quantities. These are produced as output values which can be used as input to other output commands. The compute slice command take one or more global vector or array quantities as inputs and extracts a subset of their values to create a new vector or array. These are produced as output values which can be used as input to other output commands. The compute property/atom command takes a list of one or more pre-defined atom attributes (id, x, fx, etc) and stores the values in a per-atom vector or array. These are produced as output values which can be used as input to other output commands. The list of atom attributes is the same as for the dump custom command. The compute property/local command takes a list of one or more pre-defined local attributes (bond info, angle info, etc) and stores the values in a local vector or array. These are produced as output values which can be used as input to other output commands. 170 LAMMPS Users Manual Fixes that process output quantities The fix vector command can create global vectors as output from global scalars as input, accumulating them one element at a time. The fix ave/atom command performs time-averaging of per-atom vectors. The per-atom quantities can be atom attributes such as position, velocity, force. They can also be per-atom quantities calculated by a compute, by a fix, or by an atom-style variable. The time-averaged per-atom output of this fix can be used as input to other output commands. The fix store/state command can archive one or more per-atom attributes at a particular time, so that the old values can be used in a future calculation or output. The list of atom attributes is the same as for the dump custom command, including per-atom quantities calculated by a compute, by a fix, or by an atom-style variable. The output of this fix can be used as input to other output commands. Computes that generate values to output Every compute in LAMMPS produces either global or per-atom or local values. The values can be scalars or vectors or arrays of data. These values can be output using the other commands described in this section. The doc page for each compute command describes what it produces. Computes that produce per-atom or local values have the word "atom" or "local" in their style name. Computes without the word "atom" or "local" produce global values. Fixes that generate values to output Some fixes in LAMMPS produces either global or per-atom or local values which can be accessed by other commands. The values can be scalars or vectors or arrays of data. These values can be output using the other commands described in this section. The doc page for each fix command tells whether it produces any output quantities and describes them. Variables that generate values to output Variables defined in an input script can store one or more strings. But equal-style, vector-style, and atom-style or atomfile-style variables generate a global scalar value, global vector or values, or a per-atom vector, respectively, when accessed. The formulas used to define these variables can contain references to the thermodynamic keywords and to global and per-atom data generated by computes, fixes, and other variables. The values generated by variables can be used as input to and thus output by the other commands described in this section. Summary table of output options and data flow between commands This table summarizes the various commands that can be used for generating output from LAMMPS. Each command produces output data of some kind and/or writes data to a file. Most of the commands can take data from other commands as input. Thus you can link many of these commands together in pipeline form, where data produced by one command is used as input to another command and eventually written to the screen or to a file. Note that to hook two commands together the output and input 171 LAMMPS Users Manual data types must match, e.g. global/per-atom/local data and scalar/vector/array data. Also note that, as described above, when a command takes a scalar as input, that could be an element of a vector or array. Likewise a vector input could be a column of an array. Command thermo_style custom dump custom dump local fix print print Input Output global scalars screen, log file per-atom vectors local vectors global scalar from variable global scalar from variable computes N/A fixes N/A global scalars and vectors, per-atom vectors per-atom/local vectors global vectors/arrays dump file dump file screen, file screen global/per-atom/local scalar/vector/array global/per-atom/local scalar/vector/array global scalar and vector, per-atom vector global scalar/vector global vector/array per-atom vectors per-atom vector/array local vectors local vector/array variables compute reduce compute slice compute property/atom compute property/local fix vector fix ave/atom fix ave/time fix ave/chunk fix ave/histo fix ave/correlate fix store/state global scalars global vector per-atom vectors per-atom vector/array global scalars/vectors global scalar/vector/array, file per-atom vectors global array, file global/per-atom/local scalars and global array, file vectors global scalars global array, file per-atom vectors per-atom vector/array 6.16 Thermostatting, barostatting, and computing temperature Thermostatting means controlling the temperature of particles in an MD simulation. Barostatting means controlling the pressure. Since the pressure includes a kinetic component due to particle velocities, both these operations require calculation of the temperature. Typically a target temperature (T) and/or pressure (P) is specified by the user, and the thermostat or barostat attempts to equilibrate the system to the requested T and/or P. Temperature is computed as kinetic energy divided by some number of degrees of freedom (and the Boltzmann constant). Since kinetic energy is a function of particle 172 LAMMPS Users Manual velocity, there is often a need to distinguish between a particle's advection velocity (due to some aggregate motion of particles) and its thermal velocity. The sum of the two is the particle's total velocity, but the latter is often what is wanted to compute a temperature. LAMMPS has several options for computing temperatures, any of which can be used in thermostatting and barostatting. These compute commands calculate temperature, and the compute pressure command calculates pressure. • compute • compute • compute • compute • compute • compute • compute • compute • compute temp temp/sphere temp/asphere temp/com temp/deform temp/partial temp/profile temp/ramp temp/region All but the first 3 calculate velocity biases directly (e.g. advection velocities) that are removed when computing the thermal temperature. Compute temp/sphere and compute temp/asphere compute kinetic energy for finite-size particles that includes rotational degrees of freedom. They both allow for velocity biases indirectly, via an optional extra argument, another temperature compute that subtracts a velocity bias. This allows the translational velocity of spherical or aspherical particles to be adjusted in prescribed ways. Thermostatting in LAMMPS is performed by fixes, or in one case by a pair style. Several thermostatting fixes are available: Nose-Hoover (nvt), Berendsen, CSVR, Langevin, and direct rescaling (temp/rescale). Dissipative particle dynamics (DPD) thermostatting can be invoked via the dpd/tstat pair style: • fix nvt • fix nvt/sphere • fix nvt/asphere • fix nvt/sllod • fix temp/berendsen • fix temp/csvr • fix langevin • fix temp/rescale • pair_style dpd/tstat Fix nvt only thermostats the translational velocity of particles. Fix nvt/sllod also does this, except that it subtracts out a velocity bias due to a deforming box and integrates the SLLOD equations of motion. See the NEMD simulations section of this page for further details. Fix nvt/sphere and fix nvt/asphere thermostat not only translation velocities but also rotational velocities for spherical and aspherical particles. DPD thermostatting alters pairwise interactions in a manner analogous to the per-particle thermostatting of fix langevin. 173 LAMMPS Users Manual Any of the thermostatting fixes can use temperature computes that remove bias which has two effects. First, the current calculated temperature, which is compared to the requested target temperature, is calculated with the velocity bias removed. Second, the thermostat adjusts only the thermal temperature component of the particle's velocities, which are the velocities with the bias removed. The removed bias is then added back to the adjusted velocities. See the doc pages for the individual fixes and for the fix_modify command for instructions on how to assign a temperature compute to a thermostatting fix. For example, you can apply a thermostat to only the x and z components of velocity by using it in conjunction with compute temp/partial. Of you could thermostat only the thermal temperature of a streaming flow of particles without affecting the streaming velocity, by using compute temp/profile. NOTE: Only the nvt fixes perform time integration, meaning they update the velocities and positions of particles due to forces and velocities respectively. The other thermostat fixes only adjust velocities; they do NOT perform time integration updates. Thus they should be used in conjunction with a constant NVE integration fix such as these: • fix nve • fix nve/sphere • fix nve/asphere Barostatting in LAMMPS is also performed by fixes. Two barosttating methods are currently available: Nose-Hoover (npt and nph) and Berendsen: • fix • fix • fix • fix • fix npt npt/sphere npt/asphere nph press/berendsen The fix npt commands include a Nose-Hoover thermostat and barostat. Fix nph is just a Nose/Hoover barostat; it does no thermostatting. Both fix nph and fix press/berendsen can be used in conjunction with any of the thermostatting fixes. As with the thermostats, fix npt and fix nph only use translational motion of the particles in computing T and P and performing thermo/barostatting. Fix npt/sphere and fix npt/asphere thermo/barostat using not only translation velocities but also rotational velocities for spherical and aspherical particles. All of the barostatting fixes use the compute pressure compute to calculate a current pressure. By default, this compute is created with a simple compute temp (see the last argument of the compute pressure command), which is used to calculated the kinetic component of the pressure. The barostatting fixes can also use temperature computes that remove bias for the purpose of computing the kinetic component which contributes to the current pressure. See the doc pages for the individual fixes and for the fix_modify command for instructions on how to assign a temperature or pressure compute to a barostatting fix. NOTE: As with the thermostats, the Nose/Hoover methods (fix npt and fix nph) perform time integration. Fix press/berendsen does NOT, so it should be used with 174 LAMMPS Users Manual one of the constant NVE fixes or with one of the NVT fixes. Finally, thermodynamic output, which can be setup via the thermo_style command, often includes temperature and pressure values. As explained on the doc page for the thermo_style command, the default T and P are setup by the thermo command itself. They are NOT the ones associated with any thermostatting or barostatting fix you have defined or with any compute that calculates a temperature or pressure. Thus if you want to view these values of T and P, you need to specify them explicitly via a thermo_style custom command. Or you can use the thermo_modify command to re-define what temperature or pressure compute is used for default thermodynamic output. 6.17 Walls Walls in an MD simulation are typically used to bound particle motion, i.e. to serve as a boundary condition. Walls in LAMMPS can be of rough (made of particles) or idealized surfaces. Ideal walls can be smooth, generating forces only in the normal direction, or frictional, generating forces also in the tangential direction. Rough walls, built of particles, can be created in various ways. The particles themselves can be generated like any other particle, via the lattice and create_atoms commands, or read in via the read_data command. Their motion can be constrained by many different commands, so that they do not move at all, move together as a group at constant velocity or in response to a net force acting on them, move in a prescribed fashion (e.g. rotate around a point), etc. Note that if a time integration fix like fix nve or fix nvt is not used with the group that contains wall particles, their positions and velocities will not be updated. • fix aveforce - set force on particles to average value, so they move together • fix setforce - set force on particles to a value, e.g. 0.0 • fix freeze - freeze particles for use as granular walls • fix nve/noforce - advect particles by their velocity, but without force • fix move - prescribe motion of particles by a linear velocity, oscillation, rotation, variable The fix move command offers the most generality, since the motion of individual particles can be specified with variable formula which depends on time and/or the particle position. For rough walls, it may be useful to turn off pairwise interactions between wall particles via the neigh_modify exclude command. Rough walls can also be created by specifying frozen particles that do not move and do not interact with mobile particles, and then tethering other particles to the fixed particles, via a bond. The bonded particles do interact with other mobile particles. 175 LAMMPS Users Manual Idealized walls can be specified via several fix commands. Fix wall/gran creates frictional walls for use with granular particles; all the other commands create smooth walls. • fix • fix • fix • fix • fix • fix • fix wall/reflect - reflective flat walls wall/lj93 - flat walls, with Lennard-Jones 9/3 potential wall/lj126 - flat walls, with Lennard-Jones 12/6 potential wall/colloid - flat walls, with pair_style colloid potential wall/harmonic - flat walls, with repulsive harmonic spring potential wall/region - use region surface as wall wall/gran - flat or curved walls with pair_style granular potential The lj93, lj126, colloid, and harmonic styles all allow the flat walls to move with a constant velocity, or oscillate in time. The fix wall/region command offers the most generality, since the region surface is treated as a wall, and the geometry of the region can be a simple primitive volume (e.g. a sphere, or cube, or plane), or a complex volume made from the union and intersection of primitive volumes. Regions can also specify a volume "interior" or "exterior" to the specified primitive shape or union or intersection. Regions can also be "dynamic" meaning they move with constant velocity, oscillate, or rotate. The only frictional idealized walls currently in LAMMPS are flat or curved surfaces specified by the fix wall/gran command. At some point we plan to allow regoin surfaces to be used as frictional walls, as well as triangulated surfaces. 6.18 Elastic constants Elastic constants characterize the stiffness of a material. The formal definition is provided by the linear relation that holds between the stress and strain tensors in the limit of infinitesimal deformation. In tensor notation, this is expressed as s_ij = C_ijkl * e_kl, where the repeated indices imply summation. s_ij are the elements of the symmetric stress tensor. e_kl are the elements of the symmetric strain tensor. C_ijkl are the elements of the fourth rank tensor of elastic constants. In three dimensions, this tensor has 3^4=81 elements. Using Voigt notation, the tensor can be written as a 6x6 matrix, where C_ij is now the derivative of s_i w.r.t. e_j. Because s_i is itself a derivative w.r.t. e_i, it follows that C_ij is also symmetric, with at most 7*6/2 = 21 distinct elements. At zero temperature, it is easy to estimate these derivatives by deforming the simulation box in one of the six directions using the change_box command and measuring the change in the stress tensor. A general-purpose script that does this is given in the examples/elastic directory described in this section. Calculating elastic constants at finite temperature is more challenging, because it is necessary to run a simulation that perfoms time averages of differential properties. One way to do this is to measure the change in average stress tensor in an NVT simulations when the cell volume undergoes a finite deformation. In order to balance the systematic and statistical errors in this method, the magnitude of the deformation must be chosen judiciously, and care must be taken to fully equilibrate the deformed cell before sampling the stress tensor. Another approach is to sample the triclinic cell 176 LAMMPS Users Manual fluctuations that occur in an NPT simulation. This method can also be slow to converge and requires careful post-processing (Shinoda) 6.19 Library interface to LAMMPS As described in Section 2.5, LAMMPS can be built as a library, so that it can be called by another code, used in a coupled manner with other codes, or driven through a Python interface. All of these methodologies use a C-style interface to LAMMPS that is provided in the files src/library.cpp and src/library.h. The functions therein have a C-style argument list, but contain C++ code you could write yourself in a C++ application that was invoking LAMMPS directly. The C++ code in the functions illustrates how to invoke internal LAMMPS operations. Note that LAMMPS classes are defined within a LAMMPS namespace (LAMMPS_NS) if you use them from another C++ application. Library.cpp contains these functions for creating and destroying an instance of LAMMPS and sending it commands to execute. See the documentation in the src/library.cpp file for details: void lammps_open(int, char **, MPI_Comm, void **) void lammps_open_no_mpi(int, char **, void **) void lammps_close(void *) int lammps_version(void *) void lammps_file(void *, char *) char *lammps_command(void *, char *) void lammps_commands_list(void *, int, char **) void lammps_commands_string(void *, char *) void lammps_free(void *) The lammps_open() function is used to initialize LAMMPS, passing in a list of strings as if they were command-line arguments when LAMMPS is run in stand-alone mode from the command line, and a MPI communicator for LAMMPS to run under. It returns a ptr to the LAMMPS object that is created, and which is used in subsequent library calls. The lammps_open() function can be called multiple times, to create multiple instances of LAMMPS. LAMMPS will run on the set of processors in the communicator. This means the calling code can run LAMMPS on all or a subset of processors. For example, a wrapper script might decide to alternate between LAMMPS and another code, allowing them both to run on all the processors. Or it might allocate half the processors to LAMMPS and half to the other code and run both codes simultaneously before syncing them up periodically. Or it might instantiate multiple instances of LAMMPS to perform different calculations. The lammps_open_no_mpi() function is similar except that no MPI communicator is passed from the caller. Instead, MPI_COMM_WORLD is used to instantiate LAMMPS, and MPI is initialized if necessary. The lammps_close() function is used to shut down an instance of LAMMPS and free all its memory. 177 LAMMPS Users Manual The lammps_version() function can be used to determined the specific version of the underlying LAMMPS code. This is particularly useful when loading LAMMPS as a shared library via dlopen(). The code using the library interface can than use this information to adapt to changes to the LAMMPS command syntax between versions. The returned LAMMPS version code is an integer (e.g. 2 Sep 2015 results in 20150902) that grows with every new LAMMPS version. The lammps_file(), lammps_command(), lammps_commands_list(), and lammps_commands_string() functions are used to pass one or more commands to LAMMPS to execute, the same as if they were coming from an input script. Via these functions, the calling code can read or generate a series of LAMMPS commands one or multiple at a time and pass it thru the library interface to setup a problem and then run it in stages. The caller can interleave the command function calls with operations it performs, calls to extract information from or set information within LAMMPS, or calls to another code's library. The lammps_file() function passes the filename of an input script. The lammps_command() function passes a single command as a string. The lammps_commands_list() function passes multiple commands in a char** list. In both lammps_command() and lammps_commands_list(), individual commands may or may not have a trailing newline. The lammps_commands_string() function passes multiple commands concatenated into one long string, separated by newline characters. In both lammps_commands_list() and lammps_commands_string(), a single command can be spread across multiple lines, if the last printable character of all but the last line is "&", the same as if the lines appeared in an input script. The lammps_free() function is a clean-up function to free memory that the library allocated previously via other function calls. See comments in src/library.cpp file for which other functions need this clean-up. Library.cpp also contains these functions for extracting information from LAMMPS and setting value within LAMMPS. Again, see the documentation in the src/library.cpp file for details, including which quantities can be queried by name: void *lammps_extract_global(void *, char *) void lammps_extract_box(void *, double *, double *, double *, double *, double *, int *, int *) void *lammps_extract_atom(void *, char *) void *lammps_extract_compute(void *, char *, int, int) void *lammps_extract_fix(void *, char *, int, int, int, int) void *lammps_extract_variable(void *, char *, char *) void lammps_reset_box(void *, double *, double *, double, double, double) int lammps_set_variable(void *, char *, char *) double lammps_get_thermo(void *, char *) int lammps_get_natoms(void *) void lammps_gather_atoms(void *, double *) void lammps_scatter_atoms(void *, double *) void lammps_create_atoms(void *, int, tagint *, int *, double *, double *, imageint *, int) 178 LAMMPS Users Manual The extract functions return a pointer to various global or per-atom quantities stored in LAMMPS or to values calculated by a compute, fix, or variable. The pointer returned by the extract_global() function can be used as a permanent reference to a value which may change. For the extract_atom() method, see the extract() method in the src/atom.cpp file for a list of valid per-atom properties. New names could easily be added if the property you want is not listed. For the other extract functions, the underlying storage may be reallocated as LAMMPS runs, so you need to re-call the function to assure a current pointer or returned value(s). The lammps_reset_box() function resets the size and shape of the simulation box, e.g. as part of restoring a previously extracted and saved state of a simulation. The lammps_set_variable() function can set an existing string-style variable to a new string value, so that subsequent LAMMPS commands can access the variable. The lammps_get_thermo() function returns the current value of a thermo keyword as a double precision value. The lammps_get_natoms() function returns the total number of atoms in the system and can be used by the caller to allocate space for the lammps_gather_atoms() and lammps_scatter_atoms() functions. The gather function collects peratom info of the requested type (atom coords, types, forces, etc) from all processors, orders them by atom ID, and returns a full list to each calling processor. The scatter function does the inverse. It distributes the same peratom values, passed by the caller, to each atom owned by individual processors. Both methods are thus a means to extract or assign (overwrite) any peratom quantities within LAMMPS. See the extract() method in the src/atom.cpp file for a list of valid per-atom properties. New names could easily be added if the property you want is not listed. A special treatment is applied for accessing image flags via the "image" property. Image flags are stored in a packed format with all three image flags stored in a single integer. When signaling to access the image flags as 3 individual values per atom instead of 1, the data is transparently packed or unpacked by the library interface. The lammps_create_atoms() function takes a list of N atoms as input with atom types and coords (required), an optionally atom IDs and velocities and image flags. It uses the coords of each atom to assign it as a new atom to the processor that owns it. This function is useful to add atoms to a simulation or (in tandem with lammps_reset_box()) to restore a previously extracted and saved state of a simulation. Additional properties for the new atoms can then be assigned via the lammps_scatter_atoms() or lammps_extract_atom() functions. The examples/COUPLE and python directories have example C++ and C and Python codes which show how a driver code can link to LAMMPS as a library, run LAMMPS on a subset of processors, grab data from LAMMPS, change it, and put it back into LAMMPS. NOTE: You can write code for additional functions as needed to define how your code talks to LAMMPS and add them to src/library.cpp and src/library.h, as well as to the Python interface. The added functions can access or change any LAMMPS data you wish. 179 LAMMPS Users Manual 6.20 Calculating thermal conductivity The thermal conductivity kappa of a material can be measured in at least 4 ways using various options in LAMMPS. See the examples/KAPPA directory for scripts that implement the 4 methods discussed here for a simple Lennard-Jones fluid model. Also, see this section of the manual for an analogous discussion for viscosity. The thermal conductivity tensor kappa is a measure of the propensity of a material to transmit heat energy in a diffusive manner as given by Fourier's law J = -kappa grad(T) where J is the heat flux in units of energy per area per time and grad(T) is the spatial gradient of temperature. The thermal conductivity thus has units of energy per distance per time per degree K and is often approximated as an isotropic quantity, i.e. as a scalar. The first method is to setup two thermostatted regions at opposite ends of a simulation box, or one in the middle and one at the end of a periodic box. By holding the two regions at different temperatures with a thermostatting fix, the energy added to the hot region should equal the energy subtracted from the cold region and be proportional to the heat flux moving between the regions. See the papers by Ikeshoji and Hafskjold and Wirnsberger et al for details of this idea. Note that thermostatting fixes such as fix nvt, fix langevin, and fix temp/rescale store the cumulative energy they add/subtract. Alternatively, as a second method, the fix heat or fix ehex commands can be used in place of thermostats on each of two regions to add/subtract specified amounts of energy to both regions. In both cases, the resulting temperatures of the two regions can be monitored with the "compute temp/region" command and the temperature profile of the intermediate region can be monitored with the fix ave/chunk and compute ke/atom commands. The third method is to perform a reverse non-equilibrium MD simulation using the fix thermal/conductivity command which implements the rNEMD algorithm of Muller-Plathe. Kinetic energy is swapped between atoms in two different layers of the simulation box. This induces a temperature gradient between the two layers which can be monitored with the fix ave/chunk and compute ke/atom commands. The fix tallies the cumulative energy transfer that it performs. See the fix thermal/conductivity command for details. The fourth method is based on the Green-Kubo (GK) formula which relates the ensemble average of the auto-correlation of the heat flux to kappa. The heat flux can be calculated from the fluctuations of per-atom potential and kinetic energies and per-atom stress tensor in a steady-state equilibrated simulation. This is in contrast to the two preceding non-equilibrium methods, where energy flows continuously between hot and cold regions of the simulation box. The compute heat/flux command can calculate the needed heat flux and describes how to implement the Green_Kubo formalism using additional LAMMPS commands, such as the fix ave/correlate command to calculate the needed auto-correlation. See the doc 180 LAMMPS Users Manual page for the compute heat/flux command for an example input script that calculates the thermal conductivity of solid Ar via the GK formalism. 6.21 Calculating viscosity The shear viscosity eta of a fluid can be measured in at least 5 ways using various options in LAMMPS. See the examples/VISCOSITY directory for scripts that implement the 5 methods discussed here for a simple Lennard-Jones fluid model. Also, see this section of the manual for an analogous discussion for thermal conductivity. Eta is a measure of the propensity of a fluid to transmit momentum in a direction perpendicular to the direction of velocity or momentum flow. Alternatively it is the resistance the fluid has to being sheared. It is given by J = -eta grad(Vstream) where J is the momentum flux in units of momentum per area per time. and grad(Vstream) is the spatial gradient of the velocity of the fluid moving in another direction, normal to the area through which the momentum flows. Viscosity thus has units of pressure-time. The first method is to perform a non-equilibrium MD (NEMD) simulation by shearing the simulation box via the fix deform command, and using the fix nvt/sllod command to thermostat the fluid via the SLLOD equations of motion. Alternatively, as a second method, one or more moving walls can be used to shear the fluid in between them, again with some kind of thermostat that modifies only the thermal (non-shearing) components of velocity to prevent the fluid from heating up. In both cases, the velocity profile setup in the fluid by this procedure can be monitored by the fix ave/chunk command, which determines grad(Vstream) in the equation above. E.g. the derivative in the y-direction of the Vx component of fluid motion or grad(Vstream) = dVx/dy. The Pxy off-diagonal component of the pressure or stress tensor, as calculated by the compute pressure command, can also be monitored, which is the J term in the equation above. See this section of the manual for details on NEMD simulations. The third method is to perform a reverse non-equilibrium MD simulation using the fix viscosity command which implements the rNEMD algorithm of Muller-Plathe. Momentum in one dimension is swapped between atoms in two different layers of the simulation box in a different dimension. This induces a velocity gradient which can be monitored with the fix ave/chunk command. The fix tallies the cumulative momentum transfer that it performs. See the fix viscosity command for details. The fourth method is based on the Green-Kubo (GK) formula which relates the ensemble average of the auto-correlation of the stress/pressure tensor to eta. This can be done in a fully equilibrated simulation which is in contrast to the two preceding non-equilibrium methods, where momentum flows continuously through the simulation box. 181 LAMMPS Users Manual Here is an example input script that calculates the viscosity of liquid Ar via the GK formalism: # Sample LAMMPS input script for viscosity of liquid Ar units variable variable variable variable variable variable real T equal 86.4956 V equal vol dt equal 4.0 p equal 400 # correlation length s equal 5 # sample interval d equal$p*$s # dump interval # convert from LAMMPS real units to SI variable variable variable variable variable kB equal 1.3806504e-23 # [J/K/ Boltzmann atm2Pa equal 101325.0 A2m equal 1.0e-10 fs2s equal 1.0e-15 convert equal${atm2Pa}*${atm2Pa}*${fs2s}*${A2m}*${A2m}*${A2m} # setup problem dimension boundary lattice region create_box create_atoms mass pair_style pair_coeff timestep thermo 3 p p p fcc 5.376 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 box block 0 4 0 4 0 4 1 box 1 box 1 39.948 lj/cut 13.0 * * 0.2381 3.405${dt}
$d # equilibration and thermalization velocity fix run all create$T 102486 mom yes rot yes dist gaussian
NVT all nvt temp $T$T 10 drag 0.2
8000

# viscosity calculation, switch to NVE if desired
#unfix
#fix

NVT
NVE all nve

reset_timestep 0
variable
pxy equal pxy
variable
pxz equal pxz
variable
pyz equal pyz
fix
SS all ave/correlate $s$p $d & v_pxy v_pxz v_pyz type auto file S0St.dat ave running variable scale equal${convert}/(${kB}*$T)*$V*$s*${dt} variable v11 equal trap(f_SS[3])*${scale}
variable
v22 equal trap(f_SS[4])*${scale} variable v33 equal trap(f_SS[5])*${scale}
thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33
run
100000
variable
v equal (v_v11+v_v22+v_v33)/3.0

182

LAMMPS Users Manual
variable
print

ndens equal count(all)/vol
"average viscosity: $v [Pa.s] @$T K, {ndens} /A^3" The fifth method is related to the above Green-Kubo method, but uses the Einstein formulation, analogous to the Einstein mean-square-displacement formulation for self-diffusivity. The time-integrated momentum fluxes play the role of Cartesian coordinates, whose mean-square displacement increases linearly with time at sufficiently long times. 6.22 Calculating a diffusion coefficient The diffusion coefficient D of a material can be measured in at least 2 ways using various options in LAMMPS. See the examples/DIFFUSE directory for scripts that implement the 2 methods discussed here for a simple Lennard-Jones fluid model. The first method is to measure the mean-squared displacement (MSD) of the system, via the compute msd command. The slope of the MSD versus time is proportional to the diffusion coefficient. The instantaneous MSD values can be accumulated in a vector via the fix vector command, and a line fit to the vector to compute its slope via the variable slope function, and thus extract D. The second method is to measure the velocity auto-correlation function (VACF) of the system, via the compute vacf command. The time-integral of the VACF is proportional to the diffusion coefficient. The instantaneous VACF values can be accumulated in a vector via the fix vector command, and time integrated via the variable trap function, and thus extract D. 6.23 Using chunks to calculate system properties In LAMMS, "chunks" are collections of atoms, as defined by the compute chunk/atom command, which assigns each atom to a chunk ID (or to no chunk at all). The number of chunks and the assignment of chunk IDs to atoms can be static or change over time. Examples of "chunks" are molecules or spatial bins or atoms with similar values (e.g. coordination number or potential energy). The per-atom chunk IDs can be used as input to two other kinds of commands, to calculate various properties of a system: • fix ave/chunk • any of the compute */chunk commands Here, each of the 3 kinds of chunk-related commands is briefly overviewed. Then some examples are given of how to compute different properties with chunk commands. Compute chunk/atom command: This compute can assign atoms to chunks of various styles. Only atoms in the specified group and optional specified region are assigned to a chunk. Here are some possible chunk definitions: 183 LAMMPS Users Manual atoms in same molecule atoms of same atom type all atoms with same atom property (charge, radius, etc) chunk ID = molecule ID chunk ID = atom type chunk ID = output of compute property/atom chunk ID = output of compute atoms in same cluster cluster/atom command atoms in same spatial bin chunk ID = bin ID chunk ID = molecule ID used to define atoms in same rigid body rigid bodies atoms with similar potential energy chunk ID = output of compute pe/atom chunk ID = output of compute atoms with same local defect structure centro/atom or compute coord/atom command Note that chunk IDs are integer values, so for atom properties or computes that produce a floating point value, they will be truncated to an integer. You could also use the compute in a variable that scales the floating point value to spread it across multiple integers. Spatial bins can be of various kinds, e.g. 1d bins = slabs, 2d bins = pencils, 3d bins = boxes, spherical bins, cylindrical bins. This compute also calculates the number of chunks Nchunk, which is used by other commands to tally per-chunk data. Nchunk can be a static value or change over time (e.g. the number of clusters). The chunk ID for an individual atom can also be static (e.g. a molecule ID), or dynamic (e.g. what spatial bin an atom is in as it moves). Note that this compute allows the per-atom output of other computes, fixes, and variables to be used to define chunk IDs for each atom. This means you can write your own compute or fix to output a per-atom quantity to use as chunk ID. See Section 10 of the documentation for how to do this. You can also define a per-atom variable in the input script that uses a formula to generate a chunk ID for each atom. Fix ave/chunk command: This fix takes the ID of a compute chunk/atom command as input. For each chunk, it then sums one or more specified per-atom values over the atoms in each chunk. The per-atom values can be any atom property, such as velocity, force, charge, potential energy, kinetic energy, stress, etc. Additional keywords are defined for per-chunk properties like density and temperature. More generally any per-atom value generated by other computes, fixes, and per-atom variables, can be summed over atoms in each chunk. Similar to other averaging fixes, this fix allows the summed per-chunk values to be time-averaged in various ways, and output to a file. The fix produces a global array as output with one row of values per chunk. 184 LAMMPS Users Manual Compute */chunk commands: Currently the following computes operate on chunks of atoms to produce per-chunk values. • compute • compute • compute • compute • compute • compute • compute • compute com/chunk gyration/chunk inertia/chunk msd/chunk property/chunk temp/chunk torque/chunk vcm/chunk They each take the ID of a compute chunk/atom command as input. As their names indicate, they calculate the center-of-mass, radius of gyration, moments of inertia, mean-squared displacement, temperature, torque, and velocity of center-of-mass for each chunk of atoms. The compute property/chunk command can tally the count of atoms in each chunk and extract other per-chunk properties. The reason these various calculations are not part of the fix ave/chunk command, is that each requires a more complicated operation than simply summing and averaging over per-atom values in each chunk. For example, many of them require calculation of a center of mass, which requires summing mass*position over the atoms and then dividing by summed mass. All of these computes produce a global vector or global array as output, wih one or more values per chunk. They can be used in various ways: • As input to the fix ave/time command, which can write the values to a file and optionally time average them. • As input to the fix ave/histo command to histogram values across chunks. E.g. a histogram of cluster sizes or molecule diffusion rates. • As input to special functions of equal-style variables, like sum() and max(). E.g. to find the largest cluster or fastest diffusing molecule. Example calculations with chunks Here are examples using chunk commands to calculate various properties: (1) Average velocity in each of 1000 2d spatial bins: compute cc1 all chunk/atom bin/2d x 0.0 0.1 y lower 0.01 units reduced fix 1 all ave/chunk 100 10 1000 cc1 vx vy file tmp.out (2) Temperature in each spatial bin, after subtracting a flow velocity: compute cc1 all chunk/atom bin/2d x 0.0 0.1 y lower 0.1 units reduced compute vbias all temp/profile 1 0 0 y 10 fix 1 all ave/chunk 100 10 1000 cc1 temp bias vbias file tmp.out (3) Center of mass of each molecule: 185 LAMMPS Users Manual compute cc1 all chunk/atom molecule compute myChunk all com/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector (4) Total force on each molecule and ave/max across all molecules: compute cc1 all chunk/atom molecule fix 1 all ave/chunk 1000 1 1000 cc1 fx fy fz file tmp.out variable xave equal ave(f_1[2]) variable xmax equal max(f_1[2]) thermo 1000 thermo_style custom step temp v_xave v_xmax (5) Histogram of cluster sizes: compute cluster all cluster/atom 1.0 compute cc1 all chunk/atom c_cluster compress yes compute size all property/chunk cc1 count fix 1 all ave/histo 100 1 100 0 20 20 c_size mode vector ave running beyond ignore file tmp.his 6.24 Setting parameters for the kspace_style pppm/disp command The PPPM method computes interactions by splitting the pair potential into two parts, one of which is computed in a normal pairwise fashion, the so-called real-space part, and one of which is computed using the Fourier transform, the so called reciprocal-space or kspace part. For both parts, the potential is not computed exactly but is approximated. Thus, there is an error in both parts of the computation, the real-space and the kspace error. The just mentioned facts are true both for the PPPM for Coulomb as well as dispersion interactions. The deciding difference - and also the reason why the parameters for pppm/disp have to be selected with more care - is the impact of the errors on the results: The kspace error of the PPPM for Coulomb and dispersion interaction and the real-space error of the PPPM for Coulomb interaction have the character of noise. In contrast, the real-space error of the PPPM for dispersion has a clear physical interpretation: the underprediction of cohesion. As a consequence, the real-space error has a much stronger effect than the kspace error on simulation results for pppm/disp. Parameters must thus be chosen in a way that this error is much smaller than the kspace error. When using pppm/disp and not making any specifications on the PPPM parameters via the kspace modify command, parameters will be tuned such that the real-space error and the kspace error are equal. This will result in simulations that are either inaccurate or slow, both of which is not desirable. For selecting parameters for the pppm/disp that provide fast and accurate simulations, there are two approaches, which both have their up- and downsides. The first approach is to set desired real-space an kspace accuracies via the kspace_modify force/disp/real and kspace_modify force/disp/kspace commands. Note that the accuracies have to be specified in force units and are thus dependent on the chosen unit settings. For real units, 0.0001 and 0.002 seem to provide reasonable accurate and efficient computations for the real-space and kspace accuracies. 0.002 and 0.05 work well for most systems using lj units. PPPM parameters will be generated based on the desired accuracies. The upside of this approach is that it 186 LAMMPS Users Manual usually provides a good set of parameters and will work for both the kspace_modify diff ad and kspace_modify diff ik options. The downside of the method is that setting the PPPM parameters will take some time during the initialization of the simulation. The second approach is to set the parameters for the pppm/disp explicitly using the kspace_modify mesh/disp, kspace_modify order/disp, and kspace_modify gewald/disp commands. This approach requires a more experienced user who understands well the impact of the choice of parameters on the simulation accuracy and performance. This approach provides a fast initialization of the simulation. However, it is sensitive to errors: A combination of parameters that will perform well for one system might result in far-from-optimal conditions for other simulations. For example, parameters that provide accurate and fast computations for all-atomistic force fields can provide insufficient accuracy or united-atomistic force fields (which is related to that the latter typically have larger dispersion coefficients). To avoid inaccurate or inefficient simulations, the pppm/disp stops simulations with an error message if no action is taken to control the PPPM parameters. If the automatic parameter generation is desired and real-space and kspace accuracies are desired to be equal, this error message can be suppressed using the kspace_modify disp/auto yes command. A reasonable approach that combines the upsides of both methods is to make the first run using the kspace_modify force/disp/real and kspace_modify force/disp/kspace commands, write down the PPPM parameters from the outut, and specify these parameters using the second approach in subsequent runs (which have the same composition, force field, and approximately the same volume). Concerning the performance of the pppm/disp there are two more things to consider. The first is that when using the pppm/disp, the cutoff parameter does no longer affect the accuracy of the simulation (subject to that gewald/disp is adjusted when changing the cutoff). The performance can thus be increased by examining different values for the cutoff parameter. A lower bound for the cutoff is only set by the truncation error of the repulsive term of pair potentials. The second is that the mixing rule of the pair style has an impact on the computation time when using the pppm/disp. Fastest computations are achieved when using the geometric mixing rule. Using the arithmetic mixing rule substantially increases the computational cost. The computational overhead can be reduced using the kspace_modify mix/disp geom and kspace_modify splittol commands. The first command simply enforces geometric mixing of the dispersion coefficients in kspace computations. This introduces some error in the computations but will also significantly speed-up the simulations. The second keyword sets the accuracy with which the dispersion coefficients are approximated using a matrix factorization approach. This may result in better accuracy then using the first command, but will usually also not provide an equally good increase of efficiency. Finally, pppm/disp can also be used when no mixing rules apply. This can be achieved using the kspace_modify mix/disp none command. Note that the code does not check automatically whether any mixing rule is fulfilled. If mixing rules do not apply, the user will have to specify this command explicitly. 187 LAMMPS Users Manual 6.25 Polarizable models In polarizable force fields the charge distributions in molecules and materials respond to their electrostatic environments. Polarizable systems can be simulated in LAMMPS using three methods: • the fluctuating charge method, implemented in the QEQ package, • the adiabatic core-shell method, implemented in the CORESHELL package, • the thermalized Drude dipole method, implemented in the USER-DRUDE package. The fluctuating charge method calculates instantaneous charges on interacting atoms based on the electronegativity equalization principle. It is implemented in the fix qeq which is available in several variants. It is a relatively efficient technique since no additional particles are introduced. This method allows for charge transfer between molecules or atom groups. However, because the charges are located at the interaction sites, off-plane components of polarization cannot be represented in planar molecules or atom groups. The two other methods share the same basic idea: polarizable atoms are split into one core atom and one satellite particle (called shell or Drude particle) attached to it by a harmonic spring. Both atoms bear a charge and they represent collectively an induced electric dipole. These techniques are computationally more expensive than the QEq method because of additional particles and bonds. These two charge-on-spring methods differ in certain features, with the core-shell model being normally used for ionic/crystalline materials, whereas the so-called Drude model is normally used for molecular systems and fluid states. The core-shell model is applicable to crystalline materials where the high symmetry around each site leads to stable trajectories of the core-shell pairs. However, bonded atoms in molecules can be so close that a core would interact too strongly or even capture the Drude particle of a neighbor. The Drude dipole model is relatively more complex in order to remediate this and other issues. Specifically, the Drude model includes specific thermostating of the core-Drude pairs and short-range damping of the induced dipoles. The three polarization methods can be implemented through a self-consistent calculation of charges or induced dipoles at each timestep. In the fluctuating charge scheme this is done by the matrix inversion method in fix qeq/point, but for core-shell or Drude-dipoles the relaxed-dipoles technique would require an slow iterative procedure. These self-consistent solutions yield accurate trajectories since the additional degrees of freedom representing polarization are massless. An alternative is to attribute a mass to the additional degrees of freedom and perform time integration using an extended Lagrangian technique. For the fluctuating charge scheme this is done by fix qeq/dynamic, and for the charge-on-spring models by the methods outlined in the next two sections. The assignment of masses to the additional degrees of freedom can lead to unphysical trajectories if care is not exerted in choosing the parameters of the polarizable models and the simulation conditions. In the core-shell model the vibration of the shells is kept faster than the ionic vibrations to mimic the fast response of the polarizable electrons. But in molecular 188 LAMMPS Users Manual systems thermalizing the core-Drude pairs at temperatures comparable to the rest of the simulation leads to several problems (kinetic energy transfer, too short a timestep, etc.) In order to avoid these problems the relative motion of the Drude particles with respect to their cores is kept "cold" so the vibration of the core-Drude pairs is very slow, approaching the self-consistent regime. In both models the temperature is regulated using the velocities of the center of mass of core+shell (or Drude) pairs, but in the Drude model the actual relative core-Drude particle motion is thermostated separately as well. 6.26 Adiabatic core/shell model The adiabatic core-shell model by Mitchell and Fincham is a simple method for adding polarizability to a system. In order to mimic the electron shell of an ion, a satellite particle is attached to it. This way the ions are split into a core and a shell where the latter is meant to react to the electrostatic environment inducing polarizability. Technically, shells are attached to the cores by a spring force f = k*r where k is a parametrized spring constant and r is the distance between the core and the shell. The charges of the core and the shell add up to the ion charge, thus q(ion) = q(core) + q(shell). This setup introduces the ion polarizability (alpha) given by alpha = q(shell)^2 / k. In a similar fashion the mass of the ion is distributed on the core and the shell with the core having the larger mass. To run this model in LAMMPS, atom_style full can be used since atom charge and bonds are needed. Each kind of core/shell pair requires two atom types and a bond type. The core and shell of a core/shell pair should be bonded to each other with a harmonic bond that provides the spring force. For example, a data file for NaCl, as found in examples/coreshell, has this format: 432 216 atoms bonds # core and shell atoms # number of core/shell springs 4 2 atom types bond types # 2 cores and 2 shells for Na and Cl 0.0 24.09597 xlo xhi 0.0 24.09597 ylo yhi 0.0 24.09597 zlo zhi Masses # core/shell mass ratio = 0.1 1 2 3 4 # # # # 20.690784 31.90500 2.298976 3.54500 Na Cl Na Cl core core shell shell Atoms 1 1 2 1 3 2 4 2 (...) 2 4 1 3 1.5005 -2.5005 1.5056 -0.5056 0.00000000 0.00000000 4.01599500 4.01599500 0.00000000 0.00000000 4.01599500 4.01599500 0.00000000 0.00000000 4.01599500 4.01599500 # # # # core of core/shell pair 1 shell of core/shell pair 1 core of core/shell pair 2 shell of core/shell pair 2 189 LAMMPS Users Manual Bonds # Bond topology for spring forces 1 2 2 2 (...) 1 3 2 4 # spring for core/shell pair 1 # spring for core/shell pair 2 Non-Coulombic (e.g. Lennard-Jones) pairwise interactions are only defined between the shells. Coulombic interactions are defined between all cores and shells. If desired, additional bonds can be specified between cores. The special_bonds command should be used to turn-off the Coulombic interaction within core/shell pairs, since that interaction is set by the bond spring. This is done using the special_bonds command with a 1-2 weight = 0.0, which is the default value. It needs to be considered whether one has to adjust the special_bonds weighting according to the molecular topology since the interactions of the shells are bypassed over an extra bond. Note that this core/shell implementation does not require all ions to be polarized. One can mix core/shell pairs and ions without a satellite particle if desired. Since the core/shell model permits distances of r = 0.0 between the core and shell, a pair style with a "cs" suffix needs to be used to implement a valid long-range Coulombic correction. Several such pair styles are provided in the CORESHELL package. See this doc page for details. All of the core/shell enabled pair styles require the use of a long-range Coulombic solver, as specified by the kspace_style command. Either the PPPM or Ewald solvers can be used. For the NaCL example problem, these pair style and bond style settings are used: pair_style pair_coeff pair_coeff pair_coeff pair_coeff born/coul/long/cs 20.0 20.0 * * 0.0 1.000 0.00 0.00 0.00 3 3 487.0 0.23768 0.00 1.05 0.50 #Na-Na 3 4 145134.0 0.23768 0.00 6.99 8.70 #Na-Cl 4 4 405774.0 0.23768 0.00 72.40 145.40 #Cl-Cl bond_style bond_coeff bond_coeff harmonic 1 63.014 0.0 2 25.724 0.0 When running dynamics with the adiabatic core/shell model, the following issues should be considered. The relative motion of the core and shell particles corresponds to the polarization, hereby an instantaneous relaxation of the shells is approximated and a fast core/shell spring frequency ensures a nearly constant internal kinetic energy during the simulation. Thermostats can alter this polarization behaviour, by scaling the internal kinetic energy, meaning the shell will not react freely to its electrostatic environment. Therefore it is typically desirable to decouple the relative motion of the core/shell pair, which is an imaginary degree of freedom, from the real physical system. To do that, the compute temp/cs command can be used, in conjunction with any of the thermostat fixes, such as fix nvt or fix langevin. This compute uses the center-of-mass velocity of the core/shell pairs to calculate a temperature, and insures that velocity is what is rescaled for thermostatting purposes. This compute also works for a system with both core/shell pairs and non-polarized ions (ions without an attached satellite particle). The compute temp/cs command requires 190 LAMMPS Users Manual input of two groups, one for the core atoms, another for the shell atoms. Non-polarized ions which might also be included in the treated system should not be included into either of these groups, they are taken into account by the group-ID (2nd argument) of the compute. The groups can be defined using the group type command. Note that to perform thermostatting using this definition of temperature, the fix modify temp command should be used to assign the compute to the thermostat fix. Likewise the thermo_modify temp command can be used to make this temperature be output for the overall system. For the NaCl example, this can be done as follows: group cores type 1 2 group shells type 3 4 compute CSequ all temp/cs cores shells fix thermoberendsen all temp/berendsen 1427 1427 0.4 fix thermostatequ all nve fix_modify thermoberendsen temp CSequ thermo_modify temp CSequ # thermostat for the true physical syst # integrator as needed for the berendse # output of center-of-mass derived temp The pressure for the core/shell system is computed via the regular LAMMPS convention by treating the cores and shells as individual particles. For the thermo output of the pressure as well as for the application of a barostat, it is necessary to use an additional pressure compute based on the default temperature and specifying it as a second argument in fix modify and thermo_modify resulting in: (...) compute CSequ all temp/cs cores shells compute thermo_press_lmp all pressure thermo_temp thermo_modify temp CSequ press thermo_press_lmp fix press_bar all npt temp 300 300 0.04 iso 0 0 0.4 fix_modify press_bar temp CSequ press thermo_press_lmp # pressure for individual particles # modify thermo to regular pressure # pressure modification for correct kin If compute temp/cs is used, the decoupled relative motion of the core and the shell should in theory be stable. However numerical fluctuation can introduce a small momentum to the system, which is noticable over long trajectories. Therefore it is recommendable to use the fix momentum command in combination with compute temp/cs when equilibrating the system to prevent any drift. When initializing the velocities of a system with core/shell pairs, it is also desirable to not introduce energy into the relative motion of the core/shell particles, but only assign a center-of-mass velocity to the pairs. This can be done by using the bias keyword of the velocity create command and assigning the compute temp/cs command to the temp keyword of the velocity command, e.g. velocity all create 1427 134 bias yes temp CSequ velocity all scale 1427 temp CSequ To maintain the correct polarizability of the core/shell pairs, the kinetic energy of the internal motion shall remain nearly constant. Therefore the choice of spring force and mass ratio need to ensure much faster relative motion of the 2 atoms within the core/shell pair than their center-of-mass velocity. This allows the shells to effectively react instantaneously to the electrostatic environment and limits energy transfer to or from the core/shell oscillators. This fast movement also dictates the timestep that can 191 LAMMPS Users Manual be used. The primary literature of the adiabatic core/shell model suggests that the fast relative motion of the core/shell pairs only allows negligible energy transfer to the environment. The mentioned energy transfer will typically lead to a small drift in total energy over time. This internal energy can be monitored using the compute chunk/atom and compute temp/chunk commands. The internal kinetic energies of each core/shell pair can then be summed using the sum() special function of the variable command. Or they can be time/averaged and output using the fix ave/time command. To use these commands, each core/shell pair must be defined as a "chunk". If each core/shell pair is defined as its own molecule, the molecule ID can be used to define the chunks. If cores are bonded to each other to form larger molecules, the chunks can be identified by the fix property/atom via assigning a core/shell ID to each atom using a special field in the data file read by the read_data command. This field can then be accessed by the compute property/atom command, to use as input to the compute chunk/atom command to define the core/shell pairs as chunks. For example if core/shell pairs are the only molecules: read_data NaCl_CS_x0.1_prop.data compute prop all property/atom molecule compute cs_chunk all chunk/atom c_prop compute cstherm all temp/chunk cs_chunk temp internal com yes cdof 3.0 fix ave_chunk all ave/time 10 1 10 c_cstherm file chunk.dump mode vector # note the chosen de For example if core/shell pairs and other molecules are present: fix csinfo all property/atom i_CSID read_data NaCl_CS_x0.1_prop.data fix csinfo NULL CS-Info compute prop all property/atom i_CSID (...) # property/atom command # atom property added in the data-fil The additional section in the date file would be formatted like this: CS-Info # header of additional section 1 1 2 1 3 2 4 2 5 3 6 3 7 4 8 4 (...) # column 1 = atom ID, column 2 = core/shell ID 6.27 Drude induced dipoles The thermalized Drude model, similarly to the core-shell model, represents induced dipoles by a pair of charges (the core atom and the Drude particle) connected by a harmonic spring. The Drude model has a number of features aimed at its use in molecular systems (Lamoureux and Roux): 192 LAMMPS Users Manual • Thermostating of the additional degrees of freedom associated with the induced dipoles at very low temperature, in terms of the reduced coordinates of the Drude particles with respect to their cores. This makes the trajectory close to that of relaxed induced dipoles. • Consistent definition of 1-2 to 1-4 neighbors. A core-Drude particle pair represents a single (polarizable) atom, so the special screening factors in a covalent structure should be the same for the core and the Drude particle. Drude particles have to inherit the 1-2, 1-3, 1-4 special neighbor relations from their respective cores. • Stabilization of the interactions between induced dipoles. Drude dipoles on covalently bonded atoms interact too strongly due to the short distances, so an atom may capture the Drude particle of a neighbor, or the induced dipoles within the same molecule may align too much. To avoid this, damping at short range can be done by Thole functions (for which there are physical grounds). This Thole damping is applied to the point charges composing the induced dipole (the charge of the Drude particle and the opposite charge on the core, not to the total charge of the core atom). A detailed tutorial covering the usage of Drude induced dipoles in LAMMPS is available here. As with the core-shell model, the cores and Drude particles should appear in the data file as standard atoms. The same holds for the springs between them, which are described by standard harmonic bonds. The nature of the atoms (core, Drude particle or non-polarizable) is specified via the fix drude command. The special list of neighbors is automatically refactored to account for the equivalence of core and Drude particles as regards special 1-2 to 1-4 screening. It may be necessary to use the extra/special/per/atom keyword of the read_data command. If using fix shake, make sure no Drude particle is in this fix group. There are two ways to thermostat the Drude particles at a low temperature: use either fix langevin/drude for a Langevin thermostat, or fix drude/transform/* for a Nose-Hoover thermostat. The former requires use of the command comm_modify vel yes. The latter requires two separate integration fixes like nvt or npt. The correct temperatures of the reduced degrees of freedom can be calculated using the compute temp/drude. This requires also to use the command comm_modify vel yes. Short-range damping of the induced dipole interactions can be achieved using Thole functions through the pair style thole in pair_style hybrid/overlay with a Coulomb pair style. It may be useful to use coul/long/cs or similar from the CORESHELL package if the core and Drude particle come too close, which can cause numerical issues. (Berendsen) Berendsen, Grigera, Straatsma, J Phys Chem, 91, 6269-6271 (1987). (Cornell) Cornell, Cieplak, Bayly, Gould, Merz, Ferguson, Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995). 193 LAMMPS Users Manual (Horn) Horn, Swope, Pitera, Madura, Dick, Hura, and Head-Gordon, J Chem Phys, 120, 9665 (2004). (Ikeshoji) Ikeshoji and Hafskjold, Molecular Physics, 81, 251-261 (1994). (Wirnsberger) Wirnsberger, Frenkel, and Dellago, J Chem Phys, 143, 124104 (2015). (MacKerell) MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field, Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998). (Mayo) Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909 (1990). (Jorgensen) Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem Phys, 79, 926 (1983). (Price) Price and Brooks, J Chem Phys, 121, 10096 (2004). (Shinoda) Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004). (Mitchell and Fincham) Mitchell, Fincham, J Phys Condensed Matter, 5, 1031-1038 (1993). (Fincham) Fincham, Mackrodt and Mitchell, J Phys Condensed Matter, 6, 393-404 (1994). (Lamoureux and Roux) G. Lamoureux, B. Roux, J. Chem. Phys 119, 3025 (2003) 194 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 7. Example problems The LAMMPS distribution includes an examples sub-directory with many sample problems. Many are 2d models that run quickly are are straightforward to visualize, requiring at most a couple of minutes to run on a desktop machine. Each problem has an input script (in.*) and produces a log file (log.*) when it runs. Some use a data file (data.*) of initial coordinates as additional input. A few sample log file run on different machines and different numbers of processors are included in the directories to compare your answers to. E.g. a log file like log.date.crack.foo.P means the "crack" example was run on P processors of machine "foo" on that date (i.e. with that version of LAMMPS). Many of the input files have commented-out lines for creating dump files and image files. If you uncomment the dump command in the input script, a text dump file will be produced, which can be animated by various visualization programs. If you uncomment the dump image command in the input script, and assuming you have built LAMMPS with a JPG library, JPG snapshot images will be produced when the simulation runs. They can be quickly post-processed into a movie using commands described on the dump image doc page. Animations of many of the examples can be viewed on the Movies section of the LAMMPS web site. There are two kinds of sub-directories in the examples dir. Lowercase dirs contain one or a few simple, quick-to-run problems. Uppercase dirs contain up to several complex scripts that illustrate a particular kind of simulation method or model. Some of these run for longer times, e.g. to measure a particular quantity. Lists of both kinds of directories are given below. Lowercase directories accelerate airebo balance body cmap colloid comb coreshell controller crack run with various acceleration options (OpenMP, GPU, Phi) polyethylene with AIREBO potential dynamic load balancing, 2d system body particles, 2d system CMAP 5-body contributions to CHARMM force field big colloid particles in a small particle solvent, 2d system models using the COMB potential core/shell model using CORESHELL package use of fix controller as a thermostat crack propagation in a 2d solid 195 LAMMPS Users Manual deposit deposit atoms and molecules on a surface dipole point dipolar particles, 2d system dreiding methanol via Dreiding FF eim NaCl using the EIM potential ellipse ellipsoidal particles in spherical solvent, 2d system flow Couette and Poiseuille flow in a 2d channel friction frictional contact of spherical asperities between 2d surfaces gcmc Grand Canonical Monte Carlo (GCMC) via the fix gcmc command granregion use of fix wall/region/gran as boundary on granular particles hugoniostat Hugoniostat shock dynamics indent spherical indenter into a 2d solid kim use of potentials in Knowledge Base for Interatomic Models (KIM) meam MEAM test for SiC and shear (same as shear examples) melt rapid melt of 3d LJ system micelle self-assembly of small lipid-like molecules into 2d bilayers min energy minimization of 2d LJ melt mscg parameterize a multi-scale coarse-graining (MSCG) model msst MSST shock dynamics nb3b use of nonbonded 3-body harmonic pair style neb nudged elastic band (NEB) calculation for barrier finding nemd non-equilibrium MD of 2d sheared system obstacle flow around two voids in a 2d channel peptide dynamics of a small solvated peptide chain (5-mer) peri Peridynamic model of cylinder impacted by indenter pour pouring of granular particles into a 3d box, then chute flow prd parallel replica dynamics of vacancy diffusion in bulk Si python using embedded Python in a LAMMPS input script qeq use of the QEQ package for charge equilibration reax RDX and TATB models using the ReaxFF rigid rigid bodies modeled as independent or coupled shear sideways shear applied to 2d solid, with and without a void snap NVE dynamics for BCC tantalum crystal using SNAP potential srd stochastic rotation dynamics (SRD) particles as solvent streitz use of Streitz/Mintmire potential with charge equilibration tad temperature-accelerated dynamics of vacancy diffusion in bulk Si vashishta use of the Vashishta potential voronoi Voronoi tesselation via compute voronoi/atom command Here is how you can run and visualize one of the sample problems: cd indent cp ../../src/lmp_linux . lmp_linux -in in.indent # copy LAMMPS executable to this dir # run the problem 196 LAMMPS Users Manual Running the simulation produces the files dump.indent and log.lammps. You can visualize the dump file of snapshots with a variety of 3rd-party tools highlighted on the Visualization page of the LAMMPS web site. If you uncomment the dump image line(s) in the input script a series of JPG images will be produced by the run (assuming you built LAMMPS with JPG support; see Section 2.2 for details). These can be viewed individually or turned into a movie or animated by tools like ImageMagick or QuickTime or various Windows-based tools. See the dump image doc page for more details. E.g. this Imagemagick command would create a GIF file suitable for viewing in a browser. % convert -loop 1 *.jpg foo.gif Uppercase directories various aspherical particle models, using ellipsoids, rigid bodies, line/triangle particles, etc COUPLE examples of how to use LAMMPS as a library DIFFUSE compute diffusion coefficients via several methods ELASTIC compute elastic constants at zero temperature ELASTIC_T compute elastic constants at finite temperature KAPPA compute thermal conductivity via several methods MC using LAMMPS in a Monte Carlo mode to relax the energy of a system USER examples for USER packages and USER-contributed commands VISCOSITY compute viscosity via several methods Nearly all of these directories have README files which give more details on how to understand and use their contents. ASPHERE The USER directory has a large number of sub-directories which correspond by name to a USER package. They contain scripts that illustrate how to use the command(s) provided in that package. Many of the sub-directories have their own README files which give further instructions. See the Section 4 doc page for more info on specific USER packages. 197 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 8. Performance & scalability Current LAMMPS performance is discussed on the Benchmarks page of the LAMMPS WWW Site where CPU timings and parallel efficiencies are listed. The page has several sections, which are briefly described below: • CPU performance on 5 standard problems, strong and weak scaling • GPU and Xeon Phi performance on same and related problems • Comparison of cost of interatomic potentials • Performance of huge, billion-atom problems The 5 standard problems are as follow: 1. LJ = atomic fluid, Lennard-Jones potential with 2.5 sigma cutoff (55 neighbors per atom), NVE integration 2. Chain = bead-spring polymer melt of 100-mer chains, FENE bonds and LJ pairwise interactions with a 2^(1/6) sigma cutoff (5 neighbors per atom), NVE integration 3. EAM = metallic solid, Cu EAM potential with 4.95 Angstrom cutoff (45 neighbors per atom), NVE integration 4. Chute = granular chute flow, frictional history potential with 1.1 sigma cutoff (7 neighbors per atom), NVE integration 5. Rhodo = rhodopsin protein in solvated lipid bilayer, CHARMM force field with a 10 Angstrom LJ cutoff (440 neighbors per atom), particle-particle particle-mesh (PPPM) for long-range Coulombics, NPT integration Input files for these 5 problems are provided in the bench directory of the LAMMPS distribution. Each has 32,000 atoms and runs for 100 timesteps. The size of the problem (number of atoms) can be varied using command-line switches as described in the bench/README file. This is an easy way to test performance and either strong or weak scalability on your machine. The bench directory includes a few log.* files that show performance of these 5 problems on 1 or 4 cores of Linux desktop. The bench/FERMI and bench/KEPLER dirs have input files and scripts and instructions for running the same (or similar) problems using OpenMP or GPU or Xeon Phi acceleration options. See the README files in those dirs and the Section 5.3 doc pages for instructions on how to build LAMMPS and run on that kind of hardware. The bench/POTENTIALS directory has input files which correspond to the table of results on the Potentials section of the Benchmarks web page. So you can also run those test problems on your machine. The billion-atom section of the Benchmarks web page has performance data for very large benchmark runs of simple Lennard-Jones (LJ) models, which use the bench/in.lj input script. 198 LAMMPS Users Manual For all the benchmarks, a useful metric is the CPU cost per atom per timestep. Since performance scales roughly linearly with problem size and timesteps for all LAMMPS models (i.e. interatomic or coarse-grained potentials), the run time of any problem using the same model (atom style, force field, cutoff, etc) can then be estimated. Performance on a parallel machine can also be predicted from one-core or one-node timings if the parallel efficiency can be estimated. The communication bandwidth and latency of a particular parallel machine affects the efficiency. On most machines LAMMPS will give parallel efficiencies on these benchmarks above 50% so long as the number of atoms/core is a few 100 or greater, and closer to 100% for large numbers of atoms/core. This is for all-MPI mode with one MPI task per core. For nodes with accelerator options or hardware (OpenMP, GPU, Phi), you should first measure single node performance. Then you can estimate parallel performance for multi-node runs using the same logic as for all-MPI mode, except that now you will typically need many more atoms/node to achieve good scalability. 199 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 9. Additional tools LAMMPS is designed to be a computational kernel for performing molecular dynamics computations. Additional pre- and post-processing steps are often necessary to setup and analyze a simulation. A list of such tools can be found on the LAMMPS home page at http://lammps.sandia.gov/prepost.html A few additional tools are provided with the LAMMPS distribution and are described in this section. Our group has also written and released a separate toolkit called Pizza.py which provides tools for doing setup, analysis, plotting, and visualization for LAMMPS simulations. Pizza.py is written in Python and is available for download from the Pizza.py WWW site. Note that many users write their own setup or analysis tools or use other existing codes and convert their output to a LAMMPS input format or vice versa. The tools listed here are included in the LAMMPS distribution as examples of auxiliary tools. Some of them are not actively supported by Sandia, as they were contributed by LAMMPS users. If you have problems using them, we can direct you to the authors. The source code for each of these codes is in the tools sub-directory of the LAMMPS distribution. There is a Makefile (which you may need to edit for your platform) which will build several of the tools which reside in that directory. Most of them are larger packages in their own sub-directories with their own Makefiles and/or README files. amber2lmp binary2txt ch2lmp chain colvars createatoms doxygen drude eam database eam generate eff emacs fep i-pi ipp kate lmp2arc lmp2cfg matlab micelle2d moltemplate msi2lmp phonon polybond pymol_asphere python reax smd vim xmgrace amber2lmp tool The amber2lmp sub-directory contains two Python scripts for converting files back-and-forth between the AMBER MD code and LAMMPS. See the README file in amber2lmp for more information. These tools were written by Keir Novik while he was at Queen Mary University of London. Keir is no longer there and cannot support these tools which are out-of-date with respect to the current LAMMPS version (and maybe with respect to AMBER as well). Since we don't use these tools at Sandia, you'll need to experiment with them and make necessary modifications yourself. binary2txt tool The file binary2txt.cpp converts one or more binary LAMMPS dump file into ASCII text files. The syntax for running the tool is 200 LAMMPS Users Manual binary2txt file1 file2 ... which creates file1.txt, file2.txt, etc. This tool must be compiled on a platform that can read the binary file created by a LAMMPS run, since binary files are not compatible across all platforms. ch2lmp tool The ch2lmp sub-directory contains tools for converting files back-and-forth between the CHARMM MD code and LAMMPS. They are intended to make it easy to use CHARMM as a builder and as a post-processor for LAMMPS. Using charmm2lammps.pl, you can convert a PDB file with associated CHARMM info, including CHARMM force field data, into its LAMMPS equivalent. Support for the CMAP correction of CHARMM22 and later is available as an option. This tool can also add solvent water molecules and Na+ or Cl- ions to the system. Using lammps2pdb.pl you can convert LAMMPS atom dumps into PDB files. See the README file in the ch2lmp sub-directory for more information. These tools were created by Pieter in't Veld (pjintve at sandia.gov) and Paul Crozier (pscrozi at sandia.gov) at Sandia. CMAP support added and tested by Xiaohu Hu (hux2 at ornl.gov) and Robert A. Latour (latourr at clemson.edu), David Hyde-Volpe, and Tigran Abramyan, (Clemson University) and Chris Lorenz (chris.lorenz at kcl.ac.uk), King's College London. chain tool The file chain.f creates a LAMMPS data file containing bead-spring polymer chains and/or monomer solvent atoms. It uses a text file containing chain definition parameters as an input. The created chains and solvent atoms can strongly overlap, so LAMMPS needs to run the system initially with a "soft" pair potential to un-overlap it. The syntax for running the tool is chain data.file See the def.chain or def.chain.ab files in the tools directory for examples of definition files. This tool was used to create the system for the chain benchmark. colvars tools The colvars directory contains a collection of tools for postprocessing data produced by the colvars collective variable library. To compile the tools, edit the makefile for your system and run "make". Please report problems and issues the colvars library and its tools at: https://github.com/colvars/colvars/issues abf_integrate: 201 LAMMPS Users Manual MC-based integration of multidimensional free energy gradient Version 20110511 Syntax: ./abf_integrate [-n ] [-t ] [-m [0|1] (metadynamics)] [-h The LAMMPS interface to the colvars collective variable library, as well as these tools, were created by Axel Kohlmeyer (akohlmey at gmail.com) at ICTP, Italy. createatoms tool The tools/createatoms directory contains a Fortran program called createAtoms.f which can generate a variety of interesting crystal structures and geometries and output the resulting list of atom coordinates in LAMMPS or other formats. See the included Manual.pdf for details. The tool is authored by Xiaowang Zhou (Sandia), xzhou at sandia.gov. doxygen tool The tools/doxygen directory contains a shell script called doxygen.sh which can generate a call graph and API lists using the Doxygen software. See the included README file for details. The tool is authored by Nandor Tamaskovics, numericalfreedom at googlemail.com. drude tool The tools/drude directory contains a Python script called polarizer.py which can add Drude oscillators to a LAMMPS data file in the required format. See the header of the polarizer.py file for details. The tool is authored by Agilio Padua and Alain Dequidt: agilio.padua at univ-bpclermont.fr, alain.dequidt at univ-bpclermont.fr eam database tool The tools/eam_database directory contains a Fortran program that will generate EAM alloy setfl potential files for any combination of 16 elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg, Co, Ti, Zr. The files can then be used with the pair_style eam/alloy command. The tool is authored by Xiaowang Zhou (Sandia), xzhou at sandia.gov, and is based on his paper: X. W. Zhou, R. A. Johnson, and H. N. G. Wadley, Phys. Rev. B, 69, 144113 (2004). 202 LAMMPS Users Manual eam generate tool The tools/eam_generate directory contains several one-file C programs that convert an analytic formula into a tabulated embedded atom method (EAM) setfl potential file. The potentials they produce are in the potentials directory, and can be used with the pair_style eam/alloy command. The source files and potentials were provided by Gerolf Ziegenhain (gerolf at ziegenhain.com). eff tool The tools/eff directory contains various scripts for generating structures and post-processing output for simulations using the electron force field (eFF). These tools were provided by Andres Jaramillo-Botero at CalTech (ajaramil at wag.caltech.edu). emacs tool The tools/emacs directory contains a Lips add-on file for Emacs that enables a lammps-mode for editing of input scripts when using Emacs, with various highlighting options setup. These tools were provided by Aidan Thompson at Sandia (athomps at sandia.gov). fep tool The tools/fep directory contains Python scripts useful for post-processing results from performing free-energy perturbation simulations using the USER-FEP package. The scripts were contributed by Agilio Padua (Universite Blaise Pascal Clermont-Ferrand), agilio.padua at univ-bpclermont.fr. See README file in the tools/fep directory. i-pi tool The tools/i-pi directory contains a version of the i-PI package, with all the LAMMPS-unrelated files removed. It is provided so that it can be used with the fix ipi command to perform path-integral molecular dynamics (PIMD). The i-PI package was created and is maintained by Michele Ceriotti, michele.ceriotti at gmail.com, to interface to a variety of molecular dynamics codes. See the tools/i-pi/manual.pdf file for an overview of i-PI, and the fix ipi doc page for further details on running PIMD calculations with LAMMPS. 203 LAMMPS Users Manual ipp tool The tools/ipp directory contains a Perl script ipp which can be used to facilitate the creation of a complicated file (say, a lammps input script or tools/createatoms input file) using a template file. ipp was created and is maintained by Reese Jones (Sandia), rjones at sandia.gov. See two examples in the tools/ipp directory. One of them is for the tools/createatoms tool's input file. kate tool The file in the tools/kate directory is an add-on to the Kate editor in the KDE suite that allow syntax highlighting of LAMMPS input scripts. See the README.txt file for details. The file was provided by Alessandro Luigi Sellerio (alessandro.sellerio at ieni.cnr.it). lmp2arc tool The lmp2arc sub-directory contains a tool for converting LAMMPS output files to the format for Accelrys' Insight MD code (formerly MSI/Biosym and its Discover MD code). See the README file for more information. This tool was written by John Carpenter (Cray), Michael Peachey (Cray), and Steve Lustig (Dupont). John is now at the Mayo Clinic (jec at mayo.edu), but still fields questions about the tool. This tool was updated for the current LAMMPS C++ version by Jeff Greathouse at Sandia (jagreat at sandia.gov). lmp2cfg tool The lmp2cfg sub-directory contains a tool for converting LAMMPS output files into a series of *.cfg files which can be read into the AtomEye visualizer. See the README file for more information. This tool was written by Ara Kooser at Sandia (askoose at sandia.gov). matlab tool The matlab sub-directory contains several MATLAB scripts for post-processing LAMMPS output. The scripts include readers for log and dump files, a reader for EAM potential files, and a converter that reads LAMMPS dump files and produces CFG files that can be visualized with the AtomEye visualizer. See the README.pdf file for more information. 204 LAMMPS Users Manual These scripts were written by Arun Subramaniyan at Purdue Univ (asubrama at purdue.edu). micelle2d tool The file micelle2d.f creates a LAMMPS data file containing short lipid chains in a monomer solution. It uses a text file containing lipid definition parameters as an input. The created molecules and solvent atoms can strongly overlap, so LAMMPS needs to run the system initially with a "soft" pair potential to un-overlap it. The syntax for running the tool is micelle2d data.file See the def.micelle2d file in the tools directory for an example of a definition file. This tool was used to create the system for the micelle example. moltemplate tool The moltemplate sub-directory contains a Python-based tool for building molecular systems based on a text-file description, and creating LAMMPS data files that encode their molecular topology as lists of bonds, angles, dihedrals, etc. See the README.TXT file for more information. This tool was written by Andrew Jewett (jewett.aij at gmail.com), who supports it. It has its own WWW page at http://moltemplate.org. msi2lmp tool The msi2lmp sub-directory contains a tool for creating LAMMPS template input and data files from BIOVIA's Materias Studio files (formerly Accelrys' Insight MD code, formerly MSI/Biosym and its Discover MD code). This tool was written by John Carpenter (Cray), Michael Peachey (Cray), and Steve Lustig (Dupont). Several people contributed changes to remove bugs and adapt its output to changes in LAMMPS. This tool has several known limitations and is no longer under active development, so there are no changes except for the occasional bugfix. See the README file in the tools/msi2lmp folder for more information. phonon tool The phonon sub-directory contains a post-processing tool useful for analyzing the output of the fix phonon command in the USER-PHONON package. See the README file for instruction on building the tool and what library it needs. And see the examples/USER/phonon directory for example problems that can be post-processed with this tool. 205 LAMMPS Users Manual This tool was written by Ling-Ti Kong at Shanghai Jiao Tong University. polybond tool The polybond sub-directory contains a Python-based tool useful for performing "programmable polymer bonding". The Python file lmpsdata.py provides a "Lmpsdata" class with various methods which can be invoked by a user-written Python script to create data files with complex bonding topologies. See the Manual.pdf for details and example scripts. This tool was written by Zachary Kraus at Georgia Tech. pymol_asphere tool The pymol_asphere sub-directory contains a tool for converting a LAMMPS dump file that contains orientation info for ellipsoidal particles into an input file for the PyMol visualization package or its open source variant. Specifically, the tool triangulates the ellipsoids so they can be viewed as true ellipsoidal particles within PyMol. See the README and examples directory within pymol_asphere for more information. This tool was written by Mike Brown at Sandia. python tool The python sub-directory contains several Python scripts that perform common LAMMPS post-processing tasks, such as: • extract thermodynamic info from a log file as columns of numbers • plot two columns of thermodynamic info from a log file using GnuPlot • sort the snapshots in a dump file by atom ID • convert multiple NEB dump files into one dump file for viz • convert dump files into XYZ, CFG, or PDB format for viz by other packages These are simple scripts built on Pizza.py modules. See the README for more info on Pizza.py and how to use these scripts. reax tool The reax sub-directory contains stand-alond codes that can post-process the output of the fix reax/bonds command from a LAMMPS simulation using ReaxFF. See the README.txt file for more info. These tools were written by Aidan Thompson at Sandia. 206 LAMMPS Users Manual smd tool The smd sub-directory contains a C++ file dump2vtk_tris.cpp and Makefile which can be compiled and used to convert triangle output files created by the Smooth-Mach Dynamics (USER-SMD) package into a VTK-compatible unstructured grid file. It could then be read in and visualized by VTK. See the header of dump2vtk.cpp for more details. This tool was written by the USER-SMD package author, Georg Ganzenmuller at the Fraunhofer-Institute for High-Speed Dynamics, Ernst Mach Institute in Germany (georg.ganzenmueller at emi.fhg.de). vim tool The files in the tools/vim directory are add-ons to the VIM editor that allow easier editing of LAMMPS input scripts. See the README.txt file for details. These files were provided by Gerolf Ziegenhain (gerolf at ziegenhain.com) xmgrace tool The files in the tools/xmgrace directory can be used to plot the thermodynamic data in LAMMPS log files via the xmgrace plotting package. There are several tools in the directory that can be used in post-processing mode. The lammpsplot.cpp file can be compiled and used to create plots from the current state of a running LAMMPS simulation. See the README file for details. These files were provided by Vikas Varshney (vv0210 at gmail.com) 207 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 10. Modifying & extending LAMMPS This section describes how to customize LAMMPS by modifying and extending its source code. 10.1 Atom styles 10.2 Bond, angle, dihedral, improper potentials 10.3 Compute styles 10.4 Dump styles 10.5 Dump custom output options 10.6 Fix styles which include integrators, temperature and pressure control, force constraints, boundary conditions, diagnostic output, etc 10.7 Input script commands 10.8 Kspace computations 10.9 Minimization styles 10.10 Pairwise potentials 10.11 Region styles 10.12 Body styles 10.13 Thermodynamic output options 10.14 Variable options 10.15 Submitting new features for inclusion in LAMMPS LAMMPS is designed in a modular fashion so as to be easy to modify and extend with new functionality. In fact, about 75% of its source code is files added in this fashion. In this section, changes and additions users can make are listed along with minimal instructions. If you add a new feature to LAMMPS and think it will be of interest to general users, we encourage you to submit it to the developers for inclusion in the released version of LAMMPS. Information about how to do this is provided below. The best way to add a new feature is to find a similar feature in LAMMPS and look at the corresponding source and header files to figure out what it does. You will need some knowledge of C++ to be able to understand the hi-level structure of LAMMPS and its class organization, but functions (class methods) that do actual computations are written in vanilla C-style code and operate on simple C-style data structures (vectors and arrays). Most of the new features described in this section require you to write a new C++ derived class (except for exceptions described below, where you can make small edits to existing files). Creating a new class requires 2 files, a source code file (*.cpp) and a header file (*.h). The derived class must provide certain methods to work as a new option. Depending on how different your new feature is compared to existing features, you can either derive from the base class itself, or from a derived class that already exists. Enabling LAMMPS to invoke the new class is as simple as putting the two source files in the src dir and re-building LAMMPS. The advantage of C++ and its object-orientation is that all the code and variables 208 LAMMPS Users Manual needed to define the new feature are in the 2 files you write, and thus shouldn't make the rest of LAMMPS more complex or cause side-effect bugs. Here is a concrete example. Suppose you write 2 files pair_foo.cpp and pair_foo.h that define a new class PairFoo that computes pairwise potentials described in the classic 1997 paper by Foo, et al. If you wish to invoke those potentials in a LAMMPS input script with a command like pair_style foo 0.1 3.5 then your pair_foo.h file should be structured as follows: #ifdef PAIR_CLASS PairStyle(foo,PairFoo) #else ... (class definition for PairFoo) ... #endif where "foo" is the style keyword in the pair_style command, and PairFoo is the class name defined in your pair_foo.cpp and pair_foo.h files. When you re-build LAMMPS, your new pairwise potential becomes part of the executable and can be invoked with a pair_style command like the example above. Arguments like 0.1 and 3.5 can be defined and processed by your new class. As illustrated by this pairwise example, many kinds of options are referred to in the LAMMPS documentation as the "style" of a particular command. The instructions below give the header file for the base class that these styles are derived from. Public variables in that file are ones used and set by the derived classes which are also used by the base class. Sometimes they are also used by the rest of LAMMPS. Virtual functions in the base class header file which are set = 0 are ones you must define in your new derived class to give it the functionality LAMMPS expects. Virtual functions that are not set to 0 are functions you can optionally define. Additionally, new output options can be added directly to the thermo.cpp, dump_custom.cpp, and variable.cpp files as explained below. Here are additional guidelines for modifying LAMMPS and adding new functionality: • Think about whether what you want to do would be better as a pre- or post-processing step. Many computations are more easily and more quickly done that way. • Don't do anything within the timestepping of a run that isn't parallel. E.g. don't accumulate a bunch of data on a single processor and analyze it. You run the risk of seriously degrading the parallel efficiency. • If your new feature reads arguments or writes output, make sure you follow the unit conventions discussed by the units command. • If you add something you think is truly useful and doesn't impact LAMMPS performance when it isn't used, send an email to the developers. We might be 209 LAMMPS Users Manual interested in adding it to the LAMMPS distribution. See further details on this at the bottom of this page. 10.1 Atom styles Classes that define an atom style are derived from the AtomVec class and managed by the Atom class. The atom style determines what attributes are associated with an atom. A new atom style can be created if one of the existing atom styles does not define all the attributes you need to store and communicate with atoms. Atom_vec_atomic.cpp is a simple example of an atom style. Here is a brief description of methods you define in your new derived class. See atom_vec.h for details. init grow one time setup (optional) re-allocate atom arrays to longer lengths (required) make array pointers in Atom and AtomVec classes consistent grow_reset (required) copy info for one atom to another atom's array locations copy (required) store an atom's info in a buffer communicated every timestep pack_comm (required) pack_comm_vel add velocity info to communication buffer (required) pack_comm_hybrid store extra info unique to this atom style (optional) unpack_comm retrieve an atom's info from the buffer (required) unpack_comm_vel also retrieve velocity info (required) unpack_comm_hybrid retrieve extra info unique to this atom style (optional) store an atom's info in a buffer communicating partial forces pack_reverse (required) pack_reverse_hybrid store extra info unique to this atom style (optional) unpack_reverse retrieve an atom's info from the buffer (required) unpack_reverse_hybrid retrieve extra info unique to this atom style (optional) store an atom's info in a buffer communicated on neighbor pack_border re-builds (required) pack_border_vel add velocity info to buffer (required) pack_border_hybrid store extra info unique to this atom style (optional) unpack_border retrieve an atom's info from the buffer (required) unpack_border_vel also retrieve velocity info (required) unpack_border_hybrid retrieve extra info unique to this atom style (optional) store all an atom's info to migrate to another processor pack_exchange (required) unpack_exchange retrieve an atom's info from the buffer (required) 210 LAMMPS Users Manual number of restart quantities associated with proc's atoms (required) pack_restart pack atom quantities into a buffer (required) unpack_restart unpack atom quantities from a buffer (required) create_atom create an individual atom of this style (required) data_atom parse an atom line from the data file (required) data_atom_hybrid parse additional atom info unique to this atom style (optional) data_vel parse one line of velocity information from data file (optional) parse additional velocity data unique to this atom style data_vel_hybrid (optional) memory_usage tally memory allocated by atom arrays (required) The constructor of the derived class sets values for several variables that you must set when defining a new atom style, which are documented in atom_vec.h. New atom arrays are defined in atom.cpp. Search for the word "customize" and you will find locations you will need to modify. size_restart NOTE: It is possible to add some attributes, such as a molecule ID, to atom styles that do not have them via the fix property/atom command. This command also allows new custom attributes consisting of extra integer or floating-point values to be added to atoms. See the fix property/atom doc page for examples of cases where this is useful and details on how to initialize, access, and output the custom values. New pair styles, fixes, or computes can be added to LAMMPS, as discussed below. The code for these classes can use the per-atom properties defined by fix property/atom. The Atom class has a find_custom() method that is useful in this context: int index = atom->find_custom(char *name, int &flag); The "name" of a custom attribute, as specified in the fix property/atom command, is checked to verify that it exists and its index is returned. The method also sets flag = 0/1 depending on whether it is an integer or floating-point attribute. The vector of values associated with the attribute can then be accessed using the returned index as int *ivector = atom->ivector[index]; double *dvector = atom->dvector[index]; Ivector or dvector are vectors of length Nlocal = # of owned atoms, which store the attributes of individual atoms. 10.2 Bond, angle, dihedral, improper potentials Classes that compute molecular interactions are derived from the Bond, Angle, Dihedral, and Improper classes. New styles can be created to add new potentials to LAMMPS. Bond_harmonic.cpp is the simplest example of a bond style. Ditto for the harmonic forms of the angle, dihedral, and improper style commands. 211 LAMMPS Users Manual Here is a brief description of common methods you define in your new derived class. See bond.h, angle.h, dihedral.h, and improper.h for details and specific additional methods. init init_style compute settings coeff equilibrium_distance equilibrium_angle write & read_restart single memory_usage check if all coefficients are set, calls init_style (optional) check if style specific conditions are met (optional) compute the molecular interactions (required) apply global settings for all types (optional) set coefficients for one type (required) length of bond, used by SHAKE (required, bond only) opening of angle, used by SHAKE (required, angle only) writes/reads coeffs to restart files (required) force and energy of a single bond or angle (required, bond or angle only) tally memory allocated by the style (optional) 10.3 Compute styles Classes that compute scalar and vector quantities like temperature and the pressure tensor, as well as classes that compute per-atom quantities like kinetic energy and the centro-symmetry parameter are derived from the Compute class. New styles can be created to add new calculations to LAMMPS. Compute_temp.cpp is a simple example of computing a scalar temperature. Compute_ke_atom.cpp is a simple example of computing per-atom kinetic energy. Here is a brief description of methods you define in your new derived class. See compute.h for details. init init_list compute_scalar compute_vector compute_peratom compute_local pack_comm unpack_comm pack_reverse unpack_reverse remove_bias remove_bias_all restore_bias restore_bias_all pair_tally_callback perform one time setup (required) neighbor list setup, if needed (optional) compute a scalar quantity (optional) compute a vector of quantities (optional) compute one or more quantities per atom (optional) compute one or more quantities per processor (optional) pack a buffer with items to communicate (optional) unpack the buffer (optional) pack a buffer with items to reverse communicate (optional) unpack the buffer (optional) remove velocity bias from one atom (optional) remove velocity bias from all atoms in group (optional) restore velocity bias for one atom after remove_bias (optional) same as before, but for all atoms in group (optional) callback function for tally-style computes (optional). 212 LAMMPS Users Manual memory_usage tally memory usage (optional) Tally-style computes are a special case, as their computation is done in two stages: the callback function is registered with the pair style and then called from the Pair::ev_tally() function, which is called for each pair after force and energy has been computed for this pair. Then the tallied values are retrieved with the standard compute_scalar or compute_vector or compute_peratom methods. The USER-TALLY package provides examples_compute_tally.html for utilizing this mechanism. 10.4 Dump styles 10.5 Dump custom output options Classes that dump per-atom info to files are derived from the Dump class. To dump new quantities or in a new format, a new derived dump class can be added, but it is typically simpler to modify the DumpCustom class contained in the dump_custom.cpp file. Dump_atom.cpp is a simple example of a derived dump class. Here is a brief description of methods you define in your new derived class. See dump.h for details. write_header write the header section of a snapshot of atoms count count the number of lines a processor will output pack pack a proc's output data into a buffer write_data write a proc's data to a file See the dump command and its custom style for a list of keywords for atom information that can already be dumped by DumpCustom. It includes options to dump per-atom info from Compute classes, so adding a new derived Compute class is one way to calculate new quantities to dump. Alternatively, you can add new keywords to the dump custom command. Search for the word "customize" in dump_custom.cpp to see the half-dozen or so locations where code will need to be added. 10.6 Fix styles In LAMMPS, a "fix" is any operation that is computed during timestepping that alters some property of the system. Essentially everything that happens during a simulation besides force computation, neighbor list construction, and output, is a "fix". This includes time integration (update of coordinates and velocities), force constraints or boundary conditions (SHAKE or walls), and diagnostics (compute a diffusion coefficient). New styles can be created to add new options to LAMMPS. Fix_setforce.cpp is a simple example of setting forces on atoms to prescribed values. There are dozens of fix options already in LAMMPS; choose one as a template that is 213 LAMMPS Users Manual similar to what you want to implement. Here is a brief description of methods you can define in your new derived class. See fix.h for details. determines when the fix is called during the timestep (required) init initialization before a run (optional) setup_pre_exchange called before atom exchange in setup (optional) setup_pre_force called before force computation in setup (optional) called immediately before the 1st timestep and after forces setup are computed (optional) like setup_pre_force, but for minimizations instead of MD runs min_setup_pre_force (optional) min_setup like setup, but for minimizations instead of MD runs (optional) initial_integrate called at very beginning of each timestep (optional) called before atom exchange on re-neighboring steps pre_exchange (optional) pre_neighbor called before neighbor list build (optional) pre_force called before pair & molecular forces are computed (optional) called after pair & molecular forces are computed and post_force communicated (optional) final_integrate called at end of each timestep (optional) end_of_step called at very end of timestep (optional) write_restart dumps fix info to restart file (optional) restart uses info from restart file to re-initialize the fix (optional) grow_arrays allocate memory for atom-based arrays used by fix (optional) copy atom info when an atom migrates to a new processor copy_arrays (optional) pack_exchange store atom's data in a buffer (optional) unpack_exchange retrieve atom's data from a buffer (optional) pack_restart store atom's data for writing to restart file (optional) unpack_restart retrieve atom's data from a restart file buffer (optional) size_restart size of atom's data (optional) maxsize_restart max size of atom's data (optional) setup_pre_force_respa same as setup_pre_force, but for rRESPA (optional) initial_integrate_respa same as initial_integrate, but for rRESPA (optional) called after the first half integration step is done in rRESPA post_integrate_respa (optional) pre_force_respa same as pre_force, but for rRESPA (optional) post_force_respa same as post_force, but for rRESPA (optional) final_integrate_respa same as final_integrate, but for rRESPA (optional) called after pair & molecular forces are computed in min_pre_force minimizer (optional) setmask 214 LAMMPS Users Manual called after pair & molecular forces are computed and communicated in minimizer (optional) store extra data for linesearch based minimization on a LIFO min_store stack (optional) min_pushstore push the minimization LIFO stack one element down (optional) min_popstore pop the minimization LIFO stack one element up (optional) min_clearstore clear minimization LIFO stack (optional) min_step reset or move forward on line search minimization (optional) report number of degrees of freedom added by this fix in min_dof minimization (optional) report maximum allowed step size during linesearch max_alpha minimization (optional) pack_comm pack a buffer to communicate a per-atom quantity (optional) unpack_comm unpack a buffer to communicate a per-atom quantity (optional) pack a buffer to reverse communicate a per-atom quantity pack_reverse_comm (optional) unpack a buffer to reverse communicate a per-atom quantity unpack_reverse_comm (optional) report number of degrees of freedom removed by this fix dof during MD (optional) compute_scalar return a global scalar property that the fix computes (optional) return a component of a vector property that the fix computes compute_vector (optional) return a component of an array property that the fix computes compute_array (optional) deform called when the box size is changed (optional) called when a change of the target temperature is requested reset_target during a run (optional) is called when a change of the time step is requested during a reset_dt run (optional) modify_param called when a fix_modify request is executed (optional) memory_usage report memory used by fix (optional) thermo compute quantities for thermodynamic output (optional) Typically, only a small fraction of these methods are defined for a particular fix. Setmask is mandatory, as it determines when the fix will be invoked during the timestep. Fixes that perform time integration (nve, nvt, npt) implement initial_integrate() and final_integrate() to perform velocity Verlet updates. Fixes that constrain forces implement post_force(). min_post_force Fixes that perform diagnostics typically implement end_of_step(). For an end_of_step fix, one of your fix arguments must be the variable "nevery" which is used to determine when to call the fix and you must set this variable in the constructor of your fix. By convention, this is the first argument the fix defines (after the ID, group-ID, style). 215 LAMMPS Users Manual If the fix needs to store information for each atom that persists from timestep to timestep, it can manage that memory and migrate the info with the atoms as they move from processors to processor by implementing the grow_arrays, copy_arrays, pack_exchange, and unpack_exchange methods. Similarly, the pack_restart and unpack_restart methods can be implemented to store information about the fix in restart files. If you wish an integrator or force constraint fix to work with rRESPA (see the run_style command), the initial_integrate, post_force_integrate, and final_integrate_respa methods can be implemented. The thermo method enables a fix to contribute values to thermodynamic output, as printed quantities and/or to be summed to the potential energy of the system. 10.7 Input script commands New commands can be added to LAMMPS input scripts by adding new classes that have a "command" method. For example, the create_atoms, read_data, velocity, and run commands are all implemented in this fashion. When such a command is encountered in the LAMMPS input script, LAMMPS simply creates a class with the corresponding name, invokes the "command" method of the class, and passes it the arguments from the input script. The command method can perform whatever operations it wishes on LAMMPS data structures. The single method your new class must define is as follows: command operations performed by the new command Of course, the new class can define other methods and variables as needed. 10.8 Kspace computations Classes that compute long-range Coulombic interactions via K-space representations (Ewald, PPPM) are derived from the KSpace class. New styles can be created to add new K-space options to LAMMPS. Ewald.cpp is an example of computing K-space interactions. Here is a brief description of methods you define in your new derived class. See kspace.h for details. init setup compute memory_usage initialize the calculation before a run computation before the 1st timestep of a run every-timestep computation tally of memory usage 10.9 Minimization styles Classes that perform energy minimization derived from the Min class. New styles can be created to add new minimization algorithms to LAMMPS. 216 LAMMPS Users Manual Min_cg.cpp is an example of conjugate gradient minimization. Here is a brief description of methods you define in your new derived class. See min.h for details. init initialize the minimization before a run run perform the minimization memory_usage tally of memory usage 10.10 Pairwise potentials Classes that compute pairwise interactions are derived from the Pair class. In LAMMPS, pairwise calculation include manybody potentials such as EAM or Tersoff where particles interact without a static bond topology. New styles can be created to add new pair potentials to LAMMPS. Pair_lj_cut.cpp is a simple example of a Pair class, though it includes some optional methods to enable its use with rRESPA. Here is a brief description of the class methods in pair.h: compute settings coeff init_one init_style write & read_restart write & read_restart_settings workhorse routine that computes pairwise interactions reads the input script line with arguments you define set coefficients for one i,j type pair perform initialization for one i,j type pair initialization specific to this pair style write/read i,j pair coeffs to restart files write/read global settings to restart files force and energy of a single pairwise interaction single between 2 atoms compute_inner/middle/outer versions of compute used by rRESPA The inner/middle/outer routines are optional. 10.11 Region styles Classes that define geometric regions are derived from the Region class. Regions are used elsewhere in LAMMPS to group atoms, delete atoms to create a void, insert atoms in a specified region, etc. New styles can be created to add new region shapes to LAMMPS. Region_sphere.cpp is an example of a spherical region. Here is a brief description of methods you define in your new derived class. See region.h for details. inside determine whether a point is in the region 217 LAMMPS Users Manual surface_interior determine if a point is within a cutoff distance inside of surc surface_exterior determine if a point is within a cutoff distance outside of surf shape_update change region shape if set by time-dependent variable 10.12 Body styles Classes that define body particles are derived from the Body class. Body particles can represent complex entities, such as surface meshes of discrete points, collections of sub-particles, deformable objects, etc. See Section 6.14 of the manual for an overview of using body particles and the body doc page for details on the various body styles LAMMPS supports. New styles can be created to add new kinds of body particles to LAMMPS. Body_nparticle.cpp is an example of a body particle that is treated as a rigid body containing N sub-particles. Here is a brief description of methods you define in your new derived class. See body.h for details. data_body noutrow noutcol output pack_comm_body unpack_comm_body pack_border_body unpack_border_body process a line from the Bodies section of a data file number of sub-particles output is generated for number of values per-sub-particle output is generated for output values for the Mth sub-particle body attributes to communicate every timestep unpacking of those attributes body attributes to communicate when reneighboring is done unpacking of those attributes 10.13 Thermodynamic output options There is one class that computes and prints thermodynamic information to the screen and log file; see the file thermo.cpp. There are two styles defined in thermo.cpp: "one" and "multi". There is also a flexible "custom" style which allows the user to explicitly list keywords for quantities to print when thermodynamic info is output. See the thermo_style command for a list of defined quantities. The thermo styles (one, multi, etc) are simply lists of keywords. Adding a new style thus only requires defining a new list of keywords. Search for the word "customize" with references to "thermo style" in thermo.cpp to see the two locations where code will need to be added. New keywords can also be added to thermo.cpp to compute new quantities for output. Search for the word "customize" with references to "keyword" in thermo.cpp to see 218 LAMMPS Users Manual the several locations where code will need to be added. Note that the thermo_style custom command already allows for thermo output of quantities calculated by fixes, computes, and variables. Thus, it may be simpler to compute what you wish via one of those constructs, than by adding a new keyword to the thermo command. 10.14 Variable options There is one class that computes and stores variable information in LAMMPS; see the file variable.cpp. The value associated with a variable can be periodically printed to the screen via the print, fix print, or thermo_style custom commands. Variables of style "equal" can compute complex equations that involve the following types of arguments: thermo keywords = ke, vol, atoms, ... other variables = v_a, v_myvar, ... math functions = div(x,y), mult(x,y), add(x,y), ... group functions = mass(group), xcm(group,x), ... atom values = x[123], y[3], vx[34], ... compute values = c_mytemp[0], c_thermo_press[3], ... Adding keywords for the thermo_style custom command (which can then be accessed by variables) was discussed here on this page. Adding a new math function of one or two arguments can be done by editing one section of the Variable::evaluate() method. Search for the word "customize" to find the appropriate location. Adding a new group function can be done by editing one section of the Variable::evaluate() method. Search for the word "customize" to find the appropriate location. You may need to add a new method to the Group class as well (see the group.cpp file). Accessing a new atom-based vector can be done by editing one section of the Variable::evaluate() method. Search for the word "customize" to find the appropriate location. Adding new compute styles (whose calculated values can then be accessed by variables) was discussed here on this page. 10.15 Submitting new features for inclusion in LAMMPS We encourage users to submit new features or modifications for LAMMPS to the core developers so they can be added to the LAMMPS distribution. The preferred way to manage and coordinate this is as of Fall 2016 via the LAMMPS project on GitHub. An alternative is to contact the LAMMPS developers or the indicated developer of a package or feature directly and send in your contribution via e-mail. 219 LAMMPS Users Manual For any larger modifications or programming project, you are encouraged to contact the LAMMPS developers ahead of time, in order to discuss implementation strategies and coding guidelines, that will make it easier to integrate your contribution and result in less work for everybody involved. You are also encouraged to search through the list of open issues on GitHub and submit a new issue for a planned feature, so you would not duplicate the work of others (and possibly get scooped by them) or have your work duplicated by others. How quickly your contribution will be integrated depends largely on how much effort it will cause to integrate and test it, how much it requires changes to the core codebase, and of how much interest it is to the larger LAMMPS community. Please see below for a checklist of typical requirements. Once you have prepared everything, see this tutorial for instructions on how to submit your changes or new files through a GitHub pull request. If you prefer to submit patches or full files, you should first make certain, that your code works correctly with the latest patch-level version of LAMMPS and contains all bugfixes from it. Then create a gzipped tar file of all changed or added files or a corresponding patch file using 'diff -u' or 'diff -c' and compress it with gzip. Please only use gzip compression, as this works well on all platforms. If the new features/files are broadly useful we may add them as core files to LAMMPS or as part of a standard package. Else we will add them as a user-contributed file or package. Examples of user packages are in src sub-directories that start with USER. The USER-MISC package is simply a collection of (mostly) unrelated single files, which is the simplest way to have your contribution quickly added to the LAMMPS distribution. You can see a list of the both standard and user packages by typing "make package" in the LAMMPS src directory. Note that by providing us files to release, you are agreeing to make them open-source, i.e. we can release them under the terms of the GPL, used as a license for the rest of LAMMPS. See Section 1.4 for details. With user packages and files, all we are really providing (aside from the fame and fortune that accompanies having your name in the source code and on the Authors page of the LAMMPS WWW site), is a means for you to distribute your work to the LAMMPS user community, and a mechanism for others to easily try out your new feature. This may help you find bugs or make contact with new collaborators. Note that you're also implicitly agreeing to support your code which means answer questions, fix bugs, and maintain it if LAMMPS changes in some way that breaks it (an unusual event). NOTE: If you prefer to actively develop and support your add-on feature yourself, then you may wish to make it available for download from your own website, as a user package that LAMMPS users can add to their copy of LAMMPS. See the Offsite LAMMPS packages and tools page of the LAMMPS web site for examples of groups that do this. We are happy to advertise your package and web site from that page. Simply email the developers with info about your package and we will post it there. The previous sections of this doc page describe how to add new "style" files of various kinds to LAMMPS. Packages are simply collections of one or more new class files which are invoked as a new style within a LAMMPS input script. If designed correctly, these additions typically do not require changes to the main core of LAMMPS; they 220 LAMMPS Users Manual are simply add-on files. If you think your new feature requires non-trivial changes in core LAMMPS files, you'll need to communicate with the developers, since we may or may not want to make those changes. An example of a trivial change is making a parent-class method "virtual" when you derive a new child class from it. Here is a checklist of steps you need to follow to submit a single file or user package for our consideration. Following these steps will save both you and us time. See existing files in packages in the src dir for examples. If you are uncertain, please ask. • All source files you provide must compile with the most current version of LAMMPS with multiple configurations. In particular you need to test compiling LAMMPS from scratch with -DLAMMPS_BIGBIG set in addition to the default -DLAMMPS_SMALLBIG setting. Your code will need to work correctly in serial and in parallel using MPI. • For consistency with the rest of LAMMPS and especially, if you want your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per level, no tabs, no lines over 80 characters. I/O is done via the C-style stdio library, class header files should not import any system headers outside , STL containers should be avoided in headers, and forward declarations used where possible or needed. All added code should be placed into the LAMMPS_NS namespace or a sub-namespace; global or static variables should be avoided, as they conflict with the modular nature of LAMMPS and the C++ class structure. Header files must not import namespaces with using. This all is so the developers can more easily understand, integrate, and maintain your contribution and reduce conflicts with other parts of LAMMPS. This basically means that the code accesses data structures, performs its operations, and is formatted similar to other LAMMPS source files, including the use of the error class for error and warning messages. • If you want your contribution to be added as a user-contributed feature, and it's a single file (actually a *.cpp and *.h file) it can rapidly be added to the USER-MISC directory. Send us the one-line entry to add to the USER-MISC/README file in that dir, along with the 2 source files. You can do this multiple times if you wish to contribute several individual features. • If you want your contribution to be added as a user-contribution and it is several related features, it is probably best to make it a user package directory with a name like USER-FOO. In addition to your new files, the directory should contain a README text file. The README should contain your name and contact information and a brief description of what your new package does. If your files depend on other LAMMPS style files also being installed (e.g. because your file is a derived class from the other LAMMPS class), then an Install.sh file is also needed to check for those dependencies. See other README and Install.sh files in other USER directories as examples. Send us a tarball of this USER-FOO directory. • Your new source files need to have the LAMMPS copyright, GPL notice, and your name and email address at the top, like other user-contributed LAMMPS source files. They need to create a class that is inside the LAMMPS namespace. If the file is for one of the USER packages, including USER-MISC, then we are not as picky about the coding style (see above). I.e. the files do not need to be in the same stylistic format and syntax as other LAMMPS files, though that would 221 LAMMPS Users Manual be nice for developers as well as users who try to read your code. • You must also create a documentation file for each new command or style you are adding to LAMMPS. For simplicity and convenience, the documentation of groups of closely related commands or styles may be combined into a single file. This will be one file for a single-file feature. For a package, it might be several files. These are simple text files with a specific markup language, that are then auto-converted to HTML and PDF. The tools for this conversion are included in the source distribution, and the translation can be as simple as doing "make html pdf" in the doc folder. Thus the documentation source files must be in the same format and style as other *.txt files in the lammps/doc/src directory for similar commands and styles; use one or more of them as a starting point. A description of the markup can also be found in lammps/doc/utils/txt2html/README.html As appropriate, the text files can include links to equations (see doc/Eqs/*.tex for examples, we auto-create the associated JPG files), or figures (see doc/JPG for examples), or even additional PDF files with further details (see doc/PDF for examples). The doc page should also include literature citations as appropriate; see the bottom of doc/fix_nh.txt for examples and the earlier part of the same file for how to format the cite itself. The "Restrictions" section of the doc page should indicate that your command is only available if LAMMPS is built with the appropriate USER-MISC or USER-FOO package. See other user package doc files for examples of how to do this. The prerequisite for building the HTML format files are Python 3.x and virtualenv, the requirement for generating the PDF format manual is the htmldoc software. Please run at least "make html" and carefully inspect and proofread the resulting HTML format doc page before submitting your code. • For a new package (or even a single command) you should include one or more example scripts demonstrating its use. These should run in no more than a couple minutes, even on a single processor, and not require large data files as input. See directories under examples/USER for examples of input scripts other users provided for their packages. These example inputs are also required for validating memory accesses and testing for memory leaks with valgrind • If there is a paper of yours describing your feature (either the algorithm/science behind the feature itself, or its initial usage, or its implementation in LAMMPS), you can add the citation to the *.cpp source file. See src/USER-EFF/atom_vec_electron.cpp for an example. A LaTeX citation is stored in a variable at the top of the file and a single line of code that references the variable is added to the constructor of the class. Whenever a user invokes your feature from their input script, this will cause LAMMPS to output the citation to a log.cite file and prompt the user to examine the file. Note that you should only use this for a paper you or your group authored. E.g. adding a cite in the code for a paper by Nose and Hoover if you write a fix that implements their integrator is not the intended usage. That kind of citation should just be in the doc page you provide. Finally, as a general rule-of-thumb, the more clear and self-explanatory you make your documentation and README files, and the easier you make it for people to get started, e.g. by providing example scripts, the more likely it is that users will try out your new feature. 222 LAMMPS Users Manual (Foo) Foo, Morefoo, and Maxfoo, J of Classic Potentials, 75, 345 (1997). 223 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 11. Python interface to LAMMPS LAMMPS can work together with Python in three ways. First, Python can wrap LAMMPS through the LAMMPS library interface, so that a Python script can create one or more instances of LAMMPS and launch one or more simulations. In Python lingo, this is "extending" Python with LAMMPS. Second, the low-level Python interface can be used indirectly through the PyLammps and IPyLammps wrapper classes in Python. These wrappers try to simplify the usage of LAMMPS in Python by providing an object-based interface to common LAMMPS functionality. It also reduces the amount of code necessary to parameterize LAMMPS scripts through Python and makes variables and computes directly accessible. See PyLammps interface for more details. Third, LAMMPS can use the Python interpreter, so that a LAMMPS input script can invoke Python code, and pass information back-and-forth between the input script and Python functions you write. The Python code can also callback to LAMMPS to query or change its attributes. In Python lingo, this is "embedding" Python in LAMMPS. This section describes how to use these three approaches. • 11.1 • 11.2 • 11.3 • 11.4 • 11.5 • 11.6 • 11.7 • 11.8 • 11.9 Overview of running LAMMPS from Python Overview of using Python from a LAMMPS script Building LAMMPS as a shared library Installing the Python wrapper into Python Extending Python with MPI to run in parallel Testing the Python-LAMMPS interface Using LAMMPS from Python Example Python scripts that use LAMMPS PyLammps interface If you are not familiar with it, Python is a powerful scripting and programming language which can essentially do anything that faster, lower-level languages like C or C++ can do, but typically with much fewer lines of code. When used in embedded mode, Python can perform operations that the simplistic LAMMPS input script syntax cannot. Python can be also be used as a "glue" language to drive a program through its library interface, or to hook multiple pieces of software together, such as a simulation package plus a visualization package, or to run a coupled multiscale or multiphysics model. See Section 6.10 of the manual and the couple directory of the distribution for more ideas about coupling LAMMPS to other codes. See Section 6.19 for a description of the LAMMPS library interface provided in src/library.cpp and src/library.h, and how to extend it for your needs. As described below, that interface is what is exposed to Python either when calling LAMMPS from Python or when calling Python from a LAMMPS input script and then calling back to LAMMPS from Python code. The library interface is designed to be easy to add functions to. Thus the Python interface to 224 LAMMPS Users Manual LAMMPS is also easy to extend as well. If you create interesting Python scripts that run LAMMPS or interesting Python functions that can be called from a LAMMPS input script, that you think would be useful to other users, please email them to the developers. We can include them in the LAMMPS distribution. 11.1 Overview of running LAMMPS from Python The LAMMPS distribution includes a python directory with all you need to run LAMMPS from Python. The python/lammps.py file wraps the LAMMPS library interface, with one wrapper function per LAMMPS library function. This file makes it is possible to do the following either from a Python script, or interactively from a Python prompt: create one or more instances of LAMMPS, invoke LAMMPS commands or give it an input script, run LAMMPS incrementally, extract LAMMPS results, an modify internal LAMMPS variables. From a Python script you can do this in serial or parallel. Running Python interactively in parallel does not generally work, unless you have a version of Python that extends standard Python to enable multiple instances of Python to read what you type. To do all of this, you must first build LAMMPS as a shared library, then insure that your Python can find the python/lammps.py file and the shared library. These steps are explained in subsequent sections 11.3 and 11.4. Sections 11.5 and 11.6 discuss using MPI from a parallel Python program and how to test that you are ready to use LAMMPS from Python. Section 11.7 lists all the functions in the current LAMMPS library interface and how to call them from Python. Section 11.8 gives some examples of coupling LAMMPS to other tools via Python. For example, LAMMPS can easily be coupled to a GUI or other visualization tools that display graphs or animations in real time as LAMMPS runs. Examples of such scripts are included in the python directory. Two advantages of using Python to run LAMMPS are how concise the language is, and that it can be run interactively, enabling rapid development and debugging of programs. If you use it to mostly invoke costly operations within LAMMPS, such as running a simulation for a reasonable number of timesteps, then the overhead cost of invoking LAMMPS thru Python will be negligible. The Python wrapper for LAMMPS uses the amazing and magical (to me) "ctypes" package in Python, which auto-generates the interface code needed between Python and a set of C interface routines for a library. Ctypes is part of standard Python for versions 2.5 and later. You can check which version of Python you have installed, by simply typing "python" at a shell prompt. 225 LAMMPS Users Manual 11.2 Overview of using Python from a LAMMPS script LAMMPS has several commands which can be used to invoke Python code directly from an input script: • python • variable python • fix python/invoke • pair_style python The python command which can be used to define and execute a Python function that you write the code for. The Python function can also be assigned to a LAMMPS python-style variable via the variable command. Each time the variable is evaluated, either in the LAMMPS input script itself, or by another LAMMPS command that uses the variable, this will trigger the Python function to be invoked. The Python code for the function can be included directly in the input script or in an auxiliary file. The function can have arguments which are mapped to LAMMPS variables (also defined in the input script) and it can return a value to a LAMMPS variable. This is thus a mechanism for your input script to pass information to a piece of Python code, ask Python to execute the code, and return information to your input script. Note that a Python function can be arbitrarily complex. It can import other Python modules, instantiate Python classes, call other Python functions, etc. The Python code that you provide can contain more code than the single function. It can contain other functions or Python classes, as well as global variables or other mechanisms for storing state between calls from LAMMPS to the function. The Python function you provide can consist of "pure" Python code that only performs operations provided by standard Python. However, the Python function can also "call back" to LAMMPS through its Python-wrapped library interface, in the manner described in the previous section 11.1. This means it can issue LAMMPS input script commands or query and set internal LAMMPS state. As an example, this can be useful in an input script to create a more complex loop with branching logic, than can be created using the simple looping and branching logic enabled by the next and if commands. See the python doc page and the variable doc page for its python-style variables for more info, including examples of Python code you can write for both pure Python operations and callbacks to LAMMPS. The fix python/invoke command can execute Python code at selected timesteps during a simulation run. The pair_style python command allows you to define pairwise potentials as python code which encodes a single pairwise interaction. This is useful for rapid-developement and debugging of a new potential. To use any of these commands, you only need to build LAMMPS with the PYTHON package installed: 226 LAMMPS Users Manual make yes-python make machine Note that this will link LAMMPS with the Python library on your system, which typically requires several auxiliary system libraries to also be linked. The list of these libraries and the paths to find them are specified in the lib/python/Makefile.lammps file. You need to insure that file contains the correct information for your version of Python and your machine to successfully build LAMMPS. See the lib/python/README file for more info. If you want to write Python code with callbacks to LAMMPS, then you must also follow the steps overviewed in the preceding section (11.1) for running LAMMPS from Python. I.e. you must build LAMMPS as a shared library and insure that Python can find the python/lammps.py file and the shared library. 11.3 Building LAMMPS as a shared library Instructions on how to build LAMMPS as a shared library are given in Section 2.4. A shared library is one that is dynamically loadable, which is what Python requires to wrap LAMMPS. On Linux this is a library file that ends in ".so", not ".a". From the src directory, type make foo mode=shlib where foo is the machine target name, such as linux or g++ or serial. This should create the file liblammps_foo.so in the src directory, as well as a soft link liblammps.so, which is what the Python wrapper will load by default. Note that if you are building multiple machine versions of the shared library, the soft link is always set to the most recently built version. NOTE: If you are building LAMMPS with an MPI or FFT library or other auxiliary libraries (used by various packages), then all of these extra libraries must also be shared libraries. If the LAMMPS shared-library build fails with an error complaining about this, see Section 2.4 for more details. 11.4 Installing the Python wrapper into Python For Python to invoke LAMMPS, there are 2 files it needs to know about: • python/lammps.py • src/liblammps.so Lammps.py is the Python wrapper on the LAMMPS library interface. Liblammps.so is the shared LAMMPS library that Python loads, as described above. You can insure Python can find these files in one of two ways: • set two environment variables 227 LAMMPS Users Manual • run the python/install.py script If you set the paths to these files as environment variables, you only have to do it once. For the csh or tcsh shells, add something like this to your ~/.cshrc file, one line for each of the two files: setenv PYTHONPATH{PYTHONPATH}:/home/sjplimp/lammps/python
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/sjplimp/lammps/src If you use the python/install.py script, you need to invoke it every time you rebuild LAMMPS (as a shared library) or make changes to the python/lammps.py file. You can invoke install.py from the python directory as % python install.py [libdir] [pydir] The optional libdir is where to copy the LAMMPS shared library to; the default is /usr/local/lib. The optional pydir is where to copy the lammps.py file to; the default is the site-packages directory of the version of Python that is running the install script. Note that libdir must be a location that is in your default LD_LIBRARY_PATH, like /usr/local/lib or /usr/lib. And pydir must be a location that Python looks in by default for imported modules, like its site-packages dir. If you want to copy these files to non-standard locations, such as within your own user space, you will need to set your PYTHONPATH and LD_LIBRARY_PATH environment variables accordingly, as above. If the install.py script does not allow you to copy files into system directories, prefix the python command with "sudo". If you do this, make sure that the Python that root runs is the same as the Python you run. E.g. you may need to do something like % sudo /usr/local/bin/python install.py [libdir] [pydir] You can also invoke install.py from the make command in the src directory as % make install-python In this mode you cannot append optional arguments. Again, you may need to prefix this with "sudo". In this mode you cannot control which Python is invoked by root. Note that if you want Python to be able to load different versions of the LAMMPS shared library (see this section below), you will need to manually copy files like liblammps_g++.so into the appropriate system directory. This is not needed if you set the LD_LIBRARY_PATH environment variable as described above. 11.5 Extending Python with MPI to run in parallel If you wish to run LAMMPS in parallel from Python, you need to extend your Python with an interface to MPI. This also allows you to make MPI calls directly from Python in your script, if you desire. 228 LAMMPS Users Manual There are several Python packages available that purport to wrap MPI as a library and allow MPI functions to be called from Python. However, development on most of them seems to be halted except on: • mpi4py • PyPar Both packages, PyPar and mpi4py have been successfully tested with LAMMPS. PyPar is simpler and easy to set up and use, but supports only a subset of MPI. Mpi4py is more MPI-feature complete, but also a bit more complex to use. As of version 2.0.0, mpi4py is the only python MPI wrapper that allows passing a custom MPI communicator to the LAMMPS constructor, which means one can easily run one or more LAMMPS instances on subsets of the total MPI ranks. PyPar requires the ubiquitous Numpy package be installed in your Python. After launching Python, type import numpy to see if it is installed. If not, here is how to install it (version 1.3.0b1 as of April 2009). Unpack the numpy tarball and from its top-level directory, type python setup.py build sudo python setup.py install The "sudo" is only needed if required to copy Numpy files into your Python distribution's site-packages directory. To install PyPar (version pypar-2.1.4_94 as of Aug 2012), unpack it and from its "source" directory, type python setup.py build sudo python setup.py install Again, the "sudo" is only needed if required to copy PyPar files into your Python distribution's site-packages directory. If you have successfully installed PyPar, you should be able to run Python and type import pypar without error. You should also be able to run python in parallel on a simple test script % mpirun -np 4 python test.py where test.py contains the lines import pypar print "Proc %d out of %d procs" % (pypar.rank(),pypar.size()) and see one line of output for each processor you run on. 229 LAMMPS Users Manual NOTE: To use PyPar and LAMMPS in parallel from Python, you must insure both are using the same version of MPI. If you only have one MPI installed on your system, this is not an issue, but it can be if you have multiple MPIs. Your LAMMPS build is explicit about which MPI it is using, since you specify the details in your lo-level src/MAKE/Makefile.foo file. PyPar uses the "mpicc" command to find information about the MPI it uses to build against. And it tries to load "libmpi.so" from the LD_LIBRARY_PATH. This may or may not find the MPI library that LAMMPS is using. If you have problems running both PyPar and LAMMPS together, this is an issue you may need to address, e.g. by moving other MPI installations so that PyPar finds the right one. To install mpi4py (version mpi4py-2.0.0 as of Oct 2015), unpack it and from its main directory, type python setup.py build sudo python setup.py install Again, the "sudo" is only needed if required to copy mpi4py files into your Python distribution's site-packages directory. To install with user privilege into the user local directory type python setup.py install --user If you have successfully installed mpi4py, you should be able to run Python and type from mpi4py import MPI without error. You should also be able to run python in parallel on a simple test script % mpirun -np 4 python test.py where test.py contains the lines from mpi4py import MPI comm = MPI.COMM_WORLD print "Proc %d out of %d procs" % (comm.Get_rank(),comm.Get_size()) and see one line of output for each processor you run on. NOTE: To use mpi4py and LAMMPS in parallel from Python, you must insure both are using the same version of MPI. If you only have one MPI installed on your system, this is not an issue, but it can be if you have multiple MPIs. Your LAMMPS build is explicit about which MPI it is using, since you specify the details in your lo-level src/MAKE/Makefile.foo file. Mpi4py uses the "mpicc" command to find information about the MPI it uses to build against. And it tries to load "libmpi.so" from the LD_LIBRARY_PATH. This may or may not find the MPI library that LAMMPS is using. If you have problems running both mpi4py and LAMMPS together, this is an issue you may need to address, e.g. by moving other MPI installations so that mpi4py finds the right one. 230 LAMMPS Users Manual 11.6 Testing the Python-LAMMPS interface To test if LAMMPS is callable from Python, launch Python interactively and type: >>> from lammps import lammps >>> lmp = lammps() If you get no errors, you're ready to use LAMMPS from Python. If the 2nd command fails, the most common error to see is OSError: Could not load LAMMPS dynamic library which means Python was unable to load the LAMMPS shared library. This typically occurs if the system can't find the LAMMPS shared library or one of the auxiliary shared libraries it depends on, or if something about the library is incompatible with your Python. The error message should give you an indication of what went wrong. You can also test the load directly in Python as follows, without first importing from the lammps.py file: >>> from ctypes import CDLL >>> CDLL("liblammps.so") If an error occurs, carefully go thru the steps in Section 2.4 and above about building a shared library and about insuring Python can find the necessary two files it needs. Test LAMMPS and Python in serial: To run a LAMMPS test in serial, type these lines into Python interactively from the bench directory: >>> from lammps import lammps >>> lmp = lammps() >>> lmp.file("in.lj") Or put the same lines in the file test.py and run it as % python test.py Either way, you should see the results of running the in.lj benchmark on a single processor appear on the screen, the same as if you had typed something like: lmp_g++ -in in.lj Test LAMMPS and Python in parallel: To run LAMMPS in parallel, assuming you have installed the PyPar package as discussed above, create a test.py file containing these lines: import pypar from lammps import lammps lmp = lammps() lmp.file("in.lj") print "Proc %d out of %d procs has" % (pypar.rank(),pypar.size()),lmp 231 LAMMPS Users Manual pypar.finalize() To run LAMMPS in parallel, assuming you have installed the mpi4py package as discussed above, create a test.py file containing these lines: from mpi4py import MPI from lammps import lammps lmp = lammps() lmp.file("in.lj") me = MPI.COMM_WORLD.Get_rank() nprocs = MPI.COMM_WORLD.Get_size() print "Proc %d out of %d procs has" % (me,nprocs),lmp MPI.Finalize() You can either script in parallel as: % mpirun -np 4 python test.py and you should see the same output as if you had typed % mpirun -np 4 lmp_g++ -in in.lj Note that if you leave out the 3 lines from test.py that specify PyPar commands you will instantiate and run LAMMPS independently on each of the P processors specified in the mpirun command. In this case you should get 4 sets of output, each showing that a LAMMPS run was made on a single processor, instead of one set of output showing that LAMMPS ran on 4 processors. If the 1-processor outputs occur, it means that PyPar is not working correctly. Also note that once you import the PyPar module, PyPar initializes MPI for you, and you can use MPI calls directly in your Python script, as described in the PyPar documentation. The last line of your Python script should be pypar.finalize(), to insure MPI is shut down correctly. Running Python scripts: Note that any Python script (not just for LAMMPS) can be invoked in one of several ways: % python foo.script % python -i foo.script % foo.script The last command requires that the first line of the script be something like this: #!/usr/local/bin/python #!/usr/local/bin/python -i where the path points to where you have Python installed, and that you have made the script file executable: % chmod +x foo.script 232 LAMMPS Users Manual Without the "-i" flag, Python will exit when the script finishes. With the "-i" flag, you will be left in the Python interpreter when the script finishes, so you can type subsequent commands. As mentioned above, you can only run Python interactively when running Python on a single processor, not in parallel. 11.7 Using LAMMPS from Python As described above, the Python interface to LAMMPS consists of a Python "lammps" module, the source code for which is in python/lammps.py, which creates a "lammps" object, with a set of methods that can be invoked on that object. The sample Python code below assumes you have first imported the "lammps" module in your Python script, as follows: from lammps import lammps These are the methods defined by the lammps module. If you look at the files src/library.cpp and src/library.h you will see that they correspond one-to-one with calls you can make to the LAMMPS library from a C++ or C or Fortran program, and which are described in Section 6.19 of the manual. lmp = lammps() lmp lmp lmp lmp # create a LAMMPS object using the default liblammps.so library # 4 optional args are allowed: name, cmdargs, ptr, comm = lammps(ptr=lmpptr) # use lmpptr as previously created LAMMPS object = lammps(comm=split) # create a LAMMPS object with a custom communicator, requires mpi4py 2 = lammps(name="g++") # create a LAMMPS object using the liblammps_g++.so library = lammps(name="g++",cmdargs=list) # add LAMMPS command-line args, e.g. list = ["-echo"," lmp.close() # destroy a LAMMPS object version = lmp.version() # return the numerical version id, e.g. LAMMPS 2 Sep 2015 -> 20150902 lmp.file(file) lmp.command(cmd) # run an entire input script, file = "in.lj" # invoke a single LAMMPS command, cmd = "run 100" lmp.commands_list(cmdlist) # invoke commands in cmdlist = "run 10", "run 20" lmp.commands_string(multicmd) # invoke commands in multicmd = "run 10\nrun 20" xlo = lmp.extract_global(name,type) # extract a global quantity # name = "boxxlo", "nlocal", etc # type = 0 = int # 1 = double coords = lmp.extract_atom(name,type) # extract a per-atom quantity # name = "x", "type", etc # type = 0 = vector of ints # 1 = array of ints # 2 = vector of doubles # 3 = array of doubles eng = lmp.extract_compute(id,style,type) v3 = lmp.extract_fix(id,style,type,i,j) # extract value(s) from a compute # extract value(s) from a fix 233 LAMMPS Users Manual # # # # # # # # var = lmp.extract_variable(name,group,flag) id = ID of compute or fix style = 0 = global data 1 = per-atom data 2 = local data type = 0 = scalar 1 = vector 2 = array i,j = indices of value in global vector or array # # # # # extract value(s) from a variable name = name of variable group = group ID (ignored for equal-style variab flag = 0 = equal-style variable 1 = atom-style variable flag = lmp.set_variable(name,value) # set existing named string-style variable to value, flag = 0 if successful value = lmp.get_thermo(name) # return current value of a thermo keyword natoms = lmp.get_natoms() data = lmp.gather_atoms(name,type,count) lmp.scatter_atoms(name,type,count,data) # # # # # # # total # of atoms as int return per-atom property of all atoms gathered into name = "x", "charge", "type", etc count = # of per-atom values, 1 or 3, etc scatter per-atom property to all atoms from data, o name = "x", "charge", "type", etc count = # of per-atom values, 1 or 3, etc The lines from lammps import lammps lmp = lammps() create an instance of LAMMPS, wrapped in a Python class by the lammps Python module, and return an instance of the Python class as lmp. It is used to make all subsequent calls to the LAMMPS library. Additional arguments to lammps() can be used to tell Python the name of the shared library to load or to pass arguments to the LAMMPS instance, the same as if LAMMPS were launched from a command-line prompt. If the ptr argument is set like this: lmp = lammps(ptr=lmpptr) then lmpptr must be an argument passed to Python via the LAMMPS python command, when it is used to define a Python function that is invoked by the LAMMPS input script. This mode of using Python with LAMMPS is described above in 11.2. The variable lmpptr refers to the instance of LAMMPS that called the embedded Python interpreter. Using it as an argument to lammps() allows the returned Python class instance "lmp" to make calls to that instance of LAMMPS. See the python command doc page for examples using this syntax. Note that you can create multiple LAMMPS objects in your Python script, and coordinate and run multiple simulations, e.g. 234 LAMMPS Users Manual from lammps import lammps lmp1 = lammps() lmp2 = lammps() lmp1.file("in.file1") lmp2.file("in.file2") The file(), command(), commands_list(), commands_string() methods allow an input script, a single command, or multiple commands to be invoked. The extract_global(), extract_atom(), extract_compute(), extract_fix(), and extract_variable() methods return values or pointers to data structures internal to LAMMPS. For extract_global() see the src/library.cpp file for the list of valid names. New names could easily be added. A double or integer is returned. You need to specify the appropriate data type via the type argument. For extract_atom(), a pointer to internal LAMMPS atom-based data is returned, which you can use via normal Python subscripting. See the extract() method in the src/atom.cpp file for a list of valid names. Again, new names could easily be added if the property you want is not listed. A pointer to a vector of doubles or integers, or a pointer to an array of doubles (double **) or integers (int **) is returned. You need to specify the appropriate data type via the type argument. For extract_compute() and extract_fix(), the global, per-atom, or local data calculated by the compute or fix can be accessed. What is returned depends on whether the compute or fix calculates a scalar or vector or array. For a scalar, a single double value is returned. If the compute or fix calculates a vector or array, a pointer to the internal LAMMPS data is returned, which you can use via normal Python subscripting. The one exception is that for a fix that calculates a global vector or array, a single double value from the vector or array is returned, indexed by I (vector) or I and J (array). I,J are zero-based indices. The I,J arguments can be left out if not needed. See Section 6.15 of the manual for a discussion of global, per-atom, and local data, and of scalar, vector, and array data types. See the doc pages for individual computes and fixes for a description of what they calculate and store. For extract_variable(), an equal-style or atom-style variable is evaluated and its result returned. For equal-style variables a single double value is returned and the group argument is ignored. For atom-style variables, a vector of doubles is returned, one value per atom, which you can use via normal Python subscripting. The values will be zero for atoms not in the specified group. The get_natoms() method returns the total number of atoms in the simulation, as an int. The gather_atoms() method allows any per-atom property (coordinates, velocities, etc) to be extracted from LAMMPS. It returns a ctypes vector of ints or doubles as specified by type, of length count*natoms, for the named property for all atoms in the simulation. The data is ordered by count and then by atom ID. See the extract() method in the src/atom.cpp file for a list of valid names. Again, new names could 235 LAMMPS Users Manual easily be added if the property you want is missing. The vector can be used via normal Python subscripting. If atom IDs are not consecutively ordered within LAMMPS, a None is returned as indication of an error. A special treatment is applied for image flags stored in the "image" property. All three image flags are stored in a packed format in a single integer, so count would be 1 to retrieve that integer, however also a count value of 3 can be used and then the image flags will be unpacked into 3 individual integers, ordered in a similar fashion as coordinates. Note that the data structure gather_atoms("x") returns is different from the data structure returned by extract_atom("x") in four ways. (1) Gather_atoms() returns a vector which you index as x[i]; extract_atom() returns an array which you index as x[i][j]. (2) Gather_atoms() orders the atoms by atom ID while extract_atom() does not. (3) Gathert_atoms() returns a list of all atoms in the simulation; extract_atoms() returns just the atoms local to each processor. (4) Finally, the gather_atoms() data structure is a copy of the atom coords stored internally in LAMMPS, whereas extract_atom() returns an array that effectively points directly to the internal data. This means you can change values inside LAMMPS from Python by assigning a new values to the extract_atom() array. To do this with the gather_atoms() vector, you need to change values in the vector, then invoke the scatter_atoms() method. The scatter_atoms() method allows any per-atom property (coordinates, velocities, etc) to be inserted into LAMMPS, overwriting the current property. It takes a vector of ints or doubles as specified by type, of length count*natoms, for the named property for all atoms in the simulation. The data should be ordered by count and then by atom ID. See the extract() method in the src/atom.cpp file for a list of valid names. Again, new names could easily be added if the property you want is missing. It uses the vector of data to overwrite the corresponding properties for each atom inside LAMMPS. This requires LAMMPS to have its "map" option enabled; see the atom_modify command for details. If it is not, or if atom IDs are not consecutively ordered, no coordinates are reset. Similar as for gather_atoms() a special treatment is applied for image flags, which can be provided in packed (count = 1) or unpacked (count = 3) format and in the latter case, they will be packed before applied to atoms. The array of coordinates passed to scatter_atoms() must be a ctypes vector of ints or doubles, allocated and initialized something like this: from ctypes import * natoms = lmp.get_natoms() n3 = 3*natoms x = (n3*c_double)() x[0] = x coord of atom with ID x[1] = y coord of atom with ID x[2] = z coord of atom with ID x[3] = x coord of atom with ID ... x[n3-1] = z coord of atom with lmp.scatter_atoms("x",1,3,x) 1 1 1 2 ID natoms Alternatively, you can just change values in the vector returned by gather_atoms("x",1,3), since it is a ctypes vector of doubles. As noted above, these Python class methods correspond one-to-one with the functions 236 LAMMPS Users Manual in the LAMMPS library interface in src/library.cpp and library.h. This means you can extend the Python wrapper via the following steps: • Add a new interface function to src/library.cpp and src/library.h. • Rebuild LAMMPS as a shared library. • Add a wrapper method to python/lammps.py for this interface function. • You should now be able to invoke the new interface function from a Python script. Isn't ctypes amazing? 11.8 Example Python scripts that use LAMMPS These are the Python scripts included as demos in the python/examples directory of the LAMMPS distribution, to illustrate the kinds of things that are possible when Python wraps LAMMPS. If you create your own scripts, send them to us and we can include them in the LAMMPS distribution. trivial.py demo.py simple.py similar to examples/COUPLE/simple/simple.cpp same as simple.py but running in parallel on a subset of procs GUI go/stop/temperature-slider to control LAMMPS real-time temperature plot with GnuPlot via Pizza.py real-time viz via some viz package combination of viz_tool.py and plot.py and gui.py read/run a LAMMPS input script thru Python invoke various LAMMPS library interface routines run in parallel split.py gui.py plot.py viz_tool.py vizplotgui_tool.py For the viz_tool.py and vizplotgui_tool.py commands, replace "tool" with "gl" or "atomeye" or "pymol" or "vmd", depending on what visualization package you have installed. Note that for GL, you need to be able to run the Pizza.py GL tool, which is included in the pizza sub-directory. See the Pizza.py doc pages for more info: Note that for AtomEye, you need version 3, and there is a line in the scripts that specifies the path and name of the executable. See the AtomEye WWW pages here or here for more details: http://mt.seas.upenn.edu/Archive/Graphics/A http://mt.seas.upenn.edu/Archive/Graphics/A3/A3.html The latter link is to AtomEye 3 which has the scriping capability needed by these Python scripts. 237 LAMMPS Users Manual Note that for PyMol, you need to have built and installed the open-source version of PyMol in your Python, so that you can import it from a Python script. See the PyMol WWW pages here or here for more details: http://www.pymol.org http://sourceforge.net/scm/?type=svn&group_id=4546 The latter link is to the open-source version. Note that for VMD, you need a fairly current version (1.8.7 works for me) and there are some lines in the pizza/vmd.py script for 4 PIZZA variables that have to match the VMD installation on your system. See the python/README file for instructions on how to run them and the source code for individual scripts for comments about what they do. Here are screenshots of the vizplotgui_tool.py script in action for different visualization package options. Click to see larger images: 11.9 PyLammps interface Please see the PyLammps Tutorial. 238 LAMMPS Users Manual Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands - Next Section 12. Errors This section describes the errors you can encounter when using LAMMPS, either conceptually, or as printed out by the program. 12.1 Common problems 12.2 Reporting bugs 12.3 Error & warning messages 12.1 Common problems If two LAMMPS runs do not produce the exact same answer on different machines or different numbers of processors, this is typically not a bug. In theory you should get identical answers on any number of processors and on any machine. In practice, numerical round-off can cause slight differences and eventual divergence of molecular dynamics phase space trajectories within a few 100s or few 1000s of timesteps. However, the statistical properties of the two runs (e.g. average energy or temperature) should still be the same. If the velocity command is used to set initial atom velocities, a particular atom can be assigned a different velocity when the problem is run on a different number of processors or on different machines. If this happens, the phase space trajectories of the two simulations will rapidly diverge. See the discussion of the loop option in the velocity command for details and options that avoid this issue. Similarly, the create_atoms command generates a lattice of atoms. For the same physical system, the ordering and numbering of atoms by atom ID may be different depending on the number of processors. Some commands use random number generators which may be setup to produce different random number streams on each processor and hence will produce different effects when run on different numbers of processors. A commonly-used example is the fix langevin command for thermostatting. A LAMMPS simulation typically has two stages, setup and run. Most LAMMPS errors are detected at setup time; others like a bond stretching too far may not occur until the middle of a run. LAMMPS tries to flag errors and print informative error messages so you can fix the problem. For most errors it will also print the last input script command that it was processing. Of course, LAMMPS cannot figure out your physics or numerical mistakes, like choosing too big a timestep, specifying erroneous force field coefficients, or putting 2 atoms on top of each other! If you run into errors that LAMMPS doesn't catch that you think it should flag, please send an email to the developers. 239 LAMMPS Users Manual If you get an error message about an invalid command in your input script, you can determine what command is causing the problem by looking in the log.lammps file or using the echo command to see it on the screen. If you get an error like "Invalid ... style", with ... being fix, compute, pair, etc, it means that you mistyped the style name or that the command is part of an optional package which was not compiled into your executable. The list of available styles in your executable can be listed by using the -h command-line argument. The installation and compilation of optional packages is explained in the installation instructions. For a given command, LAMMPS expects certain arguments in a specified order. If you mess this up, LAMMPS will often flag the error, but it may also simply read a bogus argument and assign a value that is valid, but not what you wanted. E.g. trying to read the string "abc" as an integer value of 0. Careful reading of the associated doc page for the command should allow you to fix these problems. In most cases, where LAMMPS expects to read a number, either integer or floating point, it performs a stringent test on whether the provided input actually is an integer or floating-point number, respectively, and reject the input with an error message (for instance, when an integer is required, but a floating-point number 1.0 is provided): ERROR: Expected integer parameter in input script or data file Some commands allow for using variable references in place of numeric constants so that the value can be evaluated and may change over the course of a run. This is typically done with the syntax v_name for a parameter, where name is the name of the variable. On the other hand, immediate variable expansion with the syntax$name is
performed while reading the input and before parsing commands,
NOTE: Using a variable reference (i.e. v_name) is only allowed if the documentation of
the corresponding command explicitly says it is.
Generally, LAMMPS will print a message to the screen and logfile and exit gracefully
when it encounters a fatal error. Sometimes it will print a WARNING to the screen
and logfile and continue on; you can decide if the WARNING is important or not. A
WARNING message that is generated in the middle of a run is only printed to the
screen, not to the logfile, to avoid cluttering up thermodynamic output. If LAMMPS
crashes or hangs without spitting out an error message first then it could be a bug
(see this section) or one of the following cases:
LAMMPS runs in the available memory a processor allows to be allocated. Most
reasonable MD runs are compute limited, not memory limited, so this shouldn't be a
bottleneck on most platforms. Almost all large memory allocations in the code are
done via C-style malloc's which will generate an error message if you run out of
memory. Smaller chunks of memory are allocated via C++ "new" statements. If you
are unlucky you could run out of memory just when one of these small requests is
made, in which case the code will crash or hang (in parallel), since LAMMPS doesn't
trap on those errors.
Illegal arithmetic can cause LAMMPS to run slow or crash. This is typically due to
invalid physics and numerics that your simulation is computing. If you see wild
thermodynamic values or NaN values in your LAMMPS output, something is wrong
with your simulation. If you suspect this is happening, it is a good idea to print out
240

LAMMPS Users Manual
thermodynamic info frequently (e.g. every timestep) via the thermo so you can
monitor what is happening. Visualizing the atom movement is also a good idea to
insure your model is behaving as you expect.
In parallel, one way LAMMPS can hang is due to how different MPI implementations
handle buffering of messages. If the code hangs without an error message, it may be
that you need to specify an MPI setting or two (usually via an environment variable) to
enable buffering or boost the sizes of messages that can be buffered.

12.2 Reporting bugs
If you are confident that you have found a bug in LAMMPS, follow these steps.
Check the New features and bug fixes section of the LAMMPS WWW site to see if the
bug has already been reported or fixed or the Unfixed bug to see if a fix is pending.
Check the mailing list to see if it has been discussed before.
If not, send an email to the mailing list describing the problem with any ideas you
have as to what is causing it or where in the code the problem might be. The
The most useful thing you can do to help us fix the bug is to isolate the problem. Run
it on the smallest number of atoms and fewest number of processors and with the
simplest input script that reproduces the bug and try to identify what command or
combination of commands is causing the problem.
As a last resort, you can send an email directly to the developers.
12.3 Error & warning messages
These are two alphabetic lists of the ERROR and WARNING messages LAMMPS prints
out and the reason why. If the explanation here is not sufficient, the documentation
for the offending command may help. Error and warning messages also list the source
file and line number where the error was generated. For example, this message
ERROR: Illegal velocity command (velocity.cpp:78)
means that line #78 in the file src/velocity.cpp generated the error. Looking in the
Note that error messages from user-contributed packages are not listed here. If such
an error occurs and is not self-explanatory, you'll need to look in the source code or
contact the author of the package.
Errors:
1-3 bond count is inconsistent
An inconsistency was detected when computing the number of 1-3 neighbors for
241

LAMMPS Users Manual
each atom. This likely means something is wrong with the bond topologies you
have defined.
1-4 bond count is inconsistent
An inconsistency was detected when computing the number of 1-4 neighbors for
each atom. This likely means something is wrong with the bond topologies you
have defined.
Accelerator sharing is not currently supported on system
Multiple MPI processes cannot share the accelerator on your system. For
NVIDIA GPUs, see the nvidia-smi command to change this setting.
All angle coeffs are not set
All angle coefficients must be set in the data file or by the angle_coeff command
before running a simulation.
All atom IDs = 0 but atom_modify id = yes
Self-explanatory.
All atoms of a swapped type must have same charge.
Self-explanatory.
All atoms of a swapped type must have the same charge.
Self-explanatory.
All bond coeffs are not set
All bond coefficients must be set in the data file or by the bond_coeff command
before running a simulation.
All dihedral coeffs are not set
All dihedral coefficients must be set in the data file or by the dihedral_coeff
command before running a simulation.
All improper coeffs are not set
All improper coefficients must be set in the data file or by the improper_coeff
command before running a simulation.
All masses are not set
For atom styles that define masses for each atom type, all masses must be set in
the data file or by the mass command before running a simulation. They must
also be set before using the velocity command.
All mol IDs should be set for fix gcmc group atoms
The molecule flag is on, yet not all molecule ids in the fix group have been set to
non-zero positive values by the user. This is an error since all atoms in the fix
gcmc group are eligible for deletion, rotation, and translation and therefore
must have valid molecule ids.
All pair coeffs are not set
All pair coefficients must be set in the data file or by the pair_coeff command
before running a simulation.
All read_dump x,y,z fields must be specified for scaled, triclinic coords
For triclinic boxes and scaled coordinates you must specify all 3 of the x,y,z
fields, else LAMMPS cannot reconstruct the unscaled coordinates.
All universe/uloop variables must have same # of values
Self-explanatory.
All variables in next command must be same style
Self-explanatory.
Angle atom missing in delete_bonds
The delete_bonds command cannot find one or more atoms in a particular angle
on a particular processor. The pairwise cutoff is too short or the atoms are too
far apart to make a valid angle.
Angle atom missing in set command
242

LAMMPS Users Manual
The set command cannot find one or more atoms in a particular angle on a
particular processor. The pairwise cutoff is too short or the atoms are too far
apart to make a valid angle.
Angle atoms %d %d %d missing on proc %d at step %ld
One or more of 3 atoms needed to compute a particular angle are missing on
this processor. Typically this is because the pairwise cutoff is set too short or
the angle has blown apart and an atom is too far away.
Angle atoms missing on proc %d at step %ld
One or more of 3 atoms needed to compute a particular angle are missing on
this processor. Typically this is because the pairwise cutoff is set too short or
the angle has blown apart and an atom is too far away.
Angle coeff for hybrid has invalid style
Angle style hybrid uses another angle style as one of its coefficients. The angle
style used in the angle_coeff command or read from a restart file is not
recognized.
Angle coeffs are not set
No angle coefficients have been assigned in the data file or via the angle_coeff
command.
Angle extent > half of periodic box length
This error was detected by the neigh_modify check yes setting. It is an error
because the angle atoms are so far apart it is ambiguous how it should be
defined.
Angle potential must be defined for SHAKE
When shaking angles, an angle_style potential must be used.
Angle style hybrid cannot have hybrid as an argument
Self-explanatory.
Angle style hybrid cannot have none as an argument
Self-explanatory.
Angle style hybrid cannot use same angle style twice
Self-explanatory.
Angle table must range from 0 to 180 degrees
Self-explanatory.
Angle table parameters did not set N
List of angle table parameters must include N setting.
Angle_coeff command before angle_style is defined
Coefficients cannot be set in the data file or via the angle_coeff command until
an angle_style has been assigned.
Angle_coeff command before simulation box is defined
create_box command.
Angle_coeff command when no angles allowed
The chosen atom style does not allow for angles to be defined.
Angle_style command when no angles allowed
The chosen atom style does not allow for angles to be defined.
Angles assigned incorrectly
Angles read in from the data file were not assigned correctly to atoms. This
means there is something invalid about the topology definitions.
Angles defined but no angle types
The data file header lists angles but no angle types.
Append boundary must be shrink/minimum
243

LAMMPS Users Manual
The boundary style of the face where atoms are added must be of type m
(shrink/minimum).
Arccos of invalid value in variable formula
Argument of arccos() must be between -1 and 1.
Arcsin of invalid value in variable formula
Argument of arcsin() must be between -1 and 1.
Assigning body parameters to non-body atom
Self-explanatory.
Assigning ellipsoid parameters to non-ellipsoid atom
Self-explanatory.
Assigning line parameters to non-line atom
Self-explanatory.
Assigning quat to non-body atom
Self-explanatory.
Assigning tri parameters to non-tri atom
Self-explanatory.
At least one atom of each swapped type must be present to define charges.
Self-explanatory.
Atom IDs must be consecutive for velocity create loop all
Self-explanatory.
Atom IDs must be used for molecular systems
Atom IDs are used to identify and find partner atoms in bonds.
Atom count changed in fix neb
This is not allowed in a NEB calculation.
Atom count is inconsistent, cannot write data file
The sum of atoms across processors does not equal the global number of atoms.
Probably some atoms have been lost.
Atom count is inconsistent, cannot write restart file
Sum of atoms across processors does not equal initial total count. This is
probably because you have lost some atoms.
Atom in too many rigid bodies - boost MAXBODY
Fix poems has a parameter MAXBODY (in fix_poems.cpp) which determines the
maximum number of rigid bodies a single atom can belong to (i.e. a multibody
joint). The bodies you have defined exceed this limit.
Atom sort did not operate correctly
This is an internal LAMMPS error. Please report it to the developers.
Atom sorting has bin size = 0.0
The neighbor cutoff is being used as the bin size, but it is zero. Thus you must
explicitly list a bin size in the atom_modify sort command or turn off sorting.
Atom style hybrid cannot have hybrid as an argument
Self-explanatory.
Atom style hybrid cannot use same atom style twice
Self-explanatory.
Atom style template molecule must have atom types
The defined molecule(s) does not specify atom types.
Atom style was redefined after using fix property/atom
This is not allowed.
Atom type must be zero in fix gcmc mol command
Self-explanatory.
Atom vector in equal-style variable formula
244

LAMMPS Users Manual
Atom vectors generate one value per atom which is not allowed in an
equal-style variable.
Atom-style variable in equal-style variable formula
Atom-style variables generate one value per atom which is not allowed in an
equal-style variable.
Atom_modify id command after simulation box is defined
The atom_modify id command cannot be used after a read_data, read_restart, or
create_box command.
Atom_modify map command after simulation box is defined
or create_box command.
Atom_modify sort and first options cannot be used together
Self-explanatory.
Atom_style command after simulation box is defined
create_box command.
Atom_style line can only be used in 2d simulations
Self-explanatory.
Atom_style tri can only be used in 3d simulations
Self-explanatory.
Atomfile variable could not read values
Check the file assigned to the variable.
Atomfile variable in equal-style variable formula
Self-explanatory.
Atomfile-style variable in equal-style variable formula
Self-explanatory.
Attempt to pop empty stack in fix box/relax
Internal LAMMPS error. Please report it to the developers.
Attempt to push beyond stack limit in fix box/relax
Internal LAMMPS error. Please report it to the developers.
Attempting to rescale a 0.0 temperature
Cannot rescale a temperature that is already 0.0.
Two atoms in a FENE bond have become so far apart that the bond cannot be
computed.
Bad TIP4P angle type for PPPM/TIP4P
Specified angle type is not valid.
Bad TIP4P angle type for PPPMDisp/TIP4P
Specified angle type is not valid.
Bad TIP4P bond type for PPPM/TIP4P
Specified bond type is not valid.
Bad TIP4P bond type for PPPMDisp/TIP4P
Specified bond type is not valid.
Bad fix ID in fix append/atoms command
The value of the fix_id for keyword spatial must start with 'f_'.
The 3d grid of processors defined by the processors command does not match
the number of processors LAMMPS is being run on.
Kspace_modify values for the kmax/ewald keyword must be integers > 0
245

LAMMPS Users Manual
Kspace_modify value for the slab/volume keyword must be >= 2.0.
This error should not occur unless the matrix is badly formed.
Fix rigid did not compute the principal moments of inertia of a rigid group of
atoms correctly.
This is an internal error. It should normally not occur.
This is an internal error. It should normally not occur.
Bad real space Coulomb cutoff in fix tune/kspace
Fix tune/kspace tried to find the optimal real space Coulomb cutoff using the
Newton-Rhaphson method, but found a non-positive or NaN cutoff
Balance command before simulation box is defined
create_box command.
This should not occur. It means two or more cutting plane locations are on top
of each other or out of order. Report the problem to the developers.
Balance rcb cannot be used with comm_style brick
Comm_style tiled must be used instead.
Balance shift string is invalid
The string can only contain the characters "x", "y", or "z".
Bias compute does not calculate a velocity bias
The specified compute must compute a bias for temperature.
Bias compute does not calculate temperature
The specified compute must compute temperature.
Bias compute group does not match compute group
The specified compute must operate on the same group as the parent compute.
Big particle in fix srd cannot be point particle
Big particles must be extended spheriods or ellipsoids.
Bigint setting in lmptype.h is invalid
Size of bigint is less than size of tagint.
Bigint setting in lmptype.h is not compatible
Format of bigint stored in restart file is not consistent with LAMMPS version
you are running. See the settings in src/lmptype.h
Bitmapped lookup tables require int/float be same size
Cannot use pair tables on this machine, because of word sizes. Use the
pair_modify command with table 0 instead.
Bitmapped table in file does not match requested table
Setting for bitmapped table in pair_coeff command must match table in file
exactly.
Bitmapped table is incorrect length in table file
Number of table entries is not a correct power of 2.
Bond and angle potentials must be defined for TIP4P
Cannot use TIP4P pair potential unless bond and angle potentials are defined.
Bond atom missing in box size check
The 2nd atoms needed to compute a particular bond is missing on this
processor. Typically this is because the pairwise cutoff is set too short or the
bond has blown apart and an atom is too far away.
Bond atom missing in delete_bonds
246

LAMMPS Users Manual
The delete_bonds command cannot find one or more atoms in a particular bond
on a particular processor. The pairwise cutoff is too short or the atoms are too
far apart to make a valid bond.
Bond atom missing in image check
The 2nd atom in a particular bond is missing on this processor. Typically this is
because the pairwise cutoff is set too short or the bond has blown apart and an
atom is too far away.
Bond atom missing in set command
The set command cannot find one or more atoms in a particular bond on a
particular processor. The pairwise cutoff is too short or the atoms are too far
apart to make a valid bond.
Bond atoms %d %d missing on proc %d at step %ld
The 2nd atom needed to compute a particular bond is missing on this processor.
Typically this is because the pairwise cutoff is set too short or the bond has
blown apart and an atom is too far away.
Bond atoms missing on proc %d at step %ld
The 2nd atom needed to compute a particular bond is missing on this processor.
Typically this is because the pairwise cutoff is set too short or the bond has
blown apart and an atom is too far away.
Bond coeff for hybrid has invalid style
Bond style hybrid uses another bond style as one of its coefficients. The bond
style used in the bond_coeff command or read from a restart file is not
recognized.
Bond coeffs are not set
No bond coefficients have been assigned in the data file or via the bond_coeff
command.
Bond extent > half of periodic box length
This error was detected by the neigh_modify check yes setting. It is an error
because the bond atoms are so far apart it is ambiguous how it should be
defined.
Bond potential must be defined for SHAKE
Cannot use fix shake unless bond potential is defined.
Bond style hybrid cannot have hybrid as an argument
Self-explanatory.
Bond style hybrid cannot have none as an argument
Self-explanatory.
Bond style hybrid cannot use same bond style twice
Self-explanatory.
Bond style quartic cannot be used with 3,4-body interactions
No angle, dihedral, or improper styles can be defined when using bond style
quartic.
Bond style quartic cannot be used with atom style template
This bond style can change the bond topology which is not allowed with this
atom style.
Bond style quartic requires special_bonds = 1,1,1
This is a restriction of the current bond quartic implementation.
Bond table parameters did not set N
List of bond table parameters must include N setting.
Bond table values are not increasing
The values in the tabulated file must be monotonically increasing.
BondAngle coeff for hybrid angle has invalid format
247

LAMMPS Users Manual
No "ba" field should appear in data file entry.
BondBond coeff for hybrid angle has invalid format
No "bb" field should appear in data file entry.
Bond_coeff command before bond_style is defined
Coefficients cannot be set in the data file or via the bond_coeff command until
an bond_style has been assigned.
Bond_coeff command before simulation box is defined
create_box command.
Bond_coeff command when no bonds allowed
The chosen atom style does not allow for bonds to be defined.
Bond_style command when no bonds allowed
The chosen atom style does not allow for bonds to be defined.
Bonds assigned incorrectly
Bonds read in from the data file were not assigned correctly to atoms. This
means there is something invalid about the topology definitions.
Bonds defined but no bond types
The data file header lists bonds but no bond types.
Both restart files must use % or neither
Self-explanatory.
Both restart files must use MPI-IO or neither
Self-explanatory.
Both sides of boundary must be periodic
Cannot specify a boundary as periodic only on the lo or hi side. Must be periodic
on both sides.
Boundary command after simulation box is defined
create_box command.
Box bounds are invalid
The box boundaries specified in the read_data file are invalid. The lo value must
be less than the hi value for all 3 dimensions.
Box command after simulation box is defined
The box command cannot be used after a read_data, read_restart, or create_box
command.
CPU neighbor lists must be used for ellipsoid/sphere mix.
When using Gay-Berne or RE-squared pair styles with both ellipsoidal and
spherical particles, the neighbor list must be built on the CPU
Can not specify Pxy/Pxz/Pyz in fix box/relax with non-triclinic box
Only triclinic boxes can be used with off-diagonal pressure components. See the
region prism command for details.
Can not specify Pxy/Pxz/Pyz in fix nvt/npt/nph with non-triclinic box
Only triclinic boxes can be used with off-diagonal pressure components. See the
region prism command for details.
Can only use -plog with multiple partitions
Self-explanatory. See doc page discussion of command-line switches.
Can only use -pscreen with multiple partitions
Self-explanatory. See doc page discussion of command-line switches.
Can only use Kokkos supported regions with Kokkos package
Self-explanatory.
Can only use NEB with 1-processor replicas
This is current restriction for NEB as implemented in LAMMPS.
248

LAMMPS Users Manual
Can only use TAD with 1-processor replicas for NEB
This is current restriction for NEB as implemented in LAMMPS.
Cannot (yet) do analytic differentiation with pppm/gpu
This is a current restriction of this command.
Cannot (yet) request ghost atoms with Kokkos half neighbor list
This feature is not yet supported.
Cannot (yet) use 'electron' units with dipoles
This feature is not yet supported.
Cannot (yet) use Ewald with triclinic box and slab correction
This feature is not yet supported.
Cannot (yet) use K-space slab correction with compute group/group for triclinic
systems
This option is not yet supported.
Cannot (yet) use MSM with 2d simulation
This feature is not yet supported.
Cannot (yet) use PPPM with triclinic box and TIP4P
This feature is not yet supported.
Cannot (yet) use PPPM with triclinic box and kspace_modify diff ad
This feature is not yet supported.
Cannot (yet) use PPPM with triclinic box and slab correction
This feature is not yet supported.
Cannot (yet) use kspace slab correction with long-range dipoles and non-neutral
systems or per-atom energy
This feature is not yet supported.
Cannot (yet) use kspace_modify diff ad with compute group/group
This option is not yet supported.
Cannot (yet) use kspace_style pppm/stagger with triclinic systems
This feature is not yet supported.
Cannot (yet) use molecular templates with Kokkos
Self-explanatory.
Cannot (yet) use respa with Kokkos
Self-explanatory.
Cannot (yet) use rigid bodies with fix deform and Kokkos
Self-explanatory.
Cannot (yet) use rigid bodies with fix nh and Kokkos
Self-explanatory.
Cannot (yet) use single precision with MSM (remove -DFFT_SINGLE from Makefile
and recompile)
Single precision cannot be used with MSM.
Cannot add atoms to fix move variable
Atoms can not be added afterwards to this fix option.
Cannot append atoms to a triclinic box
The simulation box must be defined with edges aligned with the Cartesian axes.
Cannot balance in z dimension for 2d simulation
Self-explanatory.
Cannot change box ortho/triclinic with certain fixes defined
This is because those fixes store the shape of the box. You need to use unfix to
discard the fix, change the box, then redefine a new fix.
Cannot change box ortho/triclinic with dumps defined
This is because some dumps store the shape of the box. You need to use
undump to discard the dump, change the box, then redefine a new dump.
249

LAMMPS Users Manual
Cannot change box tilt factors for orthogonal box
Cannot use tilt factors unless the simulation box is non-orthogonal.
Cannot change box to orthogonal when tilt is non-zero
Self-explanatory.
Cannot change box z boundary to nonperiodic for a 2d simulation
Self-explanatory.
Cannot change dump_modify every for dump dcd
The frequency of writing dump dcd snapshots cannot be changed.
Cannot change dump_modify every for dump xtc
The frequency of writing dump xtc snapshots cannot be changed.
Cannot change timestep once fix srd is setup
This is because various SRD properties depend on the timestep size.
Cannot change timestep with fix pour
This is because fix pour pre-computes the time delay for particles to fall out of
the insertion volume due to gravity.
Cannot change to comm_style brick from tiled layout
Self-explanatory.
Cannot change_box after reading restart file with per-atom info
This is because the restart file info cannot be migrated with the atoms. You can
get around this by performing a 0-timestep run which will assign the restart file
info to actual atoms.
Cannot change_box in xz or yz for 2d simulation
Self-explanatory.
Cannot change_box in z dimension for 2d simulation
Self-explanatory.
Cannot clear group all
This operation is not allowed.
Cannot close restart file - MPI error: %s
This error was generated by MPI when reading/writing an MPI-IO restart file.
Cannot compute initial g_ewald_disp
LAMMPS failed to compute an initial guess for the PPPM_disp g_ewald_6 factor
that partitions the computation between real space and k-space for Dispersion
interactions.
Cannot create an atom map unless atoms have IDs
The simulation requires a mapping from global atom IDs to local atoms, but the
atoms that have been defined have no IDs.
Cannot create atoms with undefined lattice
Must use the lattice command before using the create_atoms command.
Cannot create/grow a vector/array of pointers for %s
LAMMPS code is making an illegal call to the templated memory allocaters, to
create a vector or array of pointers.
Cannot create_atoms after reading restart file with per-atom info
The per-atom info was stored to be used when by a fix that you may re-define. If
you add atoms before re-defining the fix, then there will not be a correct
amount of per-atom info.
Cannot create_box after simulation box is defined
A simulation box can only be defined once.
Cannot currently use pair reax with pair hybrid
This is not yet supported.
Cannot currently use pppm/gpu with fix balance.
Self-explanatory.
250

LAMMPS Users Manual
Cannot delete group all
Self-explanatory.
Cannot delete group currently used by a compute
Self-explanatory.
Cannot delete group currently used by a dump
Self-explanatory.
Cannot delete group currently used by a fix
Self-explanatory.
Cannot delete group currently used by atom_modify first
Self-explanatory.
Cannot delete_atoms bond yes for non-molecular systems
Self-explanatory.
Cannot displace_atoms after reading restart file with per-atom info
This is because the restart file info cannot be migrated with the atoms. You can
get around this by performing a 0-timestep run which will assign the restart file
info to actual atoms.
Cannot do GCMC on atoms in atom_modify first group
This is a restriction due to the way atoms are organized in a list to enable the
atom_modify first command.
Cannot do atom/swap on atoms in atom_modify first group
This is a restriction due to the way atoms are organized in a list to enable the
atom_modify first command.
Cannot dump sort on atom IDs with no atom IDs defined
Self-explanatory.
Cannot dump sort when multiple dump files are written
In this mode, each processor dumps its atoms to a file, so no sorting is allowed.
Cannot embed Python when also extending Python with LAMMPS
When running LAMMPS via Python through the LAMMPS library interface you
cannot also user the input script python command.
Cannot evaporate atoms in atom_modify first group
This is a restriction due to the way atoms are organized in a list to enable the
atom_modify first command.
Cannot find create_bonds group ID
Self-explanatory.
Cannot find delete_bonds group ID
Group ID used in the delete_bonds command does not exist.
Cannot find specified group ID for core particles
Self-explanatory.
Cannot find specified group ID for shell particles
Self-explanatory.
Cannot have both pair_modify shift and tail set to yes
Cannot intersect groups using a dynamic group
This operation is not allowed.
Cannot mix molecular and molecule template atom styles
Self-explanatory.
Cannot open -reorder file
Self-explanatory.
Cannot open ADP potential file %s
The specified ADP potential file cannot be opened. Check that the path and
name are correct.
251

LAMMPS Users Manual
Cannot open AIREBO potential file %s
The specified AIREBO potential file cannot be opened. Check that the path and
name are correct.
Cannot open BOP potential file %s
The specified BOP potential file cannot be opened. Check that the path and
name are correct.
Cannot open COMB potential file %s
The specified COMB potential file cannot be opened. Check that the path and
name are correct.
Cannot open COMB3 lib.comb3 file
The COMB3 library file cannot be opened. Check that the path and name are
correct.
Cannot open COMB3 potential file %s
The specified COMB3 potential file cannot be opened. Check that the path and
name are correct.
Cannot open EAM potential file %s
The specified EAM potential file cannot be opened. Check that the path and
name are correct.
Cannot open EIM potential file %s
The specified EIM potential file cannot be opened. Check that the path and
name are correct.
Cannot open LCBOP potential file %s
The specified LCBOP potential file cannot be opened. Check that the path and
name are correct.
Cannot open MEAM potential file %s
The specified MEAM potential file cannot be opened. Check that the path and
name are correct.
Cannot open SNAP coefficient file %s
The specified SNAP coefficient file cannot be opened. Check that the path and
name are correct.
Cannot open SNAP parameter file %s
The specified SNAP parameter file cannot be opened. Check that the path and
name are correct.
Cannot open Stillinger-Weber potential file %s
The specified SW potential file cannot be opened. Check that the path and name
are correct.
Cannot open Tersoff potential file %s
The specified potential file cannot be opened. Check that the path and name are
correct.
Cannot open Vashishta potential file %s
The specified Vashishta potential file cannot be opened. Check that the path
and name are correct.
Cannot open balance output file
Self-explanatory.
Cannot open coul/streitz potential file %s
The specified coul/streitz potential file cannot be opened. Check that the path
and name are correct.
Cannot open custom file
Self-explanatory.
Cannot open data file %s
The specified file cannot be opened. Check that the path and name are correct.
252

LAMMPS Users Manual
Cannot open dir to search for restart file
Using a "*" in the name of the restart file will open the current directory to
search for matching file names.
Cannot open dump file
Self-explanatory.
Cannot open dump file %s
The output file for the dump command cannot be opened. Check that the path
and name are correct.
Cannot open file %s
The specified file cannot be opened. Check that the path and name are correct.
If the file is a compressed file, also check that the gzip executable can be found
and run.
Cannot open file variable file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix ave/chunk file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix ave/correlate file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix ave/histo file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix ave/spatial file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix ave/time file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix balance output file
Self-explanatory.
Cannot open fix poems file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix print file %s
The output file generated by the fix print command cannot be opened
Cannot open fix qeq parameter file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix qeq/comb file %s
The output file for the fix qeq/combs command cannot be opened. Check that
the path and name are correct.
Cannot open fix reax/bonds file %s
The output file for the fix reax/bonds command cannot be opened. Check that
the path and name are correct.
Cannot open fix rigid infile %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix rigid restart file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix rigid/small infile %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open fix tmd file %s
The output file for the fix tmd command cannot be opened. Check that the path
and name are correct.
Cannot open fix ttm file %s
The output file for the fix ttm command cannot be opened. Check that the path
and name are correct.
Cannot open gzipped file
253

LAMMPS Users Manual
LAMMPS was compiled without support for reading and writing gzipped files
through a pipeline to the gzip program with -DLAMMPS_GZIP.
Cannot open input script %s
Self-explanatory.
Cannot open log.cite file
This file is created when you use some LAMMPS features, to indicate what
paper you should cite on behalf of those who implemented the feature. Check
that you have write privileges into the directory you are running in.
Cannot open log.lammps for writing
The default LAMMPS log file cannot be opened. Check that the directory you
are running in allows for files to be created.
Cannot open logfile
The LAMMPS log file named in a command-line argument cannot be opened.
Check that the path and name are correct.
Cannot open logfile %s
The LAMMPS log file specified in the input script cannot be opened. Check that
the path and name are correct.
Cannot open molecule file %s
The specified file cannot be opened. Check that the path and name are correct.
Cannot open nb3b/harmonic potential file %s
The specified potential file cannot be opened. Check that the path and name are
correct.
Cannot open pair_write file
The specified output file for pair energies and forces cannot be opened. Check
that the path and name are correct.
Cannot open polymorphic potential file %s
The specified polymorphic potential file cannot be opened. Check that the path
and name are correct.
Cannot open print file %s
Self-explanatory.
Cannot open processors output file
Self-explanatory.
Cannot open restart file %s
Self-explanatory.
Cannot open restart file for reading - MPI error: %s
This error was generated by MPI when reading/writing an MPI-IO restart file.
Cannot open restart file for writing - MPI error: %s
This error was generated by MPI when reading/writing an MPI-IO restart file.
Cannot open screen file
The screen file specified as a command-line argument cannot be opened. Check
that the directory you are running in allows for files to be created.
Cannot open temporary file for world counter.
Self-explanatory.
Cannot open universe log file
For a multi-partition run, the master log file cannot be opened. Check that the
directory you are running in allows for files to be created.
Cannot open universe screen file
For a multi-partition run, the master screen file cannot be opened. Check that
the directory you are running in allows for files to be created.
Cannot read from restart file - MPI error: %s
This error was generated by MPI when reading/writing an MPI-IO restart file.
254

LAMMPS Users Manual
Self-explanatory.
Cannot read_restart after simulation box is defined
create_box command.
Cannot redefine variable as a different style
An equal-style variable can be re-defined but only if it was originally an
equal-style variable.
Cannot replicate 2d simulation in z dimension
The replicate command cannot replicate a 2d simulation in the z dimension.
Cannot replicate with fixes that store atom quantities
Either fixes are defined that create and store atom-based vectors or a restart
file was read which included atom-based vectors for fixes. The replicate
command cannot duplicate that information for new atoms. You should use the
replicate command before fixes are applied to the system.
Cannot reset timestep with a dynamic region defined
Dynamic regions (see the region command) have a time dependence. Thus you
cannot change the timestep when one or more of these are defined.
Cannot reset timestep with a time-dependent fix defined
You cannot reset the timestep when a fix that keeps track of elapsed time is in
place.
Cannot run 2d simulation with nonperiodic Z dimension
Use the boundary command to make the z dimension periodic in order to run a
2d simulation.
Cannot set bond topology types for atom style template
The bond, angle, etc types cannot be changed for this atom style since they are
static settings in the molecule template files.
Cannot set both respa pair and inner/middle/outer
In the rRESPA integrator, you must compute pairwise potentials either all
together (pair), or in pieces (inner/middle/outer). You can't do both.
Cannot set cutoff/multi before simulation box is defined
Self-explanatory.
Cannot set dpd/theta for this atom style
Self-explanatory.
Cannot set dump_modify flush for dump xtc
Self-explanatory.
Cannot set mass for this atom style
This atom style does not support mass settings for each atom type. Instead they
are defined on a per-atom basis in the data file.
Cannot set meso/cv for this atom style
Self-explanatory.
Cannot set meso/e for this atom style
Self-explanatory.
Cannot set meso/rho for this atom style
Self-explanatory.
Cannot set non-zero image flag for non-periodic dimension
Self-explanatory.
Cannot set non-zero z velocity for 2d simulation
Self-explanatory.
Cannot set quaternion for atom that has none
Self-explanatory.
255

LAMMPS Users Manual
Cannot set quaternion with xy components for 2d system
Self-explanatory.
Cannot set respa hybrid and any of pair/inner/middle/outer
In the rRESPA integrator, you must compute pairwise potentials either all
together (pair), with different cutoff regions (inner/middle/outer), or per hybrid
sub-style (hybrid). You cannot mix those.
Cannot set respa middle without inner/outer
In the rRESPA integrator, you must define both a inner and outer setting in
order to use a middle setting.
Cannot set restart file size - MPI error: %s
This error was generated by MPI when reading/writing an MPI-IO restart file.
Cannot set smd/contact/radius for this atom style
Self-explanatory.
Cannot set smd/mass/density for this atom style
Self-explanatory.
Cannot set temperature for fix rigid/nph
The temp keyword cannot be specified.
Cannot set theta for atom that is not a line
Self-explanatory.
Cannot set this attribute for this atom style
The attribute being set does not exist for the defined atom style.
Cannot set variable z velocity for 2d simulation
Self-explanatory.
Cannot skew triclinic box in z for 2d simulation
Self-explanatory.
Cannot subtract groups using a dynamic group
This operation is not allowed.
Cannot union groups using a dynamic group
This operation is not allowed.
Cannot use -cuda on and -kokkos on together
This is not allowed since both packages can use GPUs.
Cannot use -cuda on without USER-CUDA installed
The USER-CUDA package must be installed via "make yes-user-cuda" before
LAMMPS is built.
Cannot use -kokkos on without KOKKOS installed
Self-explanatory.
Cannot use -reorder after -partition
Self-explanatory. See doc page discussion of command-line switches.
Cannot use Ewald with 2d simulation
The kspace style ewald cannot be used in 2d simulations. You can use 2d Ewald
in a 3d simulation; see the kspace_modify command.
Cannot use Ewald/disp solver on system with no charge, dipole, or LJ particles
No atoms in system have a non-zero charge or dipole, or are LJ particles.
Change charges/dipoles or change options of the kspace solver/pair style.
Cannot use EwaldDisp with 2d simulation
This is a current restriction of this command.
Cannot use GPU package with USER-CUDA package enabled
You cannot use both the GPU and USER-CUDA packages together. Use one or
the other.
Cannot use Kokkos pair style with rRESPA inner/middle
Self-explanatory.
256

LAMMPS Users Manual
Cannot use NEB unless atom map exists
Use the atom_modify command to create an atom map.
Cannot use NEB with a single replica
Self-explanatory.
Cannot use NEB with atom_modify sort enabled
This is current restriction for NEB implemented in LAMMPS.
Cannot use PPPM with 2d simulation
The kspace style pppm cannot be used in 2d simulations. You can use 2d PPPM
in a 3d simulation; see the kspace_modify command.
Cannot use PPPMDisp with 2d simulation
The kspace style pppm/disp cannot be used in 2d simulations. You can use 2d
pppm/disp in a 3d simulation; see the kspace_modify command.
Cannot use PRD with a changing box
The current box dimensions are not copied between replicas
Cannot use PRD with a time-dependent fix defined
PRD alters the timestep in ways that will mess up these fixes.
Cannot use PRD with a time-dependent region defined
PRD alters the timestep in ways that will mess up these regions.
Cannot use PRD with atom_modify sort enabled
This is a current restriction of PRD. You must turn off sorting, which is enabled
by default, via the atom_modify command.
Cannot use PRD with multi-processor replicas unless atom map exists
Use the atom_modify command to create an atom map.
Cannot use TAD unless atom map exists for NEB
See atom_modify map command to set this.
Cannot use TAD with a single replica for NEB
NEB requires multiple replicas.
Cannot use TAD with atom_modify sort enabled for NEB
This is a current restriction of NEB.
Cannot use a damped dynamics min style with fix box/relax
This is a current restriction in LAMMPS. Use another minimizer style.
Cannot use a damped dynamics min style with per-atom DOF
This is a current restriction in LAMMPS. Use another minimizer style.
Cannot use append/atoms in periodic dimension
The boundary style of the face where atoms are added can not be of type p
(periodic).
Cannot use atomfile-style variable unless atom map exists
Self-explanatory. See the atom_modify command to create a map.
Cannot use both com and bias with compute temp/chunk
Self-explanatory.
Cannot use chosen neighbor list style with buck/coul/cut/kk
Self-explanatory.
Cannot use chosen neighbor list style with buck/coul/long/kk
Self-explanatory.
Cannot use chosen neighbor list style with buck/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with coul/cut/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with coul/debye/kk
Self-explanatory.
Cannot use chosen neighbor list style with coul/dsf/kk
257

LAMMPS Users Manual
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with coul/wolf/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with lj/charmm/coul/charmm/implicit/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/charmm/coul/charmm/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/charmm/coul/long/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/class2/coul/cut/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/class2/coul/long/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/class2/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/cut/coul/cut/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with lj/cut/coul/debye/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/cut/coul/long/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with lj/cut/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with lj/expand/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/gromacs/coul/gromacs/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/gromacs/kk
Self-explanatory.
Cannot use chosen neighbor list style with lj/sdk/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with pair eam/kk
That style is not supported by Kokkos.
Cannot use chosen neighbor list style with pair eam/kk/alloy
Self-explanatory.
Cannot use chosen neighbor list style with pair eam/kk/fs
Self-explanatory.
Cannot use chosen neighbor list style with pair sw/kk
Self-explanatory.
Cannot use chosen neighbor list style with tersoff/kk
Self-explanatory.
Cannot use chosen neighbor list style with tersoff/zbl/kk
Self-explanatory.
Cannot use compute chunk/atom bin z for 2d model
Self-explanatory.
Cannot use compute cluster/atom unless atoms have IDs
Atom IDs are used to identify clusters.
Cannot use create_atoms rotate unless single style
Self-explanatory.
Cannot use create_bonds unless atoms have IDs
258

LAMMPS Users Manual
This command requires a mapping from global atom IDs to local atoms, but the
atoms that have been defined have no IDs.
Cannot use create_bonds with non-molecular system
Self-explanatory.
Cannot use cwiggle in variable formula between runs
This is a function of elapsed time.
Cannot use delete_atoms bond yes with atom_style template
This is because the bonds for that atom style are hardwired in the molecule
template.
Cannot use delete_atoms unless atoms have IDs
Your atoms do not have IDs, so the delete_atoms command cannot be used.
Cannot use delete_bonds with non-molecular system
Your choice of atom style does not have bonds.
Cannot use dump_modify fileper without % in dump file name
Self-explanatory.
Cannot use dump_modify nfile without % in dump file name
Self-explanatory.
Cannot use dynamic group with fix adapt atom
This is not yet supported.
Cannot use fix TMD unless atom map exists
Using this fix requires the ability to lookup an atom index, which is provided by
an atom map. An atom map does not exist (by default) for non-molecular
problems. Using the atom_modify map command will force an atom map to be
created.
Cannot use fix ave/spatial z for 2 dimensional model
Self-explanatory.
Cannot use fix bond/break with non-molecular systems
Only systems with bonds that can be changed can be used. Atom_style template
does not qualify.
Cannot use fix bond/create with non-molecular systems
Only systems with bonds that can be changed can be used. Atom_style template
does not qualify.
Cannot use fix bond/swap with non-molecular systems
Only systems with bonds that can be changed can be used. Atom_style template
does not qualify.
Cannot use fix box/relax on a 2nd non-periodic dimension
When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified, then the y
dimension must be periodic.
Cannot use fix box/relax on a non-periodic dimension
When specifying a diagonal pressure component, the dimension must be
periodic.
Cannot use fix box/relax with both relaxation and scaling on a tilt factor
When specifying scaling on a tilt factor component, that component can not also
be controlled by the barostat. E.g. if scalexy yes is specified and also keyword
tri or xy, this is wrong.
Cannot use fix box/relax with tilt factor scaling on a 2nd non-periodic dimension
When specifying scaling on a tilt factor component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified, then the y
dimension must be periodic.
Cannot use fix deform on a shrink-wrapped boundary
259

LAMMPS Users Manual
The x, y, z options cannot be applied to shrink-wrapped dimensions.
Cannot use fix deform tilt on a shrink-wrapped 2nd dim
This is because the shrink-wrapping will change the value of the strain implied
by the tilt factor.
Cannot use fix deform trate on a box with zero tilt
The trate style alters the current strain.
Cannot use fix deposit rigid and not molecule
Self-explanatory.
Cannot use fix deposit rigid and shake
These two attributes are conflicting.
Cannot use fix deposit shake and not molecule
Self-explanatory.
Cannot use fix enforce2d with 3d simulation
Self-explanatory.
Cannot use fix gcmc in a 2d simulation
Fix gcmc is set up to run in 3d only. No 2d simulations with fix gcmc are
allowed.
Cannot use fix gcmc shake and not molecule
Self-explanatory.
Cannot use fix msst without per-type mass defined
Self-explanatory.
Cannot use fix npt and fix deform on same component of stress tensor
This would be changing the same box dimension twice.
Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension
When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified, then the y
dimension must be periodic.
Cannot use fix nvt/npt/nph on a non-periodic dimension
When specifying a diagonal pressure component, the dimension must be
periodic.
Cannot use fix nvt/npt/nph with both xy dynamics and xy scaling
Self-explanatory.
Cannot use fix nvt/npt/nph with both xz dynamics and xz scaling
Self-explanatory.
Cannot use fix nvt/npt/nph with both yz dynamics and yz scaling
Self-explanatory.
Cannot use fix nvt/npt/nph with xy scaling when y is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic.
Cannot use fix nvt/npt/nph with xz scaling when z is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic.
Cannot use fix nvt/npt/nph with yz scaling when z is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic.
Cannot use fix pour rigid and not molecule
Self-explanatory.
Cannot use fix pour rigid and shake
These two attributes are conflicting.
Cannot use fix pour shake and not molecule
Self-explanatory.
Cannot use fix pour with triclinic box
This option is not yet supported.
Cannot use fix press/berendsen and fix deform on same component of stress tensor
260

LAMMPS Users Manual
These commands both change the box size/shape, so you cannot use both
together.
Cannot use fix press/berendsen on a non-periodic dimension
Self-explanatory.
Cannot use fix press/berendsen with triclinic box
Self-explanatory.
Cannot use fix reax/bonds without pair_style reax
Self-explanatory.
Cannot use fix rigid npt/nph and fix deform on same component of stress tensor
This would be changing the same box dimension twice.
Cannot use fix rigid npt/nph on a non-periodic dimension
When specifying a diagonal pressure component, the dimension must be
periodic.
Cannot use fix rigid/small npt/nph on a non-periodic dimension
When specifying a diagonal pressure component, the dimension must be
periodic.
Cannot use fix shake with non-molecular system
Your choice of atom style does not have bonds.
Cannot use fix ttm with 2d simulation
This is a current restriction of this fix due to the grid it creates.
Cannot use fix ttm with triclinic box
This is a current restriction of this fix due to the grid it creates.
Cannot use fix tune/kspace without a kspace style
Self-explanatory.
Cannot use fix tune/kspace without a pair style
This fix (tune/kspace) can only be used when a pair style has been specified.
Cannot use fix wall in periodic dimension
Self-explanatory.
Cannot use fix wall zlo/zhi for a 2d simulation
Self-explanatory.
Cannot use fix wall/reflect in periodic dimension
Self-explanatory.
Cannot use fix wall/reflect zlo/zhi for a 2d simulation
Self-explanatory.
Cannot use fix wall/srd in periodic dimension
Self-explanatory.
Cannot use fix wall/srd more than once
Nor is their a need to since multiple walls can be specified in one command.
Cannot use fix wall/srd without fix srd
Self-explanatory.
Cannot use fix wall/srd zlo/zhi for a 2d simulation
Self-explanatory.
Cannot use fix_deposit unless atoms have IDs
Self-explanatory.
Cannot use fix_pour unless atoms have IDs
Self-explanatory.
Cannot use include command within an if command
Self-explanatory.
Cannot use lines with fix srd unless overlap is set
This is because line segments are connected to each other.
Cannot use multiple fix wall commands with pair brownian
261

LAMMPS Users Manual
Self-explanatory.
Cannot use multiple fix wall commands with pair lubricate
Self-explanatory.
Cannot use multiple fix wall commands with pair lubricate/poly
Self-explanatory.
Cannot use multiple fix wall commands with pair lubricateU
Self-explanatory.
Cannot use neigh_modify exclude with GPU neighbor builds
This is a current limitation of the GPU implementation in LAMMPS.
Cannot use neighbor bins - box size << cutoff
Too many neighbor bins will be created. This typically happens when the
simulation box is very small in some dimension, compared to the neighbor
cutoff. Use the "nsq" style instead of "bin" style.
Cannot use newton pair with beck/gpu pair style
Self-explanatory.
Cannot use newton pair with born/coul/long/gpu pair style
Self-explanatory.
Cannot use newton pair with born/coul/wolf/gpu pair style
Self-explanatory.
Cannot use newton pair with born/gpu pair style
Self-explanatory.
Cannot use newton pair with buck/coul/cut/gpu pair style
Self-explanatory.
Cannot use newton pair with buck/coul/long/gpu pair style
Self-explanatory.
Cannot use newton pair with buck/gpu pair style
Self-explanatory.
Cannot use newton pair with colloid/gpu pair style
Self-explanatory.
Cannot use newton pair with coul/cut/gpu pair style
Self-explanatory.
Cannot use newton pair with coul/debye/gpu pair style
Self-explanatory.
Cannot use newton pair with coul/dsf/gpu pair style
Self-explanatory.
Cannot use newton pair with coul/long/gpu pair style
Self-explanatory.
Cannot use newton pair with dipole/cut/gpu pair style
Self-explanatory.
Cannot use newton pair with dipole/sf/gpu pair style
Self-explanatory.
Cannot use newton pair with dpd/gpu pair style
Self-explanatory.
Cannot use newton pair with dpd/tstat/gpu pair style
Self-explanatory.
Cannot use newton pair with eam/alloy/gpu pair style
Self-explanatory.
Cannot use newton pair with eam/fs/gpu pair style
Self-explanatory.
Cannot use newton pair with eam/gpu pair style
Self-explanatory.
262

LAMMPS Users Manual
Cannot use newton pair with gauss/gpu pair style
Self-explanatory.
Cannot use newton pair with gayberne/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/charmm/coul/long/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/class2/coul/long/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/class2/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/cubic/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/cut/coul/cut/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/cut/coul/debye/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/cut/coul/dsf/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/cut/coul/long/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/cut/coul/msm/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/cut/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/expand/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/gromacs/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/sdk/coul/long/gpu pair style
Self-explanatory.
Cannot use newton pair with lj/sdk/gpu pair style
Self-explanatory.
Cannot use newton pair with lj96/cut/gpu pair style
Self-explanatory.
Cannot use newton pair with mie/cut/gpu pair style
Self-explanatory.
Cannot use newton pair with morse/gpu pair style
Self-explanatory.
Cannot use newton pair with resquared/gpu pair style
Self-explanatory.
Cannot use newton pair with soft/gpu pair style
Self-explanatory.
Cannot use newton pair with table/gpu pair style
Self-explanatory.
Cannot use newton pair with yukawa/colloid/gpu pair style
Self-explanatory.
Cannot use newton pair with yukawa/gpu pair style
Self-explanatory.
Cannot use newton pair with zbl/gpu pair style
Self-explanatory.
Cannot use non-zero forces in an energy minimization
263

LAMMPS Users Manual
Fix setforce cannot be used in this manner. Use fix addforce instead.
Cannot use nonperiodic boundares with fix ttm
This fix requires a fully periodic simulation box.
Cannot use nonperiodic boundaries with Ewald
For kspace style ewald, all 3 dimensions must have periodic boundaries unless
you use the kspace_modify command to define a 2d slab with a non-periodic z
dimension.
Cannot use nonperiodic boundaries with EwaldDisp
For kspace style ewald/disp, all 3 dimensions must have periodic boundaries
unless you use the kspace_modify command to define a 2d slab with a
non-periodic z dimension.
Cannot use nonperiodic boundaries with PPPM
For kspace style pppm, all 3 dimensions must have periodic boundaries unless
you use the kspace_modify command to define a 2d slab with a non-periodic z
dimension.
Cannot use nonperiodic boundaries with PPPMDisp
For kspace style pppm/disp, all 3 dimensions must have periodic boundaries
unless you use the kspace_modify command to define a 2d slab with a
non-periodic z dimension.
Cannot use order greater than 8 with pppm/gpu.
Self-explanatory.
Cannot use package gpu neigh yes with triclinic box
This is a current restriction in LAMMPS.
Cannot use pair hybrid with GPU neighbor list builds
Neighbor list builds must be done on the CPU for this pair style.
Cannot use pair tail corrections with 2d simulations
The correction factors are only currently defined for 3d systems.
Cannot use processors part command without using partitions
See the command-line -partition switch.
Cannot use ramp in variable formula between runs
This is because the ramp() function is time dependent.
Self-explanatory.
Self-explanatory.
Self-explanatory.
Self-explanatory.
Cannot use region INF or EDGE when box does not exist
Regions that extend to the box boundaries can only be used after the create_box
command has been used.
Cannot use set atom with no atom IDs defined
Atom IDs are not defined, so they cannot be used to identify an atom.
Cannot use set mol with no molecule IDs defined
Self-explanatory.
Cannot use swiggle in variable formula between runs
This is a function of elapsed time.
Cannot use tris with fix srd unless overlap is set
This is because triangles are connected to each other.
Cannot use variable energy with constant efield in fix efield
264

LAMMPS Users Manual
LAMMPS computes the energy itself when the E-field is constant.
Cannot use variable energy with constant force in fix addforce
This is because for constant force, LAMMPS can compute the change in energy
directly.
Cannot use variable every setting for dump dcd
The format of DCD dump files requires snapshots be output at a constant
frequency.
Cannot use variable every setting for dump xtc
The format of this file requires snapshots at regular intervals.
Cannot use vdisplace in variable formula between runs
This is a function of elapsed time.
Cannot use velocity bias command without temp keyword
Self-explanatory.
Cannot use velocity create loop all unless atoms have IDs
Atoms in the simulation to do not have IDs, so this style of velocity creation
cannot be performed.
Cannot use wall in periodic dimension
Self-explanatory.
Cannot use write_restart fileper without % in restart file name
Self-explanatory.
Cannot use write_restart nfile without % in restart file name
Self-explanatory.
Cannot wiggle and shear fix wall/gran
Cannot specify both options at the same time.
Cannot write to restart file - MPI error: %s
This error was generated by MPI when reading/writing an MPI-IO restart file.
Cannot yet use KSpace solver with grid with comm style tiled
This is current restriction in LAMMPS.
Cannot yet use comm_style tiled with multi-mode comm
Self-explanatory.
Cannot yet use comm_style tiled with triclinic box
Self-explanatory.
Cannot yet use compute tally with Kokkos
This feature is not yet supported.
Cannot yet use fix bond/break with this improper style
This is a current restriction in LAMMPS.
Cannot yet use fix bond/create with this improper style
This is a current restriction in LAMMPS.
Cannot yet use minimize with Kokkos
This feature is not yet supported.
Cannot yet use pair hybrid with Kokkos
This feature is not yet supported.
Cannot zero Langevin force of 0 atoms
The group has zero atoms, so you cannot request its force be zeroed.
Cannot zero gld force for zero atoms
There are no atoms currently in the group.
Cannot zero momentum of no atoms
Self-explanatory.
Change_box command before simulation box is defined
Self-explanatory.
Change_box volume used incorrectly
265

LAMMPS Users Manual
The "dim volume" option must be used immediately following one or two
settings for "dim1 ..." (and optionally "dim2 ...") and must be for a different
dimension, i.e. dim != dim1 and dim != dim2.
Chunk/atom compute does not exist for compute angmom/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute com/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute gyration/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute inertia/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute msd/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute omega/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute property/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute temp/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute torque/chunk
Self-explanatory.
Chunk/atom compute does not exist for compute vcm/chunk
Self-explanatory.
Chunk/atom compute does not exist for fix ave/chunk
Self-explanatory.
Comm tiled invalid index in box drop brick
Internal error check in comm_style tiled which should not occur. Contact the
developers.
Comm tiled mis-match in box drop brick
Internal error check in comm_style tiled which should not occur. Contact the
developers.
Comm_modify group != atom_modify first group
Self-explanatory.
Communication cutoff for comm_style tiled cannot exceed periodic box length
Self-explanatory.
Communication cutoff too small for SNAP micro load balancing
This can happen if you change the neighbor skin after your pair_style command
or if your box dimensions grow during a run. You can set the cutoff explicitly via
the comm_modify cutoff command.
Compute %s does not allow use of dynamic group
Dynamic groups have not yet been enabled for this compute.
Compute ID for compute chunk /atom does not exist
Self-explanatory.
Compute ID for compute chunk/atom does not exist
Self-explanatory.
Compute ID for compute reduce does not exist
Self-explanatory.
Compute ID for compute slice does not exist
Self-explanatory.
Compute ID for fix ave/atom does not exist
Self-explanatory.
266

LAMMPS Users Manual
Compute ID for fix ave/chunk does not exist
Self-explanatory.
Compute ID for fix ave/correlate does not exist
Self-explanatory.
Compute ID for fix ave/histo does not exist
Self-explanatory.
Compute ID for fix ave/spatial does not exist
Self-explanatory.
Compute ID for fix ave/time does not exist
Self-explanatory.
Compute ID for fix store/state does not exist
Self-explanatory.
Compute ID for fix vector does not exist
Self-explanatory.
Compute ID must be alphanumeric or underscore characters
Self-explanatory.
Compute angle/local used when angles are not allowed
The atom style does not support angles.
Compute angmom/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute body/local requires atom style body
Self-explanatory.
Compute bond/local used when bonds are not allowed
The atom style does not support bonds.
Compute centro/atom requires a pair style be defined
This is because the computation of the centro-symmetry values uses a pairwise
neighbor list.
Compute chunk/atom bin/cylinder radius is too large for periodic box
Radius cannot be bigger than 1/2 of a non-axis periodic dimension.
Compute chunk/atom bin/sphere radius is too large for periodic box
Radius cannot be bigger than 1/2 of any periodic dimension.
Compute chunk/atom compute array is accessed out-of-range
The index for the array is out of bounds.
Compute chunk/atom compute does not calculate a per-atom array
Self-explanatory.
Compute chunk/atom compute does not calculate a per-atom vector
Self-explanatory.
Compute chunk/atom compute does not calculate per-atom values
Self-explanatory.
Compute chunk/atom cylinder axis must be z for 2d
Self-explanatory.
Compute chunk/atom fix array is accessed out-of-range
the index for the array is out of bounds.
Compute chunk/atom fix does not calculate a per-atom array
Self-explanatory.
Compute chunk/atom fix does not calculate a per-atom vector
Self-explanatory.
Compute chunk/atom fix does not calculate per-atom values
Self-explanatory.
Compute chunk/atom for triclinic boxes requires units reduced
Self-explanatory.
267

LAMMPS Users Manual
Compute chunk/atom ids once but nchunk is not once
You cannot assign chunks IDs to atom permanently if the number of chunks may
change.
Compute chunk/atom molecule for non-molecular system
Self-explanatory.
Compute chunk/atom sphere z origin must be 0.0 for 2d
Self-explanatory.
Compute chunk/atom stores no IDs for compute property/chunk
It will only store IDs if its compress option is enabled.
Compute chunk/atom stores no coord1 for compute property/chunk
Only certain binning options for compute chunk/atom store coordinates.
Compute chunk/atom stores no coord2 for compute property/chunk
Only certain binning options for compute chunk/atom store coordinates.
Compute chunk/atom stores no coord3 for compute property/chunk
Only certain binning options for compute chunk/atom store coordinates.
Compute chunk/atom variable is not atom-style variable
Self-explanatory.
Compute chunk/atom without bins cannot use discard mixed
That discard option only applies to the binning styles.
Compute cluster/atom cutoff is longer than pairwise cutoff
Cannot identify clusters beyond cutoff.
Compute cluster/atom requires a pair style be defined
This is so that the pair style defines a cutoff distance which is used to find
clusters.
Compute cna/atom cutoff is longer than pairwise cutoff
Self-explanatory.
Compute cna/atom requires a pair style be defined
Self-explanatory.
Compute com/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute contact/atom requires a pair style be defined
Self-explanatory.
Compute contact/atom requires atom style sphere
Self-explanatory.
Compute coord/atom cutoff is longer than pairwise cutoff
Cannot compute coordination at distances longer than the pair cutoff, since
those atoms are not in the neighbor list.
Compute coord/atom requires a pair style be defined
Self-explanatory.
Compute damage/atom requires peridynamic potential
Damage is a Peridynamic-specific metric. It requires you to be running a
Peridynamics simulation.
Compute dihedral/local used when dihedrals are not allowed
The atom style does not support dihedrals.
Compute dilatation/atom cannot be used with this pair style
Self-explanatory.
Compute dilatation/atom requires Peridynamic pair style
Self-explanatory.
Compute does not allow an extra compute or fix to be reset
This is an internal LAMMPS error. Please report it to the developers.
Compute erotate/asphere requires atom style ellipsoid or line or tri
268

LAMMPS Users Manual
Self-explanatory.
Compute erotate/asphere requires extended particles
This compute cannot be used with point particles.
Compute erotate/rigid with non-rigid fix-ID
Self-explanatory.
Compute erotate/sphere requires atom style sphere
Self-explanatory.
Compute erotate/sphere/atom requires atom style sphere
Self-explanatory.
Compute event/displace has invalid fix event assigned
This is an internal LAMMPS error. Please report it to the developers.
Compute group/group group ID does not exist
Self-explanatory.
Compute gyration/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute heat/flux compute ID does not compute ke/atom
Self-explanatory.
Compute heat/flux compute ID does not compute pe/atom
Self-explanatory.
Compute heat/flux compute ID does not compute stress/atom
Self-explanatory.
Compute hexorder/atom cutoff is longer than pairwise cutoff
Cannot compute order parameter beyond cutoff.
Compute hexorder/atom requires a pair style be defined
Self-explanatory.
Compute improper/local used when impropers are not allowed
The atom style does not support impropers.
Compute inertia/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute ke/rigid with non-rigid fix-ID
Self-explanatory.
Compute msd/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute msd/chunk nchunk is not static
This is required because the MSD cannot be computed consistently if the
number of chunks is changing. Compute chunk/atom allows setting nchunk to
be static.
Compute nve/asphere requires atom style ellipsoid
Self-explanatory.
Compute nvt/nph/npt asphere requires atom style ellipsoid
Self-explanatory.
Compute nvt/nph/npt body requires atom style body
Self-explanatory.
Compute omega/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute orientorder/atom cutoff is longer than pairwise cutoff
Cannot compute order parameter beyond cutoff.
Compute orientorder/atom requires a pair style be defined
Self-explanatory.
Compute pair must use group all
Pair styles accumulate energy on all atoms.
269

LAMMPS Users Manual
Compute pe must use group all
Energies computed by potentials (pair, bond, etc) are computed on all atoms.
Compute plasticity/atom cannot be used with this pair style
Self-explanatory.
Compute plasticity/atom requires Peridynamic pair style
Self-explanatory.
Compute pressure must use group all
Virial contributions computed by potentials (pair, bond, etc) are computed on all
atoms.
Compute pressure requires temperature ID to include kinetic energy
The keflag cannot be used unless a temperature compute is provided.
Compute pressure temperature ID does not compute temperature
The compute ID assigned to a pressure computation must compute
temperature.
Compute property/atom floating point vector does not exist
The command is accessing a vector added by the fix property/atom command,
that does not exist.
Compute property/atom for atom property that isn't allocated
Self-explanatory.
Compute property/atom integer vector does not exist
The command is accessing a vector added by the fix property/atom command,
that does not exist.
Compute property/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute property/local cannot use these inputs together
Only inputs that generate the same number of datums can be used together.
E.g. bond and angle quantities cannot be mixed.
Compute property/local does not (yet) work with atom_style template
Self-explanatory.
Compute property/local for property that isn't allocated
Self-explanatory.
Compute rdf requires a pair style be defined
Self-explanatory.
Compute reduce compute array is accessed out-of-range
An index for the array is out of bounds.
Compute reduce compute calculates global values
A compute that calculates peratom or local values is required.
Compute reduce compute does not calculate a local array
Self-explanatory.
Compute reduce compute does not calculate a local vector
Self-explanatory.
Compute reduce compute does not calculate a per-atom array
Self-explanatory.
Compute reduce compute does not calculate a per-atom vector
Self-explanatory.
Compute reduce fix array is accessed out-of-range
An index for the array is out of bounds.
Compute reduce fix calculates global values
A fix that calculates peratom or local values is required.
Compute reduce fix does not calculate a local array
Self-explanatory.
270

LAMMPS Users Manual
Compute reduce fix does not calculate a local vector
Self-explanatory.
Compute reduce fix does not calculate a per-atom array
Self-explanatory.
Compute reduce fix does not calculate a per-atom vector
Self-explanatory.
Compute reduce replace requires min or max mode
Self-explanatory.
Compute reduce variable is not atom-style variable
Self-explanatory.
Compute slice compute array is accessed out-of-range
An index for the array is out of bounds.
Compute slice compute does not calculate a global array
Self-explanatory.
Compute slice compute does not calculate a global vector
Self-explanatory.
Compute slice compute does not calculate global vector or array
Self-explanatory.
Compute slice compute vector is accessed out-of-range
The index for the vector is out of bounds.
Compute slice fix array is accessed out-of-range
An index for the array is out of bounds.
Compute slice fix does not calculate a global array
Self-explanatory.
Compute slice fix does not calculate a global vector
Self-explanatory.
Compute slice fix does not calculate global vector or array
Self-explanatory.
Compute slice fix vector is accessed out-of-range
The index for the vector is out of bounds.
Compute sna/atom cutoff is longer than pairwise cutoff
Self-explanatory.
Compute sna/atom requires a pair style be defined
Self-explanatory.
Compute snad/atom cutoff is longer than pairwise cutoff
Self-explanatory.
Compute snad/atom requires a pair style be defined
Self-explanatory.
Compute snav/atom cutoff is longer than pairwise cutoff
Self-explanatory.
Compute snav/atom requires a pair style be defined
Self-explanatory.
Compute stress/atom temperature ID does not compute temperature
The specified compute must compute temperature.
Compute temp/asphere requires atom style ellipsoid
Self-explanatory.
Compute temp/asphere requires extended particles
This compute cannot be used with point particles.
Compute temp/body requires atom style body
Self-explanatory.
Compute temp/body requires bodies
271

LAMMPS Users Manual
This compute can only be applied to body particles.
Compute temp/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute temp/cs requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Compute temp/cs used when bonds are not allowed
This compute only works on pairs of bonded particles.
Compute temp/partial cannot use vz for 2d systemx
Self-explanatory.
Compute temp/profile cannot bin z for 2d systems
Self-explanatory.
Compute temp/profile cannot use vz for 2d systemx
Self-explanatory.
Compute temp/sphere requires atom style sphere
Self-explanatory.
Compute ti kspace style does not exist
Self-explanatory.
Compute ti pair style does not exist
Self-explanatory.
Compute ti tail when pair style does not compute tail corrections
Self-explanatory.
Compute torque/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Compute used in dump between runs is not current
The compute was not invoked on the current timestep, therefore it cannot be
used in a dump between runs.
Compute used in variable between runs is not current
Computes cannot be invoked by a variable in between runs. Thus they must
have been evaluated on the last timestep of the previous run in order for their
value(s) to be accessed. See the doc page for the variable command for more
info.
Compute used in variable thermo keyword between runs is not current
Some thermo keywords rely on a compute to calculate their value(s). Computes
cannot be invoked by a variable in between runs. Thus they must have been
evaluated on the last timestep of the previous run in order for their value(s) to
be accessed. See the doc page for the variable command for more info.
Compute vcm/chunk does not use chunk/atom compute
The style of the specified compute is not chunk/atom.
Computed temperature for fix temp/berendsen cannot be 0.0
Self-explanatory.
Computed temperature for fix temp/rescale cannot be 0.0
Cannot rescale the temperature to a new value if the current temperature is
0.0.
Could not find one of the atoms in the bond pair.
Core/shell partners were not all found
Could not find or more atoms in the bond pairs.
The Newton-Raphson solver failed to converge to a good value for g_ewald. This
error should not occur for typical problems. Please send an email to the
developers.
272

LAMMPS Users Manual
Could not compute g_ewald
The Newton-Raphson solver failed to converge to a good value for g_ewald. This
error should not occur for typical problems. Please send an email to the
developers.
Could not compute grid size
The code is unable to compute a grid size consistent with the desired accuracy.
This error should not occur for typical problems. Please send an email to the
developers.
Could not compute grid size for Coulomb interaction
The code is unable to compute a grid size consistent with the desired accuracy.
This error should not occur for typical problems. Please send an email to the
developers.
Could not compute grid size for Dispersion
The code is unable to compute a grid size consistent with the desired accuracy.
This error should not occur for typical problems. Please send an email to the
developers.
Could not create 3d FFT plan
The FFT setup for the PPPM solver failed, typically due to lack of memory. This
is an unusual error. Check the size of the FFT grid you are requesting.
Could not create 3d grid of processors
The specified constraints did not allow a Px by Py by Pz grid to be created
where Px * Py * Pz = P = total number of processors.
Could not create 3d remap plan
The FFT setup in pppm failed.
Could not create Python function arguments
This is an internal Python error, possibly because the number of inputs to the
function is too large.
Could not create numa grid of processors
The specified constraints did not allow this style of grid to be created. Usually
this is because the total processor count is not a multiple of the cores/node or
the user specified processor count is > 1 in one of the dimensions.
Could not create twolevel 3d grid of processors
The specified constraints did not allow this style of grid to be created.
Could not evaluate Python function input variable
Self-explanatory.
Could not find Python function
The provided Python code was run successfully, but it not define a callable
function with the required name.
Could not find atom_modify first group ID
Self-explanatory.
Could not find change_box group ID
Group ID used in the change_box command does not exist.
Could not find compute ID for PRD
Self-explanatory.
Could not find compute ID for TAD
Self-explanatory.
Could not find compute ID for temperature bias
Self-explanatory.
Could not find compute ID to delete
Self-explanatory.
Could not find compute displace/atom fix ID
273

LAMMPS Users Manual
Self-explanatory.
Could not find compute event/displace fix ID
Self-explanatory.
Could not find compute group ID
Self-explanatory.
Could not find compute heat/flux compute ID
Self-explanatory.
Could not find compute msd fix ID
Self-explanatory.
Could not find compute msd/chunk fix ID
The compute creates an internal fix, which has been deleted.
Could not find compute pressure temperature ID
The compute ID for calculating temperature does not exist.
Could not find compute stress/atom temperature ID
Self-explanatory.
Could not find compute vacf fix ID
Self-explanatory.
Could not find compute/voronoi surface group ID
Self-explanatory.
Could not find compute_modify ID
Self-explanatory.
Could not find custom per-atom property ID
Self-explanatory.
Could not find delete_atoms group ID
Group ID used in the delete_atoms command does not exist.
Could not find delete_atoms region ID
Region ID used in the delete_atoms command does not exist.
Could not find displace_atoms group ID
Group ID used in the displace_atoms command does not exist.
Could not find dump custom compute ID
Self-explanatory.
Could not find dump custom fix ID
Self-explanatory.
Could not find dump custom variable name
Self-explanatory.
Could not find dump group ID
A group ID used in the dump command does not exist.
Could not find dump local compute ID
Self-explanatory.
Could not find dump local fix ID
Self-explanatory.
Could not find dump modify compute ID
Self-explanatory.
Could not find dump modify custom atom floating point property ID
Self-explanatory.
Could not find dump modify custom atom integer property ID
Self-explanatory.
Could not find dump modify fix ID
Self-explanatory.
Could not find dump modify variable name
Self-explanatory.
274

LAMMPS Users Manual
Could not find fix ID to delete
Self-explanatory.
Could not find fix adapt storage fix ID
This should not happen unless you explicitly deleted a secondary fix that fix
Could not find fix gcmc exclusion group ID
Self-explanatory.
Could not find fix gcmc rotation group ID
Self-explanatory.
Could not find fix group ID
A group ID used in the fix command does not exist.
Could not find fix msst compute ID
Self-explanatory.
Could not find fix poems group ID
A group ID used in the fix poems command does not exist.
Could not find fix recenter group ID
A group ID used in the fix recenter command does not exist.
Could not find fix rigid group ID
A group ID used in the fix rigid command does not exist.
Could not find fix srd group ID
Self-explanatory.
Could not find fix_modify ID
A fix ID used in the fix_modify command does not exist.
Could not find fix_modify pressure ID
The compute ID for computing pressure does not exist.
Could not find fix_modify temperature ID
The compute ID for computing temperature does not exist.
Could not find group clear group ID
Self-explanatory.
Could not find group delete group ID
Self-explanatory.
Could not find pair fix ID
A fix is created internally by the pair style to store shear history information.
You cannot delete it.
Could not find set group ID
Group ID specified in set command does not exist.
Could not find specified fix gcmc group ID
Self-explanatory.
Could not find thermo compute ID
Compute ID specified in thermo_style command does not exist.
Could not find thermo custom compute ID
The compute ID needed by thermo style custom to compute a requested
quantity does not exist.
Could not find thermo custom fix ID
The fix ID needed by thermo style custom to compute a requested quantity does
not exist.
Could not find thermo custom variable name
Self-explanatory.
Could not find thermo fix ID
Fix ID specified in thermo_style command does not exist.
Could not find thermo variable name
275

LAMMPS Users Manual
Self-explanatory.
Could not find thermo_modify pressure ID
The compute ID needed by thermo style custom to compute pressure does not
exist.
Could not find thermo_modify temperature ID
The compute ID needed by thermo style custom to compute temperature does
not exist.
Could not find undump ID
A dump ID used in the undump command does not exist.
Could not find velocity group ID
A group ID used in the velocity command does not exist.
Could not find velocity temperature ID
The compute ID needed by the velocity command to compute temperature does
not exist.
Could not find/initialize a specified accelerator device
Could not initialize at least one of the devices specified for the gpu package
Could not grab element entry from EIM potential file
Self-explanatory
Could not grab global entry from EIM potential file
Self-explanatory.
Could not grab pair entry from EIM potential file
Self-explanatory.
Could not initialize embedded Python
The main module in Python was not accessible.
Could not open Python file
The specified file of Python code cannot be opened. Check that the path and
name are correct.
Could not process Python file
The Python code in the specified file was not run successfully by Python,
probably due to errors in the Python code.
Could not process Python string
The Python code in the here string was not run successfully by Python, probably
due to errors in the Python code.
Coulomb PPPMDisp order has been reduced below minorder
The default minimum order is 2. This can be reset by the kspace_modify
minorder command.
Coulomb cut not supported in pair_style buck/long/coul/coul
Must use long-range Coulombic interactions.
Coulomb cut not supported in pair_style lj/long/coul/long
Must use long-range Coulombic interactions.
Coulomb cut not supported in pair_style lj/long/tip4p/long
Must use long-range Coulombic interactions.
Coulomb cutoffs of pair hybrid sub-styles do not match
If using a Kspace solver, all Coulomb cutoffs of long pair styles must be the
same.
Coulombic cut not supported in pair_style lj/long/dipole/long
Must use long-range Coulombic interactions.
Cound not find dump_modify ID
Self-explanatory.
Create_atoms command before simulation box is defined
276

LAMMPS Users Manual
create_box command.
Create_atoms molecule has atom IDs, but system does not
The atom_style id command can be used to force atom IDs to be stored.
Create_atoms molecule must have atom types
The defined molecule does not specify atom types.
Create_atoms molecule must have coordinates
The defined molecule does not specify coordinates.
Create_atoms region ID does not exist
A region ID used in the create_atoms command does not exist.
Create_bonds command before simulation box is defined
Self-explanatory.
Create_bonds command requires no kspace_style be defined
This is so that atom pairs that are already bonded to not appear in the neighbor
list.
Create_bonds command requires special_bonds 1-2 weights be 0.0
This is so that atom pairs that are already bonded to not appear in the neighbor
list.
Create_bonds max distance > neighbor cutoff
Can only create bonds for atom pairs that will be in neighbor list.
Create_bonds requires a pair style be defined
Self-explanatory.
Create_box region ID does not exist
Self-explanatory.
Create_box region does not support a bounding box
Not all regions represent bounded volumes. You cannot use such a region with
the create_box command.
Custom floating point vector for fix store/state does not exist
The command is accessing a vector added by the fix property/atom command,
that does not exist.
Custom integer vector for fix store/state does not exist
The command is accessing a vector added by the fix property/atom command,
that does not exist.
Custom per-atom property ID is not floating point
Self-explanatory.
Custom per-atom property ID is not integer
Self-explanatory.
Cut-offs missing in pair_style lj/long/dipole/long
Self-explanatory.
Cutoffs missing in pair_style buck/long/coul/long
Self-explanatory.
Cutoffs missing in pair_style lj/long/coul/long
Self-explanatory.
Cyclic loop in joint connections
Fix poems cannot (yet) work with coupled bodies whose joints connect the
bodies in a ring (or cycle).
Degenerate lattice primitive vectors
Invalid set of 3 lattice vectors for lattice command.
Delete region ID does not exist
Self-explanatory.
Delete_atoms command before simulation box is defined
277

LAMMPS Users Manual
create_box command.
Delete_atoms cutoff > max neighbor cutoff
Can only delete atoms in atom pairs that will be in neighbor list.
Delete_atoms mol yes requires atom attribute molecule
Cannot use this option with a non-molecular system.
Delete_atoms requires a pair style be defined
This is because atom deletion within a cutoff uses a pairwise neighbor list.
Delete_bonds command before simulation box is defined
create_box command.
Delete_bonds command with no atoms existing
No atoms are yet defined so the delete_bonds command cannot be used.
Deposition region extends outside simulation box
Self-explanatory.
Did not assign all atoms correctly
Atoms read in from a data file were not assigned correctly to processors. This is
likely due to some atom coordinates being outside a non-periodic simulation
box.
Did not assign all restart atoms correctly
Atoms read in from the restart file were not assigned correctly to processors.
This is likely due to some atom coordinates being outside a non-periodic
simulation box. Normally this should not happen. You may wish to use the
"remap" option on the read_restart command to see if this helps.
Did not find all elements in MEAM library file
Did not find fix shake partner info
Could not find bond partners implied by fix shake command. This error can be
triggered if the delete_bonds command was used before fix shake, and it
removed bonds without resetting the 1-2, 1-3, 1-4 weighting list via the special
keyword.
Did not find keyword in table file
Did not set pressure for fix rigid/nph
The press keyword must be specified.
Did not set temp for fix rigid/nvt/small
Self-explanatory.
Did not set temp or press for fix rigid/npt/small
Self-explanatory.
Did not set temperature for fix rigid/nvt
The temp keyword must be specified.
Did not set temperature or pressure for fix rigid/npt
The temp and press keywords must be specified.
Dihedral atom missing in delete_bonds
The delete_bonds command cannot find one or more atoms in a particular
dihedral on a particular processor. The pairwise cutoff is too short or the atoms
are too far apart to make a valid dihedral.
Dihedral atom missing in set command
The set command cannot find one or more atoms in a particular dihedral on a
particular processor. The pairwise cutoff is too short or the atoms are too far
apart to make a valid dihedral.
278

LAMMPS Users Manual
Dihedral atoms %d %d %d %d missing on proc %d at step %ld
One or more of 4 atoms needed to compute a particular dihedral are missing on
this processor. Typically this is because the pairwise cutoff is set too short or
the dihedral has blown apart and an atom is too far away.
Dihedral atoms missing on proc %d at step %ld
One or more of 4 atoms needed to compute a particular dihedral are missing on
this processor. Typically this is because the pairwise cutoff is set too short or
the dihedral has blown apart and an atom is too far away.
Dihedral charmm is incompatible with Pair style
Dihedral style charmm must be used with a pair style charmm in order for the
1-4 epsilon/sigma parameters to be defined.
Dihedral coeff for hybrid has invalid style
Dihedral style hybrid uses another dihedral style as one of its coefficients. The
dihedral style used in the dihedral_coeff command or read from a restart file is
not recognized.
Dihedral coeffs are not set
No dihedral coefficients have been assigned in the data file or via the
dihedral_coeff command.
Dihedral style hybrid cannot have hybrid as an argument
Self-explanatory.
Dihedral style hybrid cannot have none as an argument
Self-explanatory.
Dihedral style hybrid cannot use same dihedral style twice
Self-explanatory.
Dihedral/improper extent > half of periodic box length
This error was detected by the neigh_modify check yes setting. It is an error
because the dihedral atoms are so far apart it is ambiguous how it should be
defined.
Dihedral_coeff command before dihedral_style is defined
Coefficients cannot be set in the data file or via the dihedral_coeff command
until an dihedral_style has been assigned.
Dihedral_coeff command before simulation box is defined
or create_box command.
Dihedral_coeff command when no dihedrals allowed
The chosen atom style does not allow for dihedrals to be defined.
Dihedral_style command when no dihedrals allowed
The chosen atom style does not allow for dihedrals to be defined.
Dihedrals assigned incorrectly
Dihedrals read in from the data file were not assigned correctly to atoms. This
means there is something invalid about the topology definitions.
Dihedrals defined but no dihedral types
The data file header lists dihedrals but no dihedral types.
Dimension command after simulation box is defined
create_box command.
Dispersion PPPMDisp order has been reduced below minorder
The default minimum order is 2. This can be reset by the kspace_modify
minorder command.
Displace_atoms command before simulation box is defined
279

LAMMPS Users Manual
or create_box command.
Distance must be > 0 for compute event/displace
Self-explanatory.
Divide by 0 in influence function
This should not normally occur. It is likely a problem with your model.
Divide by 0 in influence function of pair peri/lps
This should not normally occur. It is likely a problem with your model.
Divide by 0 in variable formula
Self-explanatory.
Domain too large for neighbor bins
The domain has become extremely large so that neighbor bins cannot be used.
Most likely, one or more atoms have been blown out of the simulation box to a
great distance.
Double precision is not supported on this accelerator
Self-explanatory
Dump atom/gz only writes compressed files
The dump atom/gz output file name must have a .gz suffix.
Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu
Self-explanatory.
Dump cfg arguments must start with 'mass type xs ys zs' or 'mass type xsu ysu zsu'
This is a requirement of the CFG output format. See the dump cfg doc page for
more details.
Dump cfg requires one snapshot per file
Use the wildcard "*" character in the filename.
Dump cfg/gz only writes compressed files
The dump cfg/gz output file name must have a .gz suffix.
Dump custom and fix not computed at compatible times
The fix must produce per-atom quantities on timesteps that dump custom needs
them.
Dump custom compute does not calculate per-atom array
Self-explanatory.
Dump custom compute does not calculate per-atom vector
Self-explanatory.
Dump custom compute does not compute per-atom info
Self-explanatory.
Dump custom compute vector is accessed out-of-range
Self-explanatory.
Dump custom fix does not compute per-atom array
Self-explanatory.
Dump custom fix does not compute per-atom info
Self-explanatory.
Dump custom fix does not compute per-atom vector
Self-explanatory.
Dump custom fix vector is accessed out-of-range
Self-explanatory.
Dump custom variable is not atom-style variable
Only atom-style variables generate per-atom quantities, needed for dump
output.
Dump custom/gz only writes compressed files
The dump custom/gz output file name must have a .gz suffix.
280

LAMMPS Users Manual
Dump dcd of non-matching # of atoms
Every snapshot written by dump dcd must contain the same # of atoms.
Dump dcd requires sorting by atom ID
Use the dump_modify sort command to enable this.
Dump every variable returned a bad timestep
The variable must return a timestep greater than the current timestep.
Dump file MPI-IO output not allowed with % in filename
This is because a % signifies one file per processor and MPI-IO creates one
large file for all processors.
Dump file does not contain requested snapshot
Self-explanatory.
Dump file is incorrectly formatted
Self-explanatory.
Dump image body yes requires atom style body
Self-explanatory.
Dump image bond not allowed with no bond types
Self-explanatory.
Dump image cannot perform sorting
Self-explanatory.
Dump image line requires atom style line
Self-explanatory.
Dump image persp option is not yet supported
Self-explanatory.
Dump image requires one snapshot per file
Use a "*" in the filename.
Dump image tri requires atom style tri
Self-explanatory.
Dump local and fix not computed at compatible times
The fix must produce per-atom quantities on timesteps that dump local needs
them.
Dump local attributes contain no compute or fix
Self-explanatory.
Dump local cannot sort by atom ID
This is because dump local does not really dump per-atom info.
Dump local compute does not calculate local array
Self-explanatory.
Dump local compute does not calculate local vector
Self-explanatory.
Dump local compute does not compute local info
Self-explanatory.
Dump local compute vector is accessed out-of-range
Self-explanatory.
Dump local count is not consistent across input fields
Every column of output must be the same length.
Dump local fix does not compute local array
Self-explanatory.
Dump local fix does not compute local info
Self-explanatory.
Dump local fix does not compute local vector
Self-explanatory.
Dump local fix vector is accessed out-of-range
281

LAMMPS Users Manual
Self-explanatory.
Dump modify bcolor not allowed with no bond types
Self-explanatory.
Dump modify bdiam not allowed with no bond types
Self-explanatory.
Dump modify compute ID does not compute per-atom array
Self-explanatory.
Dump modify compute ID does not compute per-atom info
Self-explanatory.
Dump modify compute ID does not compute per-atom vector
Self-explanatory.
Dump modify compute ID vector is not large enough
Self-explanatory.
Dump modify element names do not match atom types
Number of element names must equal number of atom types.
Dump modify fix ID does not compute per-atom array
Self-explanatory.
Dump modify fix ID does not compute per-atom info
Self-explanatory.
Dump modify fix ID does not compute per-atom vector
Self-explanatory.
Dump modify fix ID vector is not large enough
Self-explanatory.
Dump modify variable is not atom-style variable
Self-explanatory.
Dump sort column is invalid
Self-explanatory.
Dump xtc requires sorting by atom ID
Use the dump_modify sort command to enable this.
Dump xyz/gz only writes compressed files
The dump xyz/gz output file name must have a .gz suffix.
Dump_modify buffer yes not allowed for this style
Self-explanatory.
Dump_modify format string is too short
There are more fields to be dumped in a line of output than your format string
specifies.
Dump_modify region ID does not exist
Self-explanatory.
Dumping an atom property that isn't allocated
The chosen atom style does not define the per-atom quantity being dumped.
Duplicate atom IDs exist
Self-explanatory.
Self-explanatory.
Duplicate particle in PeriDynamic bond - simulation box is too small
This is likely because your box length is shorter than 2 times the bond length.
Electronic temperature dropped below zero
Something has gone wrong with the fix ttm electron temperature model.
Element not defined in potential file
The specified element is not in the potential file.
Empty brackets in variable
282

LAMMPS Users Manual
There is no variable syntax that uses empty brackets. Check the variable doc
page.
Energy was not tallied on needed timestep
You are using a thermo keyword that requires potentials to have tallied energy,
but they didn't on this timestep. See the variable doc page for ideas on how to
make this work.
Epsilon or sigma reference not set by pair style in PPPMDisp
Self-explanatory.
Epsilon or sigma reference not set by pair style in ewald/n
The pair style is not providing the needed epsilon or sigma values.
A pre-tabulated spline is invalid. Likely a problem with the potential
parameters.
Error writing averaged chunk data
Something in the output to the file triggered an error.
Something in the output to the file triggered an error.
Error writing out correlation data
Something in the output to the file triggered an error.
Error writing out histogram data
Something in the output to the file triggered an error.
Error writing out time averaged data
Something in the output to the file triggered an error.
Failed to allocate %ld bytes for array %s
Your LAMMPS simulation has run out of memory. You need to run a smaller
simulation or on more processors.
Failed to open FFmpeg pipeline to file %s
The specified file cannot be opened. Check that the path and name are correct
and writable and that the FFmpeg executable can be found and run.
Failed to reallocate %ld bytes for array %s
Your LAMMPS simulation has run out of memory. You need to run a smaller
simulation or on more processors.
Fewer SRD bins than processors in some dimension
This is not allowed. Make your SRD bin size smaller.
File variable could not read value
Check the file assigned to the variable.
Final box dimension due to fix deform is < 0.0
Self-explanatory.
Fix %s does not allow use of dynamic group
Dynamic groups have not yet been enabled for this fix.
Fix ID for compute chunk/atom does not exist
Self-explanatory.
Fix ID for compute erotate/rigid does not exist
Self-explanatory.
Fix ID for compute ke/rigid does not exist
Self-explanatory.
Fix ID for compute reduce does not exist
Self-explanatory.
Fix ID for compute slice does not exist
Self-explanatory.
Fix ID for fix ave/atom does not exist
283

LAMMPS Users Manual
Self-explanatory.
Fix ID for fix ave/chunk does not exist
Self-explanatory.
Fix ID for fix ave/correlate does not exist
Self-explanatory.
Fix ID for fix ave/histo does not exist
Self-explanatory.
Fix ID for fix ave/spatial does not exist
Self-explanatory.
Fix ID for fix ave/time does not exist
Self-explanatory.
Fix ID for fix store/state does not exist
Self-explanatory
Fix ID for fix vector does not exist
Self-explanatory.
Fix ID for read_data does not exist
Self-explanatory.
Fix ID for velocity does not exist
Self-explanatory.
Fix ID must be alphanumeric or underscore characters
Self-explanatory.
Something has gone wrong in your SRD model; try using more conservative
settings.
Fix SRD: bad search bin assignment
Something has gone wrong in your SRD model; try using more conservative
settings.
Fix SRD: bad stencil bin for big particle
Something has gone wrong in your SRD model; try using more conservative
settings.
Fix SRD: too many big particles in bin
Reset the ATOMPERBIN parameter at the top of fix_srd.cpp to a larger value,
and re-compile the code.
Fix SRD: too many walls in bin
This should not happen unless your system has been setup incorrectly.
Fix adapt interface to this pair style not supported
New coding for the pair style would need to be done.
Fix adapt kspace style does not exist
Self-explanatory.
Fix adapt pair style does not exist
Self-explanatory
Fix adapt pair style param not supported
The pair style does not know about the parameter you specified.
Fix adapt requires atom attribute charge
The atom style being used does not specify an atom charge.
Fix adapt requires atom attribute diameter
The atom style being used does not specify an atom diameter.
Fix adapt type pair range is not valid for pair hybrid sub-style
Self-explanatory.
Fix append/atoms requires a lattice be defined
Use the lattice command for this purpose.
284

LAMMPS Users Manual
Fix ave/atom compute array is accessed out-of-range
Self-explanatory.
Fix ave/atom compute does not calculate a per-atom array
Self-explanatory.
Fix ave/atom compute does not calculate a per-atom vector
A compute used by fix ave/atom must generate per-atom values.
Fix ave/atom compute does not calculate per-atom values
A compute used by fix ave/atom must generate per-atom values.
Fix ave/atom fix array is accessed out-of-range
Self-explanatory.
Fix ave/atom fix does not calculate a per-atom array
Self-explanatory.
Fix ave/atom fix does not calculate a per-atom vector
A fix used by fix ave/atom must generate per-atom values.
Fix ave/atom fix does not calculate per-atom values
A fix used by fix ave/atom must generate per-atom values.
Fix ave/atom variable is not atom-style variable
A variable used by fix ave/atom must generate per-atom values.
Fix ave/chunk compute does not calculate a per-atom array
Self-explanatory.
Fix ave/chunk compute does not calculate a per-atom vector
Self-explanatory.
Fix ave/chunk compute does not calculate per-atom values
Self-explanatory.
Fix ave/chunk compute vector is accessed out-of-range
Self-explanatory.
Fix ave/chunk does not use chunk/atom compute
The specified compute is not for a compute chunk/atom command.
Fix ave/chunk fix does not calculate a per-atom array
Self-explanatory.
Fix ave/chunk fix does not calculate a per-atom vector
Self-explanatory.
Fix ave/chunk fix does not calculate per-atom values
Self-explanatory.
Fix ave/chunk fix vector is accessed out-of-range
Self-explanatory.
Fix ave/chunk variable is not atom-style variable
Self-explanatory.
Fix ave/correlate compute does not calculate a scalar
Self-explanatory.
Fix ave/correlate compute does not calculate a vector
Self-explanatory.
Fix ave/correlate compute vector is accessed out-of-range
The index for the vector is out of bounds.
Fix ave/correlate fix does not calculate a scalar
Self-explanatory.
Fix ave/correlate fix does not calculate a vector
Self-explanatory.
Fix ave/correlate fix vector is accessed out-of-range
The index for the vector is out of bounds.
Fix ave/correlate variable is not equal-style variable
285

LAMMPS Users Manual
Self-explanatory.
Fix ave/histo cannot input local values in scalar mode
Self-explanatory.
Fix ave/histo cannot input per-atom values in scalar mode
Self-explanatory.
Fix ave/histo compute array is accessed out-of-range
Self-explanatory.
Fix ave/histo compute does not calculate a global array
Self-explanatory.
Fix ave/histo compute does not calculate a global scalar
Self-explanatory.
Fix ave/histo compute does not calculate a global vector
Self-explanatory.
Fix ave/histo compute does not calculate a local array
Self-explanatory.
Fix ave/histo compute does not calculate a local vector
Self-explanatory.
Fix ave/histo compute does not calculate a per-atom array
Self-explanatory.
Fix ave/histo compute does not calculate a per-atom vector
Self-explanatory.
Fix ave/histo compute does not calculate local values
Self-explanatory.
Fix ave/histo compute does not calculate per-atom values
Self-explanatory.
Fix ave/histo compute vector is accessed out-of-range
Self-explanatory.
Fix ave/histo fix array is accessed out-of-range
Self-explanatory.
Fix ave/histo fix does not calculate a global array
Self-explanatory.
Fix ave/histo fix does not calculate a global scalar
Self-explanatory.
Fix ave/histo fix does not calculate a global vector
Self-explanatory.
Fix ave/histo fix does not calculate a local array
Self-explanatory.
Fix ave/histo fix does not calculate a local vector
Self-explanatory.
Fix ave/histo fix does not calculate a per-atom array
Self-explanatory.
Fix ave/histo fix does not calculate a per-atom vector
Self-explanatory.
Fix ave/histo fix does not calculate local values
Self-explanatory.
Fix ave/histo fix does not calculate per-atom values
Self-explanatory.
Fix ave/histo fix vector is accessed out-of-range
Self-explanatory.
Fix ave/histo input is invalid compute
Self-explanatory.
286

LAMMPS Users Manual
Fix ave/histo input is invalid fix
Self-explanatory.
Fix ave/histo input is invalid variable
Self-explanatory.
Fix ave/histo inputs are not all global, peratom, or local
All inputs in a single fix ave/histo command must be of the same style.
Fix ave/histo/weight value and weight vector lengths do not match
Self-explanatory.
Fix ave/spatial compute does not calculate a per-atom array
Self-explanatory.
Fix ave/spatial compute does not calculate a per-atom vector
A compute used by fix ave/spatial must generate per-atom values.
Fix ave/spatial compute does not calculate per-atom values
A compute used by fix ave/spatial must generate per-atom values.
Fix ave/spatial compute vector is accessed out-of-range
The index for the vector is out of bounds.
Fix ave/spatial fix does not calculate a per-atom array
Self-explanatory.
Fix ave/spatial fix does not calculate a per-atom vector
A fix used by fix ave/spatial must generate per-atom values.
Fix ave/spatial fix does not calculate per-atom values
A fix used by fix ave/spatial must generate per-atom values.
Fix ave/spatial fix vector is accessed out-of-range
The index for the vector is out of bounds.
Fix ave/spatial for triclinic boxes requires units reduced
Self-explanatory.
Fix ave/spatial settings invalid with changing box size
If the box size changes, only the units reduced option can be used.
Fix ave/spatial variable is not atom-style variable
A variable used by fix ave/spatial must generate per-atom values.
Fix ave/time cannot set output array intensive/extensive from these inputs
One of more of the vector inputs has individual elements which are flagged as
intensive or extensive. Such an input cannot be flagged as all
intensive/extensive when turned into an array by fix ave/time.
Fix ave/time cannot use variable with vector mode
Variables produce scalar values.
Fix ave/time columns are inconsistent lengths
Self-explanatory.
Fix ave/time compute array is accessed out-of-range
An index for the array is out of bounds.
Fix ave/time compute does not calculate a scalar
Self-explanatory.
Fix ave/time compute does not calculate a vector
Self-explanatory.
Fix ave/time compute does not calculate an array
Self-explanatory.
Fix ave/time compute vector is accessed out-of-range
The index for the vector is out of bounds.
Fix ave/time fix array cannot be variable length
Self-explanatory.
Fix ave/time fix array is accessed out-of-range
287

LAMMPS Users Manual
An index for the array is out of bounds.
Fix ave/time fix does not calculate a scalar
Self-explanatory.
Fix ave/time fix does not calculate a vector
Self-explanatory.
Fix ave/time fix does not calculate an array
Self-explanatory.
Fix ave/time fix vector cannot be variable length
Self-explanatory.
Fix ave/time fix vector is accessed out-of-range
The index for the vector is out of bounds.
Fix ave/time variable is not equal-style variable
Self-explanatory.
Fix balance rcb cannot be used with comm_style brick
Comm_style tiled must be used instead.
Fix balance shift string is invalid
The string can only contain the characters "x", "y", or "z".
Fix bond/break needs ghost atoms from further away
This is because the fix needs to walk bonds to a certain distance to acquire
needed info, The comm_modify cutoff command can be used to extend the
communication range.
Fix bond/create angle type is invalid
Self-explanatory.
Fix bond/create cutoff is longer than pairwise cutoff
This is not allowed because bond creation is done using the pairwise neighbor
list.
Fix bond/create dihedral type is invalid
Self-explanatory.
Fix bond/create improper type is invalid
Self-explanatory.
Fix bond/create induced too many angles/dihedrals/impropers per atom
See the read_data command for info on using the "extra/angle/per/atom", (or
dihedral, improper) keywords to allow for additional angles, dihedrals, and
impropers to be formed.
Fix bond/create needs ghost atoms from further away
This is because the fix needs to walk bonds to a certain distance to acquire
needed info, The comm_modify cutoff command can be used to extend the
communication range.
Fix bond/swap cannot use dihedral or improper styles
These styles cannot be defined when using this fix.
Fix bond/swap requires pair and bond styles
Self-explanatory.
Fix bond/swap requires special_bonds = 0,1,1
Self-explanatory.
Fix box/relax generated negative box length
The pressure being applied is likely too large. Try applying it incrementally, to
build to the high pressure.
Fix command before simulation box is defined
create_box command.
Fix deform cannot use yz variable with xy
288

LAMMPS Users Manual

Fix

Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix

The yz setting cannot be a variable if xy deformation is also specified. This is
because LAMMPS cannot determine if the yz setting will induce a box flip which
would be invalid if xy is also changing.
deform is changing yz too much with xy
When both yz and xy are changing, it induces changes in xz if the box must flip
from one tilt extreme to another. Thus it is not allowed for yz to grow so much
that a flip is induced.
deform tilt factors require triclinic box
Cannot deform the tilt factors of a simulation box unless it is a triclinic
(non-orthogonal) box.
deform volume setting is invalid
Cannot use volume style unless other dimensions are being controlled.
deposit and fix rigid/small not using same molecule template ID
Self-explanatory.
deposit and fix shake not using same molecule template ID
Self-explanatory.
deposit molecule must have atom types
The defined molecule does not specify atom types.
deposit molecule must have coordinates
The defined molecule does not specify coordinates.
deposit molecule template ID must be same as atom_style template ID
When using atom_style template, you cannot deposit molecules that are not in
that template.
deposit region cannot be dynamic
Only static regions can be used with fix deposit.
deposit region does not support a bounding box
Not all regions represent bounded volumes. You cannot use such a region with
the fix deposit command.
deposit shake fix does not exist
Self-explanatory.
efield requires atom attribute q or mu
The atom style defined does not have this attribute.
efield with dipoles cannot use atom-style variables
This option is not supported.
evaporate molecule requires atom attribute molecule
The atom style being used does not define a molecule ID.
external callback function not set
This must be done by an external program in order to use this fix.
for fix ave/atom not computed at compatible time
Fixes generate their values on specific timesteps. Fix ave/atom is requesting a
value on a non-allowed timestep.
for fix ave/chunk not computed at compatible time
Fixes generate their values on specific timesteps. Fix ave/chunk is requesting a
value on a non-allowed timestep.
for fix ave/correlate not computed at compatible time
Fixes generate their values on specific timesteps. Fix ave/correlate is
requesting a value on a non-allowed timestep.
for fix ave/histo not computed at compatible time
Fixes generate their values on specific timesteps. Fix ave/histo is requesting a
value on a non-allowed timestep.
for fix ave/spatial not computed at compatible time
289

LAMMPS Users Manual

Fix
Fix
Fix
Fix
Fix
Fix
Fix

Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix
Fix

Fixes generate their values on specific timesteps. Fix ave/spatial is requesting a
value on a non-allowed timestep.
for fix ave/time not computed at compatible time
Fixes generate their values on specific timesteps. Fix ave/time is requesting a
value on a non-allowed timestep.
for fix store/state not computed at compatible time
Fixes generate their values on specific timesteps. Fix store/state is requesting a
value on a non-allowed timestep.
for fix vector not computed at compatible time
Fixes generate their values on specific timesteps. Fix vector is requesting a
value on a non-allowed timestep.
freeze requires atom attribute torque
The atom style defined does not have this attribute.
gcmc and fix shake not using same molecule template ID
Self-explanatory.
gcmc atom has charge, but atom style does not
Self-explanatory.
gcmc cannot exchange individual atoms belonging to a molecule
This is an error since you should not delete only one atom of a molecule. The
user has specified atomic (non-molecular) gas exchanges, but an atom
belonging to a molecule could be deleted.
gcmc does not (yet) work with atom_style template
Self-explanatory.
gcmc molecule command requires that atoms have molecule attributes
Should not choose the gcmc molecule feature if no molecules are being
simulated. The general molecule flag is off, but gcmc's molecule flag is on.
gcmc molecule has charges, but atom style does not
Self-explanatory.
gcmc molecule must have atom types
The defined molecule does not specify atom types.
gcmc molecule must have coordinates
The defined molecule does not specify coordinates.
gcmc molecule template ID must be same as atom_style template ID
When using atom_style template, you cannot insert molecules that are not in
that template.
gcmc put atom outside box
This should not normally happen. Contact the developers.
gcmc ran out of available atom IDs
See the setting for tagint in the src/lmptype.h file.
gcmc ran out of available molecule IDs
See the setting for tagint in the src/lmptype.h file.
gcmc region cannot be dynamic
Only static regions can be used with fix gcmc.
gcmc region does not support a bounding box
Not all regions represent bounded volumes. You cannot use such a region with
the fix gcmc command.
gcmc region extends outside simulation box
Self-explanatory.
gcmc shake fix does not exist
Self-explanatory.
gld c coefficients must be >= 0
290

LAMMPS Users Manual
Self-explanatory.
Fix gld needs more prony series coefficients
Self-explanatory.
Fix gld prony terms must be > 0
Self-explanatory.
Fix gld series type must be pprony for now
Self-explanatory.
Fix gld start temperature must be >= 0
Self-explanatory.
Fix gld stop temperature must be >= 0
Self-explanatory.
Fix gld tau coefficients must be > 0
Self-explanatory.
Fix heat group has no atoms
Self-explanatory.
Fix heat kinetic energy of an atom went negative
This will cause the velocity rescaling about to be performed by fix heat to be
invalid.
Fix heat kinetic energy went negative
This will cause the velocity rescaling about to be performed by fix heat to be
invalid.
Fix in variable not computed at compatible time
Fixes generate their values on specific timesteps. The variable is requesting the
values on a non-allowed timestep.
Fix langevin angmom is not yet implemented with kokkos
This option is not yet available.
Fix langevin angmom requires atom style ellipsoid
Self-explanatory.
Fix langevin angmom requires extended particles
This fix option cannot be used with point particles.
Fix langevin omega is not yet implemented with kokkos
This option is not yet available.
Fix langevin omega requires atom style sphere
Self-explanatory.
Fix langevin omega requires extended particles
One of the particles has radius 0.0.
Fix langevin period must be > 0.0
The time window for temperature relaxation must be > 0
Fix langevin variable returned negative temperature
Self-explanatory.
Fix momentum group has no atoms
Self-explanatory.
Fix move cannot define z or vz variable for 2d problem
Self-explanatory.
Fix move cannot rotate aroung non z-axis for 2d problem
Self-explanatory.
Fix move cannot set linear z motion for 2d problem
Self-explanatory.
Fix move cannot set wiggle z motion for 2d problem
Self-explanatory.
Fix msst compute ID does not compute potential energy
291

LAMMPS Users Manual
Self-explanatory.
Fix msst compute ID does not compute pressure
Self-explanatory.
Fix msst compute ID does not compute temperature
Self-explanatory.
Fix msst requires a periodic box
Self-explanatory.
Fix msst tscale must satisfy 0 <= tscale < 1
Self-explanatory.
Fix npt/nph has tilted box too far in one step - periodic cell is too far from equilibrium
state
Self-explanatory. The change in the box tilt is too extreme on a short timescale.
Fix nve/asphere requires extended particles
This fix can only be used for particles with a shape setting.
Fix nve/asphere/noforce requires atom style ellipsoid
Self-explanatory.
Fix nve/asphere/noforce requires extended particles
One of the particles is not an ellipsoid.
Fix nve/body requires atom style body
Self-explanatory.
Fix nve/body requires bodies
This fix can only be used for particles that are bodies.
Fix nve/line can only be used for 2d simulations
Self-explanatory.
Fix nve/line requires atom style line
Self-explanatory.
Fix nve/line requires line particles
Self-explanatory.
Fix nve/sphere dipole requires atom attribute mu
An atom style with this attribute is needed.
Fix nve/sphere requires atom style sphere
Self-explanatory.
Fix nve/sphere requires extended particles
This fix can only be used for particles of a finite size.
Fix nve/tri can only be used for 3d simulations
Self-explanatory.
Fix nve/tri requires atom style tri
Self-explanatory.
Fix nve/tri requires tri particles
Self-explanatory.
Fix nvt/nph/npt asphere requires extended particles
The shape setting for a particle in the fix group has shape = 0.0, which means it
is a point particle.
Fix nvt/nph/npt body requires bodies
Self-explanatory.
Fix nvt/nph/npt sphere requires atom style sphere
Self-explanatory.
Fix nvt/npt/nph damping parameters must be > 0.0
Self-explanatory.
Fix nvt/npt/nph dilate group ID does not exist
Self-explanatory.
292

LAMMPS Users Manual
Fix nvt/sphere requires extended particles
This fix can only be used for particles of a finite size.
Fix orient/fcc file open failed
The fix orient/fcc command could not open a specified file.
The fix orient/fcc command could not read the needed parameters from a
specified file.
Fix orient/fcc found self twice
The neighbor lists used by fix orient/fcc are messed up. If this error occurs, it is
likely a bug, so send an email to the developers.
Fix peri neigh does not exist
Somehow a fix that the pair style defines has been deleted.
Fix pour and fix rigid/small not using same molecule template ID
Self-explanatory.
Fix pour and fix shake not using same molecule template ID
Self-explanatory.
Fix pour insertion count per timestep is 0
Self-explanatory.
Fix pour molecule must have atom types
The defined molecule does not specify atom types.
Fix pour molecule must have coordinates
The defined molecule does not specify coordinates.
Fix pour molecule template ID must be same as atom style template ID
When using atom_style template, you cannot pour molecules that are not in that
template.
Fix pour polydisperse fractions do not sum to 1.0
Self-explanatory.
Fix pour region ID does not exist
Self-explanatory.
Fix pour region cannot be dynamic
Only static regions can be used with fix pour.
Fix pour region does not support a bounding box
Not all regions represent bounded volumes. You cannot use such a region with
the fix pour command.
Fix pour requires atom attributes radius, rmass
The atom style defined does not have these attributes.
Fix pour rigid fix does not exist
Self-explanatory.
Fix pour shake fix does not exist
Self-explanatory.
Fix press/berendsen damping parameters must be > 0.0
Self-explanatory.
Fix property/atom cannot specify mol twice
Self-explanatory.
Fix property/atom cannot specify q twice
Self-explanatory.
Fix property/atom mol when atom_style already has molecule attribute
Self-explanatory.
Fix property/atom q when atom_style already has charge attribute
Self-explanatory.
Fix property/atom vector name already exists
293

LAMMPS Users Manual
The name for an integer or floating-point vector must be unique.
Fix qeq has negative upper Taper radius cutoff
Self-explanatory.
Fix qeq/comb group has no atoms
Self-explanatory.
Fix qeq/comb requires atom attribute q
An atom style with charge must be used to perform charge equilibration.
Fix qeq/dynamic group has no atoms
Self-explanatory.
Fix qeq/dynamic requires atom attribute q
Self-explanatory.
Fix qeq/fire group has no atoms
Self-explanatory.
Fix qeq/fire requires atom attribute q
Self-explanatory.
Fix qeq/point group has no atoms
Self-explanatory.
Fix qeq/point has insufficient QEq matrix size
Occurs when number of neighbor atoms for an atom increased too much during
a run. Increase SAFE_ZONE and MIN_CAP in fix_qeq.h and recompile.
Fix qeq/point requires atom attribute q
Self-explanatory.
Fix qeq/shielded group has no atoms
Self-explanatory.
Fix qeq/shielded has insufficient QEq matrix size
Occurs when number of neighbor atoms for an atom increased too much during
a run. Increase SAFE_ZONE and MIN_CAP in fix_qeq.h and recompile.
Fix qeq/shielded requires atom attribute q
Self-explanatory.
Fix qeq/slater could not extract params from pair coul/streitz
This should not happen unless pair coul/streitz has been altered.
Fix qeq/slater group has no atoms
Self-explanatory.
Fix qeq/slater has insufficient QEq matrix size
Occurs when number of neighbor atoms for an atom increased too much during
a run. Increase SAFE_ZONE and MIN_CAP in fix_qeq.h and recompile.
Fix qeq/slater requires atom attribute q
Self-explanatory.
Fix reax/bonds numbonds > nsbmax_most
The limit of the number of bonds expected by the ReaxFF force field was
exceeded.
Fix recenter group has no atoms
Self-explanatory.
Fix restrain requires an atom map, see atom_modify
Self-explanatory.
Fix rigid atom has non-zero image flag in a non-periodic dimension
Image flags for non-periodic dimensions should not be set.
Fix rigid file has no lines
Self-explanatory.
Fix rigid langevin period must be > 0.0
Self-explanatory.
294

LAMMPS Users Manual
Fix rigid molecule requires atom attribute molecule
Self-explanatory.
Fix rigid npt/nph dilate group ID does not exist
Self-explanatory.
Fix rigid npt/nph does not yet allow triclinic box
This is a current restriction in LAMMPS.
Fix rigid npt/nph period must be > 0.0
Self-explanatory.
Fix rigid npt/small t_chain should not be less than 1
Self-explanatory.
Fix rigid npt/small t_order must be 3 or 5
Self-explanatory.
Fix rigid nvt/npt/nph damping parameters must be > 0.0
Self-explanatory.
Fix rigid nvt/small t_chain should not be less than 1
Self-explanatory.
Fix rigid nvt/small t_iter should not be less than 1
Self-explanatory.
Fix rigid nvt/small t_order must be 3 or 5
Self-explanatory.
Fix rigid xy torque cannot be on for 2d simulation
Self-explanatory.
Fix rigid z force cannot be on for 2d simulation
Self-explanatory.
Fix rigid/npt period must be > 0.0
Self-explanatory.
Fix rigid/npt temperature order must be 3 or 5
Self-explanatory.
Fix rigid/npt/small period must be > 0.0
Self-explanatory.
Fix rigid/nvt period must be > 0.0
Self-explanatory.
Fix rigid/nvt temperature order must be 3 or 5
Self-explanatory.
Fix rigid/nvt/small period must be > 0.0
Self-explanatory.
Fix rigid/small atom has non-zero image flag in a non-periodic dimension
Image flags for non-periodic dimensions should not be set.
Fix rigid/small langevin period must be > 0.0
Self-explanatory.
Fix rigid/small molecule must have atom types
The defined molecule does not specify atom types.
Fix rigid/small molecule must have coordinates
The defined molecule does not specify coordinates.
Fix rigid/small npt/nph period must be > 0.0
Self-explanatory.
Fix rigid/small nvt/npt/nph damping parameters must be > 0.0
Self-explanatory.
Fix rigid/small nvt/npt/nph dilate group ID does not exist
Self-explanatory.
Fix rigid/small requires an atom map, see atom_modify
295

LAMMPS Users Manual
Self-explanatory.
Fix rigid/small requires atom attribute molecule
Self-explanatory.
The principal moments of inertia computed for a rigid body are not within the
required tolerances.
Fix shake cannot be used with minimization
Cannot use fix shake while doing an energy minimization since it turns off
bonds that should contribute to the energy.
Fix shake molecule template must have shake info
The defined molecule does not specify SHAKE information.
Fix spring couple group ID does not exist
Self-explanatory.
Fix srd can only currently be used with comm_style brick
This is a current restriction in LAMMPS.
Fix srd lamda must be >= 0.6 of SRD grid size
This is a requirement for accuracy reasons.
Fix srd no-slip requires atom attribute torque
This is because the SRD collisions will impart torque to the solute particles.
Fix srd requires SRD particles all have same mass
Self-explanatory.
Fix srd requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Fix srd requires newton pair on
Self-explanatory.
Fix store/state compute array is accessed out-of-range
Self-explanatory.
Fix store/state compute does not calculate a per-atom array
The compute calculates a per-atom vector.
Fix store/state compute does not calculate a per-atom vector
The compute calculates a per-atom vector.
Fix store/state compute does not calculate per-atom values
Computes that calculate global or local quantities cannot be used with fix
store/state.
Fix store/state fix array is accessed out-of-range
Self-explanatory.
Fix store/state fix does not calculate a per-atom array
The fix calculates a per-atom vector.
Fix store/state fix does not calculate a per-atom vector
The fix calculates a per-atom array.
Fix store/state fix does not calculate per-atom values
Fixes that calculate global or local quantities cannot be used with fix
store/state.
Fix store/state for atom property that isn't allocated
Self-explanatory.
Fix store/state variable is not atom-style variable
Only atom-style variables calculate per-atom quantities.
Fix temp/berendsen period must be > 0.0
Self-explanatory.
Fix temp/berendsen variable returned negative temperature
Self-explanatory.
296

LAMMPS Users Manual
Fix temp/csld is not compatible with fix rattle or fix shake
These two commands cannot currently be used together with fix temp/csld.
Fix temp/csld variable returned negative temperature
Self-explanatory.
Fix temp/csvr variable returned negative temperature
Self-explanatory.
Fix temp/rescale variable returned negative temperature
Self-explanatory.
Fix tfmc displacement length must be > 0
Self-explanatory.
Fix tfmc is not compatible with fix shake
These two commands cannot currently be used together.
Fix tfmc temperature must be > 0
Self-explanatory.
Fix thermal/conductivity swap value must be positive
Self-explanatory.
Fix tmd must come after integration fixes
Any fix tmd command must appear in the input script after all time integration
fixes (nve, nvt, npt). See the fix tmd documentation for details.
Fix ttm electron temperatures must be > 0.0
Self-explanatory.
Fix ttm electronic_density must be > 0.0
Self-explanatory.
Fix ttm electronic_specific_heat must be > 0.0
Self-explanatory.
Fix ttm electronic_thermal_conductivity must be >= 0.0
Self-explanatory.
Fix ttm gamma_p must be > 0.0
Self-explanatory.
Fix ttm gamma_s must be >= 0.0
Self-explanatory.
Fix ttm number of nodes must be > 0
Self-explanatory.
Fix ttm v_0 must be >= 0.0
Self-explanatory.
Fix used in compute chunk/atom not computed at compatible time
The chunk/atom compute cannot query the output of the fix on a timestep it is
needed.
Fix used in compute reduce not computed at compatible time
Fixes generate their values on specific timesteps. Compute reduce is requesting
a value on a non-allowed timestep.
Fix used in compute slice not computed at compatible time
Fixes generate their values on specific timesteps. Compute slice is requesting a
value on a non-allowed timestep.
Fix vector cannot set output array intensive/extensive from these inputs
The inputs to the command have conflicting intensive/extensive attributes. You
need to use more than one fix vector command.
Fix vector compute does not calculate a scalar
Self-explanatory.
Fix vector compute does not calculate a vector
Self-explanatory.
297

LAMMPS Users Manual
Fix vector compute vector is accessed out-of-range
Self-explanatory.
Fix vector fix does not calculate a scalar
Self-explanatory.
Fix vector fix does not calculate a vector
Self-explanatory.
Fix vector fix vector is accessed out-of-range
Self-explanatory.
Fix vector variable is not equal-style variable
Self-explanatory.
Fix viscosity swap value must be positive
Self-explanatory.
Fix viscosity vtarget value must be positive
Self-explanatory.
Fix wall cutoff <= 0.0
Self-explanatory.
Fix wall/colloid requires atom style sphere
Self-explanatory.
Fix wall/colloid requires extended particles
One of the particles has radius 0.0.
Fix wall/gran is incompatible with Pair style
Must use a granular pair style to define the parameters needed for this fix.
Fix wall/gran requires atom style sphere
Self-explanatory.
Fix wall/piston command only available at zlo
The face keyword must be zlo.
Fix wall/region colloid requires atom style sphere
Self-explanatory.
Fix wall/region colloid requires extended particles
One of the particles has radius 0.0.
Fix wall/region cutoff <= 0.0
Self-explanatory.
Fix_modify pressure ID does not compute pressure
The compute ID assigned to the fix must compute pressure.
Fix_modify temperature ID does not compute temperature
The compute ID assigned to the fix must compute temperature.
For triclinic deformation, specified target stress must be hydrostatic
Triclinic pressure control is allowed using the tri keyword, but non-hydrostatic
pressure control can not be used in this case.
Found no restart file matching pattern
When using a "*" in the restart file name, no matching file was found.
GPU library not compiled for this accelerator
Self-explanatory.
GPU package does not (yet) work with atom_style template
Self-explanatory.
GPU particle split must be set to 1 for this pair style.
For this pair style, you cannot run part of the force calculation on the host. See
the package command.
GPU split param must be positive for hybrid pair styles
See the package gpu command.
GPUs are requested but Kokkos has not been compiled for CUDA
298

LAMMPS Users Manual
Recompile Kokkos with CUDA support to use GPUs.
Ghost velocity forward comm not yet implemented with Kokkos
This is a current restriction.
Gmask function in equal-style variable formula
Gravity changed since fix pour was created
The gravity vector defined by fix gravity must be static.
Gravity must point in -y to use with fix pour in 2d
Self-explanatory.
Gravity must point in -z to use with fix pour in 3d
Self-explanatory.
Grmask function in equal-style variable formula
Group ID does not exist
A group ID used in the group command does not exist.
Group ID in variable formula does not exist
Self-explanatory.
Group all cannot be made dynamic
This operation is not allowed.
Group command before simulation box is defined
create_box command.
Group dynamic cannot reference itself
Self-explanatory.
Group dynamic parent group cannot be dynamic
Self-explanatory.
Group dynamic parent group does not exist
Self-explanatory.
Group region ID does not exist
A region ID used in the group command does not exist.
If read_dump purges it cannot replace or trim
These operations are not compatible. See the read_dump doc page for details.
Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a command-line
option when running LAMMPS to see the offending line.
Illegal COMB parameter
One or more of the coefficients defined in the potential file is invalid.
Illegal COMB3 parameter
One or more of the coefficients defined in the potential file is invalid.
Illegal Stillinger-Weber parameter
One or more of the coefficients defined in the potential file is invalid.
Illegal Tersoff parameter
One or more of the coefficients defined in the potential file is invalid.
Illegal Vashishta parameter
One or more of the coefficients defined in the potential file is invalid.
Illegal compute voronoi/atom command (occupation and (surface or edges))
Self-explanatory.
Illegal coul/streitz parameter
One or more of the coefficients defined in the potential file is invalid.
Illegal dump_modify sfactor value (must be > 0.0)
299

LAMMPS Users Manual
Self-explanatory.
Illegal dump_modify tfactor value (must be > 0.0)
Self-explanatory.
Illegal fix gcmc gas mass <= 0
The computed mass of the designated gas molecule or atom type was less than
or equal to zero.
Illegal fix tfmc random seed
Seeds can only be nonzero positive integers.
Illegal fix wall/piston velocity
The piston velocity must be positive.
Illegal integrate style
Self-explanatory.
Illegal nb3b/harmonic parameter
One or more of the coefficients defined in the potential file is invalid.
Illegal number of angle table entries
There must be at least 2 table entries.
Illegal number of bond table entries
There must be at least 2 table entries.
Illegal number of pair table entries
There must be at least 2 table entries.
Illegal or unset periodicity in restart
This error should not normally occur unless the restart file is invalid.
Illegal range increment value
The increment must be >= 1.
Illegal simulation box
The lower bound of the simulation box is greater than the upper bound.
Illegal size double vector read requested
This error should not normally occur unless the restart file is invalid.
Illegal size integer vector read requested
This error should not normally occur unless the restart file is invalid.
Illegal size string or corrupt restart
This error should not normally occur unless the restart file is invalid.
Imageint setting in lmptype.h is invalid
Imageint must be as large or larger than smallint.
Imageint setting in lmptype.h is not compatible
Format of imageint stored in restart file is not consistent with LAMMPS version
you are running. See the settings in src/lmptype.h
Improper atom missing in delete_bonds
The delete_bonds command cannot find one or more atoms in a particular
improper on a particular processor. The pairwise cutoff is too short or the
atoms are too far apart to make a valid improper.
Improper atom missing in set command
The set command cannot find one or more atoms in a particular improper on a
particular processor. The pairwise cutoff is too short or the atoms are too far
apart to make a valid improper.
Improper atoms %d %d %d %d missing on proc %d at step %ld
One or more of 4 atoms needed to compute a particular improper are missing
on this processor. Typically this is because the pairwise cutoff is set too short or
the improper has blown apart and an atom is too far away.
Improper atoms missing on proc %d at step %ld
300

LAMMPS Users Manual
One or more of 4 atoms needed to compute a particular improper are missing
on this processor. Typically this is because the pairwise cutoff is set too short or
the improper has blown apart and an atom is too far away.
Improper coeff for hybrid has invalid style
Improper style hybrid uses another improper style as one of its coefficients. The
improper style used in the improper_coeff command or read from a restart file
is not recognized.
Improper coeffs are not set
No improper coefficients have been assigned in the data file or via the
improper_coeff command.
Improper style hybrid cannot have hybrid as an argument
Self-explanatory.
Improper style hybrid cannot have none as an argument
Self-explanatory.
Improper style hybrid cannot use same improper style twice
Self-explanatory.
Improper_coeff command before improper_style is defined
Coefficients cannot be set in the data file or via the improper_coeff command
until an improper_style has been assigned.
Improper_coeff command before simulation box is defined
or create_box command.
Improper_coeff command when no impropers allowed
The chosen atom style does not allow for impropers to be defined.
Improper_style command when no impropers allowed
The chosen atom style does not allow for impropers to be defined.
Impropers assigned incorrectly
Impropers read in from the data file were not assigned correctly to atoms. This
means there is something invalid about the topology definitions.
Impropers defined but no improper types
The data file header lists improper but no improper types.
Incomplete use of variables in create_atoms command
The var and set options must be used together.
Inconsistent iparam/jparam values in fix bond/create command
If itype and jtype are the same, then their maxbond and newtype settings must
also be the same.
Inconsistent line segment in data file
The end points of the line segment are not equal distances from the center point
which is the atom coordinate.
Inconsistent triangle in data file
The centroid of the triangle as defined by the corner points is not the atom
coordinate.
Inconsistent use of finite-size particles by molecule template molecules
Not all of the molecules define a radius for their constituent particles.
Incorrect # of floating-point values in Bodies section of data file
See doc page for body style.
Incorrect # of integer values in Bodies section of data file
See doc page for body style.
Incorrect %s format in data file
A section of the data file being read by fix property/atom does not have the
correct number of values per line.
301

LAMMPS Users Manual
Incorrect SNAP parameter file
The file cannot be parsed correctly, check its internal syntax.
Incorrect args for angle coefficients
Self-explanatory. Check the input script or data file.
Incorrect args for bond coefficients
Self-explanatory. Check the input script or data file.
Incorrect args for dihedral coefficients
Self-explanatory. Check the input script or data file.
Incorrect args for improper coefficients
Self-explanatory. Check the input script or data file.
Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
Incorrect args in pair_style command
Self-explanatory.
Incorrect atom format in data file
Number of values per atom line in the data file is not consistent with the atom
style.
Incorrect atom format in neb file
The number of fields per line is not what expected.
Incorrect bonus data format in data file
See the read_data doc page for a description of how various kinds of bonus data
must be formatted for certain atom styles.
Incorrect boundaries with slab Ewald
Must have periodic x,y dimensions and non-periodic z dimension to use 2d slab
option with Ewald.
Incorrect boundaries with slab EwaldDisp
Must have periodic x,y dimensions and non-periodic z dimension to use 2d slab
option with Ewald.
Incorrect boundaries with slab PPPM
Must have periodic x,y dimensions and non-periodic z dimension to use 2d slab
option with PPPM.
Incorrect boundaries with slab PPPMDisp
Must have periodic x,y dimensions and non-periodic z dimension to use 2d slab
option with pppm/disp.
Incorrect element names in ADP potential file
The element names in the ADP file do not match those requested.
Incorrect element names in EAM potential file
The element names in the EAM file do not match those requested.
Incorrect format in COMB potential file
Incorrect number of words per line in the potential file.
Incorrect format in COMB3 potential file
Incorrect number of words per line in the potential file.
Incorrect format in MEAM potential file
Incorrect number of words per line in the potential file.
Incorrect format in SNAP coefficient file
Incorrect number of words per line in the coefficient file.
Incorrect format in SNAP parameter file
Incorrect number of words per line in the parameter file.
Incorrect format in Stillinger-Weber potential file
Incorrect number of words per line in the potential file.
Incorrect format in TMD target file
302

LAMMPS Users Manual
Format of file read by fix tmd command is incorrect.
Incorrect format in Tersoff potential file
Incorrect number of words per line in the potential file.
Incorrect format in Vashishta potential file
Incorrect number of words per line in the potential file.
Incorrect format in coul/streitz potential file
Incorrect number of words per line in the potential file.
Incorrect format in nb3b/harmonic potential file
Incorrect number of words per line in the potential file.
Incorrect integer value in Bodies section of data file
See doc page for body style.
Incorrect multiplicity arg for dihedral coefficients
Self-explanatory. Check the input script or data file.
Incorrect number of elements in potential file
Self-explanatory.
Incorrect rigid body format in fix rigid file
The number of fields per line is not what expected.
Incorrect rigid body format in fix rigid/small file
The number of fields per line is not what expected.
Incorrect sign arg for dihedral coefficients
Self-explanatory. Check the input script or data file.
Incorrect table format check for element types
Self-explanatory.
Incorrect velocity format in data file
Each atom style defines a format for the Velocity section of the data file. The
Incorrect weight arg for dihedral coefficients
Self-explanatory. Check the input script or data file.
Index between variable brackets must be positive
Self-explanatory.
Indexed per-atom vector in variable formula without atom map
Accessing a value from an atom vector requires the ability to lookup an atom
index, which is provided by an atom map. An atom map does not exist (by
default) for non-molecular problems. Using the atom_modify map command will
force an atom map to be created.
Initial temperatures not all set in fix ttm
Self-explanatory.
Input line quote not followed by whitespace
An end quote must be followed by whitespace.
Insertion region extends outside simulation box
Self-explanatory.
Insufficient Jacobi rotations for POEMS body
Eigensolve for rigid body was not sufficiently accurate.
Insufficient Jacobi rotations for body nparticle
Eigensolve for rigid body was not sufficiently accurate.
Insufficient Jacobi rotations for rigid body
Eigensolve for rigid body was not sufficiently accurate.
Insufficient Jacobi rotations for rigid molecule
Eigensolve for rigid body was not sufficiently accurate.
Insufficient Jacobi rotations for triangle
303

LAMMPS Users Manual
The calculation of the inertia tensor of the triangle failed. This should not
happen if it is a reasonably shaped triangle.
Insufficient memory on accelerator
There is insufficient memory on one of the devices specified for the gpu
package
Internal error in atom_style body
This error should not occur. Contact the developers.
Invalid -reorder N value
Self-explanatory.
Invalid Angles section in molecule file
Self-explanatory.
Invalid Bonds section in molecule file
Self-explanatory.
Invalid Boolean syntax in if command
Self-explanatory.
Invalid Charges section in molecule file
Self-explanatory.
Invalid Coords section in molecule file
Self-explanatory.
Invalid Diameters section in molecule file
Self-explanatory.
Invalid Dihedrals section in molecule file
Self-explanatory.
Invalid Impropers section in molecule file
Self-explanatory.
Invalid Kokkos command-line args
Self-explanatory. See Section 2.7 of the manual for details.
Invalid LAMMPS restart file
The file does not appear to be a LAMMPS restart file since it doesn't contain the
correct magic string at the beginning.
Invalid Masses section in molecule file
Self-explanatory.
Invalid REAX atom type
There is a mis-match between LAMMPS atom types and the elements listed in
the ReaxFF force field file.
Invalid Special Bond Counts section in molecule file
Self-explanatory.
Invalid Types section in molecule file
Self-explanatory.
Invalid angle count in molecule file
Self-explanatory.
Invalid angle table length
Length must be 2 or greater.
Invalid angle type in Angles section of data file
Angle type must be positive integer and within range of specified angle types.
Invalid angle type in Angles section of molecule file
Self-explanatory.
Invalid angle type index for fix shake
Self-explanatory.
Invalid args for non-hybrid pair coefficients
"NULL" is only supported in pair_coeff calls when using pair hybrid
304

LAMMPS Users Manual
Invalid argument to factorial %d
N must be >= 0 and <= 167, otherwise the factorial result is too large.
Invalid atom ID in %s section of data file
An atom in a section of the data file being read by fix property/atom has an
invalid atom ID that is <= 0 or > the maximum existing atom ID.
Invalid atom ID in Angles section of data file
Atom IDs must be positive integers and within range of defined atoms.
Invalid atom ID in Angles section of molecule file
Self-explanatory.
Invalid atom ID in Atoms section of data file
Atom IDs must be positive integers.
Invalid atom ID in Bodies section of data file
Atom IDs must be positive integers and within range of defined atoms.
Invalid atom ID in Bonds section of data file
Atom IDs must be positive integers and within range of defined atoms.
Invalid atom ID in Bonds section of molecule file
Self-explanatory.
Invalid atom ID in Bonus section of data file
Atom IDs must be positive integers and within range of defined atoms.
Invalid atom ID in Dihedrals section of data file
Atom IDs must be positive integers and within range of defined atoms.
Invalid atom ID in Impropers section of data file
Atom IDs must be positive integers and within range of defined atoms.
Invalid atom ID in Velocities section of data file
Atom IDs must be positive integers and within range of defined atoms.
Invalid atom ID in dihedrals section of molecule file
Self-explanatory.
Invalid atom ID in impropers section of molecule file
Self-explanatory.
Invalid atom ID in variable file
Self-explanatory.
Invalid atom IDs in neb file
Invalid atom diameter in molecule file
Diameters must be >= 0.0.
Invalid atom mass for fix shake
Mass specified in fix shake command must be > 0.0.
Invalid atom mass in molecule file
Masses must be > 0.0.
Invalid atom type in Atoms section of data file
Atom types must range from 1 to specified # of types.
Invalid atom type in create_atoms command
The create_box command specified the range of valid atom types. An invalid
type is being requested.
Invalid atom type in create_atoms mol command
The atom types in the defined molecule are added to the value specified in the
create_atoms command, as an offset. The final value for each atom must be
between 1 to N, where N is the number of atom types.
Invalid atom type in fix atom/swap command
The atom type specified in the atom/swap command does not exist.
Invalid atom type in fix bond/create command
305

LAMMPS Users Manual
Self-explanatory.
Invalid atom type in fix deposit command
Self-explanatory.
Invalid atom type in fix deposit mol command
The atom types in the defined molecule are added to the value specified in the
create_atoms command, as an offset. The final value for each atom must be
between 1 to N, where N is the number of atom types.
Invalid atom type in fix gcmc command
The atom type specified in the gcmc command does not exist.
Invalid atom type in fix pour command
Self-explanatory.
Invalid atom type in fix pour mol command
The atom types in the defined molecule are added to the value specified in the
create_atoms command, as an offset. The final value for each atom must be
between 1 to N, where N is the number of atom types.
Invalid atom type in molecule file
Atom types must range from 1 to specified # of types.
Invalid atom type in neighbor exclusion list
Atom types must range from 1 to Ntypes inclusive.
Invalid atom type index for fix shake
Atom types must range from 1 to Ntypes inclusive.
Invalid atom types in pair_write command
Atom types must range from 1 to Ntypes inclusive.
Invalid atom vector in variable formula
The atom vector is not recognized.
Invalid atom_style body command
No body style argument was provided.
Invalid atom_style command
Self-explanatory.
Invalid attribute in dump custom command
Self-explanatory.
Invalid attribute in dump local command
Self-explanatory.
Invalid attribute in dump modify command
Self-explanatory.
Invalid basis setting in create_atoms command
The basis index must be between 1 to N where N is the number of basis atoms
in the lattice. The type index must be between 1 to N where N is the number of
atom types.
Invalid basis setting in fix append/atoms command
The basis index must be between 1 to N where N is the number of basis atoms
in the lattice. The type index must be between 1 to N where N is the number of
atom types.
Invalid bin bounds in compute chunk/atom
The lo/hi values are inconsistent.
Invalid bin bounds in fix ave/spatial
The lo/hi values are inconsistent.
Invalid body nparticle command
Arguments in atom-style command are not correct.
Invalid bond count in molecule file
Self-explanatory.
306

LAMMPS Users Manual
Invalid bond table length
Length must be 2 or greater.
Invalid bond type in Bonds section of data file
Bond type must be positive integer and within range of specified bond types.
Invalid bond type in Bonds section of molecule file
Self-explanatory.
Invalid bond type in create_bonds command
Self-explanatory.
Invalid bond type in fix bond/break command
Self-explanatory.
Invalid bond type in fix bond/create command
Self-explanatory.
Invalid bond type index for fix shake
Self-explanatory. Check the fix shake command in the input script.
Invalid coeffs for this dihedral style
Cannot set class 2 coeffs in data file for this dihedral style.
Invalid color in dump_modify command
The specified color name was not in the list of recognized colors. See the
dump_modify doc page.
Invalid color map min/max values
The min/max values are not consistent with either each other or with values in
the color map.
Invalid command-line argument
One or more command-line arguments is invalid. Check the syntax of the
command you are using to launch LAMMPS.
Invalid compute ID in variable formula
The compute is not recognized.
Invalid create_atoms rotation vector for 2d model
The rotation vector can only have a z component.
Invalid custom OpenCL parameter string.
There are not enough or too many parameters in the custom string for package
GPU.
Invalid cutoff in comm_modify command
Specified cutoff must be >= 0.0.
Invalid cutoffs in pair_write command
Inner cutoff must be larger than 0.0 and less than outer cutoff.
Invalid d1 or d2 value for pair colloid coeff
Neither d1 or d2 can be < 0.
Invalid data file section: Angle Coeffs
Atom style does not allow angles.
Invalid data file section: AngleAngle Coeffs
Atom style does not allow impropers.
Invalid data file section: AngleAngleTorsion Coeffs
Atom style does not allow dihedrals.
Invalid data file section: AngleTorsion Coeffs
Atom style does not allow dihedrals.
Invalid data file section: Angles
Atom style does not allow angles.
Invalid data file section: Bodies
Atom style does not allow bodies.
Invalid data file section: Bond Coeffs
307

LAMMPS Users Manual
Atom style does not allow bonds.
Invalid data file section: BondAngle Coeffs
Atom style does not allow angles.
Invalid data file section: BondBond Coeffs
Atom style does not allow angles.
Invalid data file section: BondBond13 Coeffs
Atom style does not allow dihedrals.
Invalid data file section: Bonds
Atom style does not allow bonds.
Invalid data file section: Dihedral Coeffs
Atom style does not allow dihedrals.
Invalid data file section: Dihedrals
Atom style does not allow dihedrals.
Invalid data file section: Ellipsoids
Atom style does not allow ellipsoids.
Invalid data file section: EndBondTorsion Coeffs
Atom style does not allow dihedrals.
Invalid data file section: Improper Coeffs
Atom style does not allow impropers.
Invalid data file section: Impropers
Atom style does not allow impropers.
Invalid data file section: Lines
Atom style does not allow lines.
Invalid data file section: MiddleBondTorsion Coeffs
Atom style does not allow dihedrals.
Invalid data file section: Triangles
Atom style does not allow triangles.
The value must be between 0 and 1 inclusive.
Invalid density in Atoms section of data file
Density value cannot be <= 0.0.
Invalid density in set command
Density must be > 0.0.
Invalid diameter in set command
Self-explanatory.
Invalid dihedral count in molecule file
Self-explanatory.
Invalid dihedral type in Dihedrals section of data file
Dihedral type must be positive integer and within range of specified dihedral
types.
Invalid dihedral type in dihedrals section of molecule file
Self-explanatory.
Invalid dipole length in set command
Self-explanatory.
Invalid displace_atoms rotate axis for 2d
Axis must be in z direction.
Invalid dump dcd filename
Filenames used with the dump dcd style cannot be binary or compressed or
cause multiple files to be written.
Invalid dump frequency
Dump frequency must be 1 or greater.
308

LAMMPS Users Manual
Invalid dump image element name
The specified element name was not in the standard list of elements. See the
dump_modify doc page.
Invalid dump image filename
The file produced by dump image cannot be binary and must be for a single
processor.
Invalid dump image persp value
Persp value must be >= 0.0.
Invalid dump image theta value
Theta must be between 0.0 and 180.0 inclusive.
Invalid dump image zoom value
Zoom value must be > 0.0.
Invalid dump movie filename
The file produced by dump movie cannot be binary or compressed and must be
a single file for a single processor.
Invalid dump xtc filename
Filenames used with the dump xtc style cannot be binary or compressed or
cause multiple files to be written.
Invalid dump xyz filename
Filenames used with the dump xyz style cannot be binary or cause files to be
written by each processor.
Invalid dump_modify threshold operator
Operator keyword used for threshold specification in not recognized.
Invalid entry in -reorder file
Self-explanatory.
Invalid fix ID in variable formula
The fix is not recognized.
Invalid fix ave/time off column
Self-explanatory.
Invalid fix box/relax command for a 2d simulation
Fix box/relax styles involving the z dimension cannot be used in a 2d simulation.
Invalid fix box/relax command pressure settings
If multiple dimensions are coupled, those dimensions must be specified.
Invalid fix box/relax pressure settings
Settings for coupled dimensions must be the same.
Invalid fix nvt/npt/nph command for a 2d simulation
Cannot control z dimension in a 2d model.
Invalid fix nvt/npt/nph command pressure settings
If multiple dimensions are coupled, those dimensions must be specified.
Invalid fix nvt/npt/nph pressure settings
Settings for coupled dimensions must be the same.
Invalid fix press/berendsen for a 2d simulation
The z component of pressure cannot be controlled for a 2d model.
Invalid fix press/berendsen pressure settings
Settings for coupled dimensions must be the same.
Invalid fix qeq parameter file
Element index > number of atom types.
Invalid fix rigid npt/nph command for a 2d simulation
Cannot control z dimension in a 2d model.
Invalid fix rigid npt/nph command pressure settings
If multiple dimensions are coupled, those dimensions must be specified.
309

LAMMPS Users Manual
Invalid fix rigid/small npt/nph command for a 2d simulation
Cannot control z dimension in a 2d model.
Invalid fix rigid/small npt/nph command pressure settings
If multiple dimensions are coupled, those dimensions must be specified.
Invalid flag in force field section of restart file
Unrecognized entry in restart file.
Invalid flag in header section of restart file
Unrecognized entry in restart file.
Invalid flag in peratom section of restart file
The format of this section of the file is not correct.
Invalid flag in type arrays section of restart file
Unrecognized entry in restart file.
Invalid frequency in temper command
Nevery must be > 0.
Invalid group ID in neigh_modify command
A group ID used in the neigh_modify command does not exist.
Invalid group function in variable formula
Group function is not recognized.
Invalid group in comm_modify command
Self-explanatory.
Invalid image up vector
Up vector cannot be (0,0,0).
Invalid immediate variable
Syntax of immediate value is incorrect.
Invalid improper count in molecule file
Self-explanatory.
Invalid improper type in Impropers section of data file
Improper type must be positive integer and within range of specified improper
types.
Invalid improper type in impropers section of molecule file
Self-explanatory.
Invalid index for non-body particles in compute body/local command
Only indices 1,2,3 can be used for non-body particles.
Invalid index in compute body/local command
Self-explanatory.
Invalid is_active() function in variable formula
Self-explanatory.
Invalid is_available() function in variable formula
Self-explanatory.
Invalid is_defined() function in variable formula
Self-explanatory.
Invalid keyword in angle table parameters
Self-explanatory.
Invalid keyword in bond table parameters
Self-explanatory.
Invalid keyword in compute angle/local command
Self-explanatory.
Invalid keyword in compute bond/local command
Self-explanatory.
Invalid keyword in compute dihedral/local command
Self-explanatory.
310

LAMMPS Users Manual
Invalid keyword in compute improper/local command
Self-explanatory.
Invalid keyword in compute pair/local command
Self-explanatory.
Invalid keyword in compute property/atom command
Self-explanatory.
Invalid keyword in compute property/chunk command
Self-explanatory.
Invalid keyword in compute property/local command
Self-explanatory.
Invalid keyword in dump cfg command
Self-explanatory.
Invalid keyword in pair table parameters
Keyword used in list of table parameters is not recognized.
Invalid length in set command
Self-explanatory.
Invalid mass in set command
Self-explanatory.
Invalid mass line in data file
Self-explanatory.
Invalid mass value
Self-explanatory.
Invalid math function in variable formula
Self-explanatory.
Invalid math/group/special function in variable formula
Self-explanatory.
Invalid option in lattice command for non-custom style
Certain lattice keywords are not supported unless the lattice style is "custom".
Invalid order of forces within respa levels
For respa, ordering of force computations within respa levels must obey certain
rules. E.g. bonds cannot be compute less frequently than angles, pairwise
forces cannot be computed less frequently than kspace, etc.
Invalid pair table cutoff
Cutoffs in pair_coeff command are not valid with read-in pair table.
Invalid pair table length
Length of read-in pair table is invalid
Invalid param file for fix qeq/shielded
Invalid value of gamma.
Invalid param file for fix qeq/slater
Zeta value is 0.0.
Invalid partitions in processors part command
Valid partitions are numbered 1 to N and the sender and receiver cannot be the
same partition.
Invalid python command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a command-line
option when running LAMMPS to see the offending line.
Invalid radius in Atoms section of data file
Invalid random number seed in fix ttm command
Random number seed must be > 0.
311

LAMMPS Users Manual
Invalid random number seed in set command
Random number seed must be > 0.
Invalid replace values in compute reduce
Self-explanatory.
Invalid rigid body ID in fix rigid file
The ID does not match the number of an existing ID of rigid bodies that are
defined by the fix rigid command.
Invalid rigid body ID in fix rigid/small file
The ID does not match the number of an existing ID of rigid bodies that are
defined by the fix rigid/small command.
Invalid run command N value
The number of timesteps must fit in a 32-bit integer. If you want to run for more
steps than this, perform multiple shorter runs.
Invalid run command start/stop value
Self-explanatory.
Invalid run command upto value
Self-explanatory.
Invalid seed for Marsaglia random # generator
The initial seed for this random number generator must be a positive integer
less than or equal to 900 million.
Invalid seed for Park random # generator
The initial seed for this random number generator must be a positive integer.
Invalid shake angle type in molecule file
Self-explanatory.
Invalid shake atom in molecule file
Self-explanatory.
Invalid shake bond type in molecule file
Self-explanatory.
Invalid shake flag in molecule file
Self-explanatory.
Invalid shape in Ellipsoids section of data file
Self-explanatory.
Invalid shape in Triangles section of data file
Two or more of the triangle corners are duplicate points.
Invalid shape in set command
Self-explanatory.
Invalid shear direction for fix wall/gran
Self-explanatory.
Invalid special atom index in molecule file
Self-explanatory.
Invalid special function in variable formula
Self-explanatory.
Invalid style in pair_write command
Self-explanatory. Check the input script.
Invalid syntax in variable formula
Self-explanatory.
Invalid t_event in prd command
Self-explanatory.
The value must be greater than 0.
Invalid template atom in Atoms section of data file
312

LAMMPS Users Manual
The atom indices must be between 1 to N, where N is the number of atoms in
the template molecule the atom belongs to.
Invalid template index in Atoms section of data file
The template indices must be between 1 to N, where N is the number of
molecules in the template.
Invalid thermo keyword in variable formula
The keyword is not recognized.
For 3-body potentials on the GPU, the threads_per_atom setting cannot be
greater than 4 for NVIDIA GPUs.
Invalid timestep reset for fix ave/atom
Resetting the timestep has invalidated the sequence of timesteps this fix needs
to process.
Invalid timestep reset for fix ave/chunk
Resetting the timestep has invalidated the sequence of timesteps this fix needs
to process.
Invalid timestep reset for fix ave/correlate
Resetting the timestep has invalidated the sequence of timesteps this fix needs
to process.
Invalid timestep reset for fix ave/histo
Resetting the timestep has invalidated the sequence of timesteps this fix needs
to process.
Invalid timestep reset for fix ave/spatial
Resetting the timestep has invalidated the sequence of timesteps this fix needs
to process.
Invalid timestep reset for fix ave/time
Resetting the timestep has invalidated the sequence of timesteps this fix needs
to process.
The value must be greater than 0.0.
Invalid type for mass set
Mass command must set a type from 1-N where N is the number of atom types.
Invalid use of library file() function
This function is called thru the library interface. This error should not occur.
Contact the developers if it does.
Invalid value in set command
The value specified for the setting is invalid, likely because it is too small or too
large.
Invalid variable evaluation in variable formula
A variable used in a formula could not be evaluated.
Invalid variable in next command
Self-explanatory.
Invalid variable name
Variable name used in an input script line is invalid.
Invalid variable name in variable formula
Variable name is not recognized.
Invalid variable style in special function next
Only file-style or atomfile-style variables can be used with next().
Invalid variable style with next command
Variable styles equal and world cannot be used in a next command.
Invalid volume in set command
313

LAMMPS Users Manual
Volume must be > 0.0.
Invalid wiggle direction for fix wall/gran
Self-explanatory.
Invoked angle equil angle on angle style none
Self-explanatory.
Invoked angle single on angle style none
Self-explanatory.
Invoked bond equil distance on bond style none
Self-explanatory.
Invoked bond single on bond style none
Self-explanatory.
Invoked pair single on pair style none
A command (e.g. a dump) attempted to invoke the single() function on a pair
style none, which is illegal. You are probably attempting to compute per-atom
quantities with an undefined pair style.
Invoking coulombic in pair style lj/coul requires atom attribute q
The atom style defined does not have this attribute.
Invoking coulombic in pair style lj/long/dipole/long requires atom attribute q
The atom style defined does not have these attributes.
KIM neighbor iterator exceeded range
This should not happen. It likely indicates a bug in the KIM implementation of
the interatomic potential where it is requesting neighbors incorrectly.
KOKKOS package does not yet support comm_style tiled
Self-explanatory.
KOKKOS package requires a kokkos enabled atom_style
Self-explanatory.
KSpace accuracy must be > 0
The kspace accuracy designated in the input must be greater than zero.
KSpace accuracy too large to estimate G vector
Reduce the accuracy request or specify gwald explicitly via the kspace_modify
command.
KSpace accuracy too low
Requested accuracy must be less than 1.0.
KSpace solver requires a pair style
No pair style is defined.
KSpace style does not yet support triclinic geometries
The specified kspace style does not allow for non-orthogonal simulation boxes.
KSpace style has not yet been set
Cannot use kspace_modify command until a kspace style is set.
KSpace style is incompatible with Pair style
Setting a kspace style requires that a pair style with matching long-range
Coulombic or dispersion components be used.
Keyword %s in MEAM parameter file not recognized
Self-explanatory.
Kokkos has been compiled for CUDA but no GPUs are requested
One or more GPUs must be used when Kokkos is compiled for CUDA.
Kspace style does not support compute group/group
Self-explanatory.
Kspace style pppm/disp/tip4p requires newton on
Self-explanatory.
Kspace style pppm/tip4p requires newton on
314

LAMMPS Users Manual
Self-explanatory.
Kspace style requires atom attribute q
The atom style defined does not have these attributes.
Kspace_modify eigtol must be smaller than one
Self-explanatory.
LAMMPS is not built with Python embedded
This is done by including the PYTHON package before LAMMPS is built. This is
required to use python-style variables.
LAMMPS unit_style lj not supported by KIM models
Self-explanatory. Check the input script or data file.
LJ6 off not supported in pair_style buck/long/coul/long
Self-explanatory.
Label wasn't found in input script
Self-explanatory.
Lattice orient vectors are not orthogonal
The three specified lattice orientation vectors must be mutually orthogonal.
Lattice orient vectors are not right-handed
The three specified lattice orientation vectors must create a right-handed
coordinate system such that a1 cross a2 = a3.
Lattice primitive vectors are collinear
The specified lattice primitive vectors do not for a unit cell with non-zero
volume.
Lattice settings are not compatible with 2d simulation
One or more of the specified lattice vectors has a non-zero z component.
Lattice spacings are invalid
Each x,y,z spacing must be > 0.
Lattice style incompatible with simulation dimension
2d simulation can use sq, sq2, or hex lattice. 3d simulation can use sc, bcc, or
fcc lattice.
Log of zero/negative value in variable formula
Self-explanatory.
Lost atoms via balance: original %ld current %ld
This should not occur. Report the problem to the developers.
Lost atoms: original %ld current %ld
Lost atoms are checked for each time thermo output is done. See the
thermo_modify lost command for options. Lost atoms usually indicate bad
dynamics, e.g. atoms have been blown far out of the simulation box, or moved
further than one processor's sub-domain away before reneighboring.
MEAM library error %d
A call to the MEAM Fortran library returned an error.
MPI_LMP_BIGINT and bigint in lmptype.h are not compatible
The size of the MPI datatype does not match the size of a bigint.
MPI_LMP_TAGINT and tagint in lmptype.h are not compatible
The size of the MPI datatype does not match the size of a tagint.
MSM can only currently be used with comm_style brick
This is a current restriction in LAMMPS.
MSM grid is too large
The global MSM grid is larger than OFFSET in one or more dimensions.
OFFSET is currently set to 16384. You likely need to decrease the requested
accuracy.
MSM order must be 4, 6, 8, or 10
315

LAMMPS Users Manual
This is a limitation of the MSM implementation in LAMMPS: the MSM order can
only be 4, 6, 8, or 10.
Mass command before simulation box is defined
create_box command.
Matrix factorization to split dispersion coefficients failed
This should not normally happen. Contact the developers.
Min_style command before simulation box is defined
create_box command.
Minimization could not find thermo_pe compute
This compute is created by the thermo command. It must have been explicitly
deleted by a uncompute command.
Minimize command before simulation box is defined
create_box command.
Mismatched brackets in variable
Self-explanatory.
Mismatched compute in variable formula
A compute is referenced incorrectly or a compute that produces per-atom
values is used in an equal-style variable formula.
Mismatched fix in variable formula
A fix is referenced incorrectly or a fix that produces per-atom values is used in
an equal-style variable formula.
Mismatched variable in variable formula
A variable is referenced incorrectly or an atom-style variable that produces
per-atom values is used in an equal-style variable formula.
Modulo 0 in variable formula
Self-explanatory.
Molecule IDs too large for compute chunk/atom
The IDs must not be larger than can be stored in a 32-bit integer since chunk
IDs are 32-bit integers.
Molecule auto special bond generation overflow
Counts exceed maxspecial setting for other atoms in system.
Molecule file has angles but no nangles setting
Self-explanatory.
Molecule file has body params but no setting for them
Self-explanatory.
Molecule file has bonds but no nbonds setting
Self-explanatory.
Molecule file has dihedrals but no ndihedrals setting
Self-explanatory.
Molecule file has impropers but no nimpropers setting
Self-explanatory.
Molecule file has no Body Doubles section
Self-explanatory.
Molecule file has no Body Integers section
Self-explanatory.
Molecule file has special flags but no bonds
Self-explanatory.
Molecule file needs both Special Bond sections
316

LAMMPS Users Manual
Self-explanatory.
Molecule file requires atom style body
Self-explanatory.
Molecule file shake flags not before shake atoms
The order of the two sections is important.
Molecule file shake flags not before shake bonds
The order of the two sections is important.
Molecule file shake info is incomplete
All 3 SHAKE sections are needed.
Molecule file special list does not match special count
The number of values in an atom's special list does not match count.
Molecule file z center-of-mass must be 0.0 for 2d
Self-explanatory.
Molecule file z coord must be 0.0 for 2d
Self-explanatory.
Molecule natoms must be 1 for body particle
Self-explanatory.
Molecule sizescale must be 1.0 for body particle
Self-explanatory.
Molecule template ID for atom_style template does not exist
Self-explanatory.
Molecule template ID for create_atoms does not exist
Self-explanatory.
Molecule template ID for fix deposit does not exist
Self-explanatory.
Molecule template ID for fix gcmc does not exist
Self-explanatory.
Molecule template ID for fix pour does not exist
Self-explanatory.
Molecule template ID for fix rigid/small does not exist
Self-explanatory.
Molecule template ID for fix shake does not exist
Self-explanatory.
Molecule template ID must be alphanumeric or underscore characters
Self-explanatory.
Molecule topology/atom exceeds system topology/atom
The number of bonds, angles, etc per-atom in the molecule exceeds the system
setting. See the create_box command for how to specify these values.
Molecule topology type exceeds system topology type
The number of bond, angle, etc types in the molecule exceeds the system
setting. See the create_box command for how to specify these values.
More than one fix deform
Only one fix deform can be defined at a time.
More than one fix freeze
Only one of these fixes can be defined, since the granular pair potentials access
it.
More than one fix shake
Only one fix shake can be defined.
Mu not allowed when not using semi-grand in fix atom/swap command
Self-explanatory.
Must define angle_style before Angle Coeffs
317

LAMMPS Users Manual

Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must
Must

Must use an angle_style command before reading a data file that defines Angle
Coeffs.
define angle_style before BondAngle Coeffs
Must use an angle_style command before reading a data file that defines Angle
Coeffs.
define angle_style before BondBond Coeffs
Must use an angle_style command before reading a data file that defines Angle
Coeffs.
define bond_style before Bond Coeffs
Must use a bond_style command before reading a data file that defines Bond
Coeffs.
define dihedral_style before AngleAngleTorsion Coeffs
Must use a dihedral_style command before reading a data file that defines
AngleAngleTorsion Coeffs.
define dihedral_style before AngleTorsion Coeffs
Must use a dihedral_style command before reading a data file that defines
AngleTorsion Coeffs.
define dihedral_style before BondBond13 Coeffs
Must use a dihedral_style command before reading a data file that defines
BondBond13 Coeffs.
define dihedral_style before Dihedral Coeffs
Must use a dihedral_style command before reading a data file that defines
Dihedral Coeffs.
define dihedral_style before EndBondTorsion Coeffs
Must use a dihedral_style command before reading a data file that defines
EndBondTorsion Coeffs.
define dihedral_style before MiddleBondTorsion Coeffs
Must use a dihedral_style command before reading a data file that defines
MiddleBondTorsion Coeffs.
define improper_style before AngleAngle Coeffs
Must use an improper_style command before reading a data file that defines
AngleAngle Coeffs.
define improper_style before Improper Coeffs
Must use an improper_style command before reading a data file that defines
Improper Coeffs.
define pair_style before Pair Coeffs
Must use a pair_style command before reading a data file that defines Pair
Coeffs.
define pair_style before PairIJ Coeffs
Must use a pair_style command before reading a data file that defines PairIJ
Coeffs.
have more than one processor partition to temper
Cannot use the temper command with only one processor partition. Use the
-partition command-line option.
The Atoms section of a data file must come before an Angles section.
The Atoms section of a data file must come before a Bodies section.
The Atoms section of a data file must come before a Bonds section.
318

LAMMPS Users Manual
The Atoms section of a data file must come before a Dihedrals section.
The Atoms section of a data file must come before a Ellipsoids section.
The Atoms section of a data file must come before an Impropers section.
The Atoms section of a data file must come before a Lines section.
The Atoms section of a data file must come before a Triangles section.
The Atoms section of a data file must come before a Velocities section.
Must set both respa inner and outer
Cannot use just the inner or outer option with respa without using the other.
Must set number of threads via package omp command
Because you are using the USER-OMP package, set the number of threads via
its settings, not by the pair_style snap nthreads setting.
Must shrink-wrap piston boundary
The boundary style of the face where the piston is applied must be of type s
(shrink-wrapped).
Must specify a region in fix deposit
The region keyword must be specified with this fix.
Must specify a region in fix pour
Self-explanatory.
Must specify at least 2 types in fix atom/swap command
Self-explanatory.
Must use 'kspace_modify pressure/scalar no' for rRESPA with kspace_style MSM
The kspace scalar pressure option cannot (yet) be used with rRESPA.
Must use 'kspace_modify pressure/scalar no' for tensor components with kspace_style
msm
Otherwise MSM will compute only a scalar pressure. See the kspace_modify
command for details on this setting.
Must use 'kspace_modify pressure/scalar no' to obtain per-atom virial with
kspace_style MSM
The kspace scalar pressure option cannot be used to obtain per-atom virial.
Must use 'kspace_modify pressure/scalar no' with GPU MSM Pair styles
The kspace scalar pressure option is not (yet) compatible with GPU MSM Pair
styles.
Must use 'kspace_modify pressure/scalar no' with kspace_style msm/cg
The kspace scalar pressure option is not compatible with kspace_style msm/cg.
Must use -in switch with multiple partitions
A multi-partition simulation cannot read the input script from stdin. The -in
command-line option must be used to specify a file.
Must use Kokkos half/thread or full neighbor list with threads or GPUs
Using Kokkos half-neighbor lists with threading is not allowed.
Must use a block or cylinder region with fix pour
Self-explanatory.
Must use a block region with fix pour for 2d simulations
Self-explanatory.
Must use a bond style with TIP4P potential
TIP4P potentials assume bond lengths in water are constrained by a fix shake
command.
319

LAMMPS Users Manual
Must use a molecular atom style with fix poems molecule
Self-explanatory.
Must use a z-axis cylinder region with fix pour
Self-explanatory.
Must use an angle style with TIP4P potential
TIP4P potentials assume angles in water are constrained by a fix shake
command.
Must use atom map style array with Kokkos
See the atom_modify map command.
Must use atom style with molecule IDs with fix bond/swap
Self-explanatory.
Must use pair_style comb or comb3 with fix qeq/comb
Self-explanatory.
Must use variable energy with fix addforce
Must define an energy variable when applying a dynamic force during
minimization.
Must use variable energy with fix efield
You must define an energy when performing a minimization with a variable
E-field.
NEB command before simulation box is defined
Self-explanatory.
NEB requires damped dynamics minimizer
Use a different minimization style.
NEB requires use of fix neb
Self-explanatory.
NL ramp in wall/piston only implemented in zlo for now
The ramp keyword can only be used for piston applied to face zlo.
Need nswaptypes mu values in fix atom/swap command
Self-explanatory.
Needed bonus data not in data file
Some atom styles require bonus data. See the read_data doc page for details.
Needed molecular topology not in data file
The header of the data file indicated bonds, angles, etc would be included, but
they are not present.
Neigh_modify exclude molecule requires atom attribute molecule
Self-explanatory.
Neigh_modify include group != atom_modify first group
Self-explanatory.
Neighbor delay must be 0 or multiple of every setting
The delay and every parameters set via the neigh_modify command are
inconsistent. If the delay setting is non-zero, then it must be a multiple of the
every setting.
Neighbor include group not allowed with ghost neighbors
This is a current restriction within LAMMPS.
Neighbor list overflow, boost neigh_modify one
There are too many neighbors of a single atom. Use the neigh_modify command
to increase the max number of neighbors allowed for one atom. You may also
want to boost the page size.
Neighbor multi not yet enabled for ghost neighbors
This is a current restriction within LAMMPS.
Neighbor multi not yet enabled for granular
320

LAMMPS Users Manual
Self-explanatory.
Neighbor multi not yet enabled for rRESPA
Self-explanatory.
Neighbor page size must be >= 10x the one atom setting
This is required to prevent wasting too much memory.
New atom IDs exceed maximum allowed ID
See the setting for tagint in the src/lmptype.h file.
New bond exceeded bonds per atom in create_bonds
See the read_data command for info on using the "extra/bond/per/atom" keyword to
allow for additional bonds to be formed
New bond exceeded bonds per atom in fix bond/create
See the read_data command for info on using the "extra/bond/per/atom"
keyword to allow for additional bonds to be formed
New bond exceeded special list size in fix bond/create
See the "read_data extra/special/per/atom" command (or the "create_box
extra/special/per/atom" command) for info on how to leave space in the special
bonds list to allow for additional bonds to be formed.
Newton bond change after simulation box is defined
The newton command cannot be used to change the newton bond value after a
Next command must list all universe and uloop variables
This is to insure they stay in sync.
No Kspace style defined for compute group/group
Self-explanatory.
No OpenMP support compiled in
An OpenMP flag is set, but LAMMPS was not built with OpenMP support.
No angle style is defined for compute angle/local
Self-explanatory.
No angles allowed with this atom style
Self-explanatory.
No atoms in data file
The header of the data file indicated that atoms would be included, but they are
not present.
No basis atoms in lattice
Basis atoms must be defined for lattice style user.
No bodies allowed with this atom style
Self-explanatory. Check data file.
No bond style is defined for compute bond/local
Self-explanatory.
No bonds allowed with this atom style
Self-explanatory.
No box information in dump. You have to use 'box no'
Self-explanatory.
No count or invalid atom count in molecule file
The number of atoms must be specified.
No dihedral style is defined for compute dihedral/local
Self-explanatory.
No dihedrals allowed with this atom style
Self-explanatory.
No dump custom arguments specified
321

LAMMPS Users Manual
The dump custom command requires that atom quantities be specified to output
to dump file.
No dump local arguments specified
Self-explanatory.
No ellipsoids allowed with this atom style
Self-explanatory. Check data file.
No fix gravity defined for fix pour
Gravity is required to use fix pour.
No improper style is defined for compute improper/local
Self-explanatory.
No impropers allowed with this atom style
Self-explanatory.
No input values for fix ave/spatial
Self-explanatory.
No lines allowed with this atom style
Self-explanatory. Check data file.
No matching element in ADP potential file
The ADP potential file does not contain elements that match the requested
elements.
No matching element in EAM potential file
The EAM potential file does not contain elements that match the requested
elements.
No molecule topology allowed with atom style template
The data file cannot specify the number of bonds, angles, etc, because this info
if inferred from the molecule templates.
No overlap of box and region for create_atoms
Self-explanatory.
No pair coul/streitz for fix qeq/slater
These commands must be used together.
No pair hbond/dreiding coefficients set
Self-explanatory.
No pair style defined for compute group/group
Cannot calculate group interactions without a pair style defined.
No pair style is defined for compute pair/local
Self-explanatory.
No pair style is defined for compute property/local
Self-explanatory.
No rigid bodies defined
The fix specification did not end up defining any rigid bodies.
No triangles allowed with this atom style
Self-explanatory. Check data file.
No values in fix ave/chunk command
Self-explanatory.
No values in fix ave/time command
Self-explanatory.
Non digit character between brackets in variable
Self-explanatory.
Non integer # of swaps in temper command
Swap frequency in temper command must evenly divide the total # of
timesteps.
Non-numeric box dimensions - simulation unstable
322

LAMMPS Users Manual
The box size has apparently blown up.
Non-zero atom IDs with atom_modify id = no
Self-explanatory.
Non-zero read_data shift z value for 2d simulation
Self-explanatory.
Nprocs not a multiple of N for -reorder
Self-explanatory.
Number of core atoms != number of shell atoms
There must be a one-to-one pairing of core and shell atoms.
Numeric index is out of bounds
A command with an argument that specifies an integer or range of integers is
using a value that is less than 1 or greater than the maximum allowed limit.
One or more Atom IDs is negative
Atom IDs must be positive integers.
One or more atom IDs is too big
The limit on atom IDs is set by the SMALLBIG, BIGBIG, SMALLSMALL setting
in your Makefile. See Section_start 2.2 of the manual for more details.
One or more atom IDs is zero
Either all atoms IDs must be zero or none of them.
One or more atoms belong to multiple rigid bodies
Two or more rigid bodies defined by the fix rigid command cannot contain the
same atom.
One or more rigid bodies are a single particle
Self-explanatory.
One or zero atoms in rigid body
Any rigid body defined by the fix rigid command must contain 2 or more atoms.
Only 2 types allowed when not using semi-grand in fix atom/swap command
Self-explanatory.
Only one cut-off allowed when requesting all long
Self-explanatory.
Only one cutoff allowed when requesting all long
Self-explanatory.
Only zhi currently implemented for fix append/atoms
Self-explanatory.
Out of range atoms - cannot compute MSM
One or more atoms are attempting to map their charge to a MSM grid point
that is not owned by a processor. This is likely for one of two reasons, both of
them bad. First, it may mean that an atom near the boundary of a processor's
sub-domain has moved more than 1/2 the neighbor skin distance without
neighbor lists being rebuilt and atoms being migrated to new processors. This
also means you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the neigh_modify
command. The safest settings are "delay 0 every 1 check yes". Second, it may
mean that an atom has moved far outside a processor's sub-domain or even the
entire simulation box. This indicates bad physics, e.g. due to highly overlapping
atoms, too large a timestep, etc.
Out of range atoms - cannot compute PPPM
One or more atoms are attempting to map their charge to a PPPM grid point
that is not owned by a processor. This is likely for one of two reasons, both of
them bad. First, it may mean that an atom near the boundary of a processor's
sub-domain has moved more than 1/2 the neighbor skin distance without
323

LAMMPS Users Manual
neighbor lists being rebuilt and atoms being migrated to new processors. This
also means you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the neigh_modify
command. The safest settings are "delay 0 every 1 check yes". Second, it may
mean that an atom has moved far outside a processor's sub-domain or even the
entire simulation box. This indicates bad physics, e.g. due to highly overlapping
atoms, too large a timestep, etc.
Out of range atoms - cannot compute PPPMDisp
One or more atoms are attempting to map their charge to a PPPM grid point
that is not owned by a processor. This is likely for one of two reasons, both of
them bad. First, it may mean that an atom near the boundary of a processor's
sub-domain has moved more than 1/2 the neighbor skin distance without
neighbor lists being rebuilt and atoms being migrated to new processors. This
also means you may be missing pairwise interactions that need to be computed.
The solution is to change the re-neighboring criteria via the neigh_modify
command. The safest settings are "delay 0 every 1 check yes". Second, it may
mean that an atom has moved far outside a processor's sub-domain or even the
entire simulation box. This indicates bad physics, e.g. due to highly overlapping
atoms, too large a timestep, etc.
Overflow of allocated fix vector storage
This should not normally happen if the fix correctly calculated how long the
vector will grow to. Contact the developers.
Overlapping large/large in pair colloid
This potential is infinite when there is an overlap.
Overlapping small/large in pair colloid
This potential is infinite when there is an overlap.
POEMS fix must come before NPT/NPH fix
NPT/NPH fix must be defined in input script after all poems fixes, else the fix
contribution to the pressure virial is incorrect.
PPPM can only currently be used with comm_style brick
This is a current restriction in LAMMPS.
PPPM grid is too large
The global PPPM grid is larger than OFFSET in one or more dimensions.
OFFSET is currently set to 4096. You likely need to decrease the requested
accuracy.
PPPM grid stencil extends beyond nearest neighbor processor
This is not allowed if the kspace_modify overlap setting is no.
PPPM order < minimum allowed order
The default minimum order is 2. This can be reset by the kspace_modify
minorder command.
PPPM order cannot be < 2 or > than %d
This is a limitation of the PPPM implementation in LAMMPS.
PPPMDisp Coulomb grid is too large
The global PPPM grid is larger than OFFSET in one or more dimensions.
OFFSET is currently set to 4096. You likely need to decrease the requested
accuracy.
PPPMDisp Dispersion grid is too large
The global PPPM grid is larger than OFFSET in one or more dimensions.
OFFSET is currently set to 4096. You likely need to decrease the requested
accuracy.
PPPMDisp can only currently be used with comm_style brick
324

LAMMPS Users Manual
This is a current restriction in LAMMPS.
PPPMDisp coulomb order cannot be greater than %d
This is a limitation of the PPPM implementation in LAMMPS.
PPPMDisp used but no parameters set, for further information please see the
pppm/disp documentation
An efficient and accurate usage of the pppm/disp requires settings via the
kspace_modify command. Please see the pppm/disp documentation for further
instructions.
PRD command before simulation box is defined
create_box command.
PRD nsteps must be multiple of t_event
Self-explanatory.
PRD t_corr must be multiple of t_event
Self-explanatory.
Package command after simulation box is defined
create_box command.
Package cuda command without USER-CUDA package enabled
The USER-CUDA package must be installed via "make yes-user-cuda" before
LAMMPS is built, and the "-c on" must be used to enable the package.
Package gpu command without GPU package installed
The GPU package must be installed via "make yes-gpu" before LAMMPS is built.
Package intel command without USER-INTEL package installed
The USER-INTEL package must be installed via "make yes-user-intel" before
LAMMPS is built.
Package kokkos command without KOKKOS package enabled
The KOKKOS package must be installed via "make yes-kokkos" before LAMMPS
is built, and the "-k on" must be used to enable the package.
Package omp command without USER-OMP package installed
The USER-OMP package must be installed via "make yes-user-omp" before
LAMMPS is built.
Pair body requires atom style body
Self-explanatory.
Pair body requires body style nparticle
This pair style is specific to the nparticle body style.
Pair brownian requires atom style sphere
Self-explanatory.
Pair brownian requires extended particles
One of the particles has radius 0.0.
Pair brownian requires monodisperse particles
All particles must be the same finite size.
Pair brownian/poly requires atom style sphere
Self-explanatory.
Pair brownian/poly requires extended particles
One of the particles has radius 0.0.
Pair brownian/poly requires newton pair off
Self-explanatory.
Pair coeff for hybrid has invalid style
Style in pair coeff must have been listed in pair_style command.
Pair coul/wolf requires atom attribute q
325

LAMMPS Users Manual
The atom style defined does not have this attribute.
Pair cutoff < Respa interior cutoff
One or more pairwise cutoffs are too short to use with the specified rRESPA
cutoffs.
Pair dipole/cut requires atom attributes q, mu, torque
The atom style defined does not have these attributes.
Pair dipole/cut/gpu requires atom attributes q, mu, torque
The atom style defined does not have this attribute.
Pair dipole/long requires atom attributes q, mu, torque
The atom style defined does not have these attributes.
Pair dipole/sf/gpu requires atom attributes q, mu, torque
The atom style defined does not one or more of these attributes.
Pair distance < table inner cutoff
Two atoms are closer together than the pairwise table allows.
Pair distance > table outer cutoff
Two atoms are further apart than the pairwise table allows.
Pair dpd requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Pair gayberne epsilon a,b,c coeffs are not all set
Each atom type involved in pair_style gayberne must have these 3 coefficients
set at least once.
Pair gayberne requires atom style ellipsoid
Self-explanatory.
Pair gayberne requires atoms with same type have same shape
Self-explanatory.
Pair gayberne/gpu requires atom style ellipsoid
Self-explanatory.
Pair gayberne/gpu requires atoms with same type have same shape
Self-explanatory.
Pair granular requires atom attributes radius, rmass
The atom style defined does not have these attributes.
Pair granular requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Pair granular with shear history requires newton pair off
This is a current restriction of the implementation of pair granular styles with
history.
Pair hybrid single calls do not support per sub-style special bond values
Self-explanatory.
Pair hybrid sub-style does not support single call
You are attempting to invoke a single() call on a pair style that doesn't support
it.
Pair hybrid sub-style is not used
No pair_coeff command used a sub-style specified in the pair_style command.
Pair inner cutoff < Respa interior cutoff
One or more pairwise cutoffs are too short to use with the specified rRESPA
cutoffs.
Pair inner cutoff >= Pair outer cutoff
The specified cutoffs for the pair style are inconsistent.
Pair line/lj requires atom style line
Self-explanatory.
Pair lj/long/dipole/long requires atom attributes mu, torque
326

LAMMPS Users Manual
The atom style defined does not have these attributes.
Pair lubricate requires atom style sphere
Self-explanatory.
Pair lubricate requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Pair lubricate requires monodisperse particles
All particles must be the same finite size.
Pair lubricate/poly requires atom style sphere
Self-explanatory.
Pair lubricate/poly requires extended particles
One of the particles has radius 0.0.
Pair lubricate/poly requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Pair lubricate/poly requires newton pair off
Self-explanatory.
Pair lubricateU requires atom style sphere
Self-explanatory.
Pair lubricateU requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Pair lubricateU requires monodisperse particles
All particles must be the same finite size.
Pair lubricateU/poly requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
Pair lubricateU/poly requires newton pair off
Self-explanatory.
Pair peri lattice is not identical in x, y, and z
The lattice defined by the lattice command must be cubic.
Pair peri requires a lattice be defined
Use the lattice command for this purpose.
Pair peri requires an atom map, see atom_modify
Even for atomic systems, an atom map is required to find Peridynamic bonds.
Use the atom_modify command to define one.
Pair resquared epsilon a,b,c coeffs are not all set
Self-explanatory.
Pair resquared epsilon and sigma coeffs are not all set
Self-explanatory.
Pair resquared requires atom style ellipsoid
Self-explanatory.
Pair resquared requires atoms with same type have same shape
Self-explanatory.
Pair resquared/gpu requires atom style ellipsoid
Self-explanatory.
Pair resquared/gpu requires atoms with same type have same shape
Self-explanatory.
Pair style AIREBO requires atom IDs
This is a requirement to use the AIREBO potential.
Pair style AIREBO requires newton pair on
See the newton command. This is a restriction to use the AIREBO potential.
Pair style BOP requires atom IDs
This is a requirement to use the BOP potential.
Pair style BOP requires newton pair on
327

LAMMPS Users Manual
See the newton command. This is a restriction to use the BOP potential.
Pair style COMB requires atom IDs
This is a requirement to use the AIREBO potential.
Pair style COMB requires atom attribute q
Self-explanatory.
Pair style COMB requires newton pair on
See the newton command. This is a restriction to use the COMB potential.
Pair style COMB3 requires atom IDs
This is a requirement to use the COMB3 potential.
Pair style COMB3 requires atom attribute q
Self-explanatory.
Pair style COMB3 requires newton pair on
See the newton command. This is a restriction to use the COMB3 potential.
Pair style LCBOP requires atom IDs
This is a requirement to use the LCBOP potential.
Pair style LCBOP requires newton pair on
See the newton command. This is a restriction to use the Tersoff potential.
Pair style MEAM requires newton pair on
See the newton command. This is a restriction to use the MEAM potential.
Pair style SNAP requires newton pair on
See the newton command. This is a restriction to use the SNAP potential.
Pair style Stillinger-Weber requires atom IDs
This is a requirement to use the SW potential.
Pair style Stillinger-Weber requires newton pair on
See the newton command. This is a restriction to use the SW potential.
Pair style Tersoff requires atom IDs
This is a requirement to use the Tersoff potential.
Pair style Tersoff requires newton pair on
See the newton command. This is a restriction to use the Tersoff potential.
Pair style Vashishta requires atom IDs
This is a requirement to use the Vashishta potential.
Pair style Vashishta requires newton pair on
See the newton command. This is a restriction to use the Vashishta potential.
Pair style bop requires comm ghost cutoff at least 3x larger than %g
Use the communicate ghost command to set this. See the pair bop doc page for
more details.
Pair style born/coul/long requires atom attribute q
An atom style that defines this attribute must be used.
Pair style born/coul/long/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style born/coul/wolf requires atom attribute q
The atom style defined does not have this attribute.
Pair style buck/coul/cut requires atom attribute q
The atom style defined does not have this attribute.
Pair style buck/coul/long requires atom attribute q
The atom style defined does not have these attributes.
Pair style buck/coul/long/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style buck/long/coul/long requires atom attribute q
The atom style defined does not have this attribute.
Pair style coul/cut requires atom attribute q
328

LAMMPS Users Manual
The atom style defined does not have these attributes.
Pair style coul/cut/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style coul/debye/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style coul/dsf requires atom attribute q
The atom style defined does not have this attribute.
Pair style coul/dsf/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style coul/long/gpu requires atom attribute q
The atom style defined does not have these attributes.
Pair style coul/streitz requires atom attribute q
Self-explanatory.
Pair style does not have extra field requested by compute pair/local
The pair style does not support the pN value requested by the compute
pair/local command.
Pair style does not support bond_style quartic
The pair style does not have a single() function, so it can not be invoked by
bond_style quartic.
Pair style does not support compute group/group
The pair_style does not have a single() function, so it cannot be invoked by the
compute group/group command.
Pair style does not support compute pair/local
The pair style does not have a single() function, so it can not be invoked by
compute pair/local.
Pair style does not support compute property/local
The pair style does not have a single() function, so it can not be invoked by fix
bond/swap.
Pair style does not support fix bond/swap
The pair style does not have a single() function, so it can not be invoked by fix
bond/swap.
Pair style does not support pair_write
The pair style does not have a single() function, so it can not be invoked by pair
write.
Pair style does not support rRESPA inner/middle/outer
You are attempting to use rRESPA options with a pair style that does not
support them.
Pair style granular with history requires atoms have IDs
Atoms in the simulation do not have IDs, so history effects cannot be tracked by
the granular pair potential.
Pair style hbond/dreiding requires an atom map, see atom_modify
Self-explanatory.
Pair style hbond/dreiding requires atom IDs
Self-explanatory.
Pair style hbond/dreiding requires molecular system
Self-explanatory.
Pair style hbond/dreiding requires newton pair on
See the newton command for details.
Pair style hybrid cannot have hybrid as an argument
Self-explanatory.
Pair style hybrid cannot have none as an argument
329

LAMMPS Users Manual
Self-explanatory.
Pair style is incompatible with KSpace style
If a pair style with a long-range Coulombic component is selected, then a
kspace style must also be used.
Pair style is incompatible with TIP4P KSpace style
The pair style does not have the requires TIP4P settings.
Pair style lj/charmm/coul/charmm requires atom attribute q
The atom style defined does not have these attributes.
Pair style lj/charmm/coul/long requires atom attribute q
The atom style defined does not have these attributes.
Pair style lj/charmm/coul/long/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/class2/coul/cut requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/class2/coul/long requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/class2/coul/long/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/coul/cut requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/coul/cut/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/coul/debye/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/coul/dsf requires atom attribute q
The atom style defined does not have these attributes.
Pair style lj/cut/coul/dsf/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/coul/long requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/coul/long/gpu requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/tip4p/cut requires atom IDs
This is a requirement to use this potential.
Pair style lj/cut/tip4p/cut requires atom attribute q
The atom style defined does not have this attribute.
Pair style lj/cut/tip4p/cut requires newton pair on
See the newton command. This is a restriction to use this potential.
Pair style lj/cut/tip4p/long requires atom IDs
There are no atom IDs defined in the system and the TIP4P potential requires
them to find O,H atoms with a water molecule.
Pair style lj/cut/tip4p/long requires atom attribute q
The atom style defined does not have these attributes.
Pair style lj/cut/tip4p/long requires newton pair on
This is because the computation of constraint forces within a water molecule
adds forces to atoms owned by other processors.
Pair style lj/gromacs/coul/gromacs requires atom attribute q
An atom_style with this attribute is needed.
Pair style lj/long/dipole/long does not currently support respa
This feature is not yet supported.
Pair style lj/long/tip4p/long requires atom IDs
330

LAMMPS Users Manual

Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair
Pair

There are no atom IDs defined in the system and the TIP4P potential requires
them to find O,H atoms with a water molecule.
style lj/long/tip4p/long requires atom attribute q
The atom style defined does not have these attributes.
style lj/long/tip4p/long requires newton pair on
This is because the computation of constraint forces within a water molecule
adds forces to atoms owned by other processors.
style lj/sdk/coul/long/gpu requires atom attribute q
The atom style defined does not have this attribute.
style nb3b/harmonic requires atom IDs
This is a requirement to use this potential.
style nb3b/harmonic requires newton pair on
See the newton command. This is a restriction to use this potential.
style nm/cut/coul/cut requires atom attribute q
The atom style defined does not have this attribute.
style nm/cut/coul/long requires atom attribute q
The atom style defined does not have this attribute.
style peri requires atom style peri
Self-explanatory.
style polymorphic requires atom IDs
This is a requirement to use the polymorphic potential.
style polymorphic requires newton pair on
See the newton command. This is a restriction to use the polymorphic potential.
style reax requires atom IDs
This is a requirement to use the ReaxFF potential.
style reax requires atom attribute q
The atom style defined does not have this attribute.
style reax requires newton pair on
This is a requirement to use the ReaxFF potential.
style requires a KSpace style
No kspace style is defined.
style requires use of kspace_style ewald/disp
Self-explanatory.
style sw/gpu requires atom IDs
This is a requirement to use this potential.
style sw/gpu requires newton pair off
See the newton command. This is a restriction to use this potential.
style vashishta/gpu requires atom IDs
This is a requirement to use this potential.
style vashishta/gpu requires newton pair off
See the newton command. This is a restriction to use this potential.
style tersoff/gpu requires atom IDs
This is a requirement to use the tersoff/gpu potential.
style tersoff/gpu requires newton pair off
See the newton command. This is a restriction to use this pair style.
style tip4p/cut requires atom IDs
This is a requirement to use this potential.
style tip4p/cut requires atom attribute q
The atom style defined does not have this attribute.
style tip4p/cut requires newton pair on
See the newton command. This is a restriction to use this potential.
331

LAMMPS Users Manual
Pair style tip4p/long requires atom IDs
There are no atom IDs defined in the system and the TIP4P potential requires
them to find O,H atoms with a water molecule.
Pair style tip4p/long requires atom attribute q
The atom style defined does not have these attributes.
Pair style tip4p/long requires newton pair on
This is because the computation of constraint forces within a water molecule
adds forces to atoms owned by other processors.
Pair table cutoffs must all be equal to use with KSpace
When using pair style table with a long-range KSpace solver, the cutoffs for all
atom type pairs must all be the same, since the long-range solver starts at that
cutoff.
Pair table parameters did not set N
List of pair table parameters must include N setting.
Pair tersoff/zbl requires metal or real units
This is a current restriction of this pair potential.
Pair tersoff/zbl/kk requires metal or real units
This is a current restriction of this pair potential.
Pair tri/lj requires atom style tri
Self-explanatory.
Pair yukawa/colloid requires atom style sphere
Self-explanatory.
Pair yukawa/colloid requires atoms with same type have same radius
Self-explanatory.
Pair yukawa/colloid/gpu requires atom style sphere
Self-explanatory.
PairKIM only works with 3D problems
This is a current limitation.
Pair_coeff command before pair_style is defined
Self-explanatory.
Pair_coeff command before simulation box is defined
create_box command.
Pair_modify command before pair_style is defined
Self-explanatory.
Pair_modify special setting for pair hybrid incompatible with global special_bonds
setting
Cannot override a setting of 0.0 or 1.0 or change a setting between 0.0 and 1.0.
Pair_write command before pair_style is defined
Self-explanatory.
Particle on or inside fix wall surface
Particles must be "exterior" to the wall in order for energy/force to be
calculated.
Particle outside surface of region used in fix wall/region
Particles must be inside the region for energy/force to be calculated. A particle
outside the region generates an error.
Per-atom compute in equal-style variable formula
Equal-style variables cannot use per-atom quantities.
Per-atom energy was not tallied on needed timestep
You are using a thermo keyword that requires potentials to have tallied energy,
but they didn't on this timestep. See the variable doc page for ideas on how to
332

LAMMPS Users Manual
make this work.
Per-atom fix in equal-style variable formula
Equal-style variables cannot use per-atom quantities.
Per-atom virial was not tallied on needed timestep
You are using a thermo keyword that requires potentials to have tallied the
virial, but they didn't on this timestep. See the variable doc page for ideas on
how to make this work.
Per-processor system is too big
The number of owned atoms plus ghost atoms on a single processor must fit in
32-bit integer.
Potential energy ID for fix neb does not exist
Self-explanatory.
Potential energy ID for fix nvt/nph/npt does not exist
A compute for potential energy must be defined.
Potential file has duplicate entry
The potential file has more than one entry for the same element.
Potential file is missing an entry
The potential file does not have a needed entry.
Power by 0 in variable formula
Self-explanatory.
Pressure ID for fix box/relax does not exist
The compute ID needed to compute pressure for the fix does not exist.
Pressure ID for fix modify does not exist
Self-explanatory.
Pressure ID for fix npt/nph does not exist
Self-explanatory.
Pressure ID for fix press/berendsen does not exist
The compute ID needed to compute pressure for the fix does not exist.
Pressure ID for fix rigid npt/nph does not exist
Self-explanatory.
Pressure ID for thermo does not exist
The compute ID needed to compute pressure for thermodynamics does not
exist.
Pressure control can not be used with fix nvt
Self-explanatory.
Pressure control can not be used with fix nvt/asphere
Self-explanatory.
Pressure control can not be used with fix nvt/body
Self-explanatory.
Pressure control can not be used with fix nvt/sllod
Self-explanatory.
Pressure control can not be used with fix nvt/sphere
Self-explanatory.
Pressure control must be used with fix nph
Self-explanatory.
Pressure control must be used with fix nph/asphere
Self-explanatory.
Pressure control must be used with fix nph/body
Self-explanatory.
Pressure control must be used with fix nph/small
Self-explanatory.
333

LAMMPS Users Manual
Pressure control must be used with fix nph/sphere
Self-explanatory.
Pressure control must be used with fix nphug
A pressure control keyword (iso, aniso, tri, x, y, or z) must be provided.
Pressure control must be used with fix npt
Self-explanatory.
Pressure control must be used with fix npt/asphere
Self-explanatory.
Pressure control must be used with fix npt/body
Self-explanatory.
Pressure control must be used with fix npt/sphere
Self-explanatory.
Processor count in z must be 1 for 2d simulation
Self-explanatory.
Processor partitions do not match number of allocated processors
The total number of processors in all partitions must match the number of
processors LAMMPS is running on.
Processors command after simulation box is defined
create_box command.
Processors custom grid file is inconsistent
The vales in the custom file are not consistent with the number of processors
you are running on or the Px,Py,Pz settings of the processors command. Or
there was not a setting for every processor.
Processors grid numa and map style are incompatible
Using numa for gstyle in the processors command requires using cart for the
map option.
Processors part option and grid style are incompatible
Cannot use gstyle numa or custom with the part option.
Processors twogrid requires proc count be a multiple of core count
Self-explanatory.
Pstart and Pstop must have the same value
Self-explanatory.
Python function evaluation failed
The Python function did not run successfully and/or did not return a value (if it
is supposed to return a value). This is probably due to some error condition in
the function.
Python function is not callable
The provided Python code was run successfully, but it not define a callable
function with the required name.
Python invoke of undefined function
Cannot invoke a function that has not been previously defined.
Python variable does not match Python function
This matching is defined by the python-style variable and the python command.
Python variable has no function
No python command was used to define the function associated with the
python-style variable.
QEQ with 'newton pair off' not supported
See the newton command. This is a restriction to use the QEQ fixes.
R0 < 0 for fix spring command
Equilibrium spring length is invalid.
334

LAMMPS Users Manual
RATTLE coordinate constraints are not satisfied up to desired tolerance
Self-explanatory.
RATTLE determinant = 0.0
The determinant of the matrix being solved for a single cluster specified by the
fix rattle command is numerically invalid.
RATTLE failed
Certain constraints were not satisfied.
RATTLE velocity constraints are not satisfied up to desired tolerance
Self-explanatory.
It cannot be larger than the size of atom IDs, e.g. the maximum 32-bit integer.
Read dump of atom property that isn't allocated
Self-explanatory.
Read rerun dump file timestep > specified stop
Self-explanatory.
Read restart MPI-IO input not allowed with % in filename
This is because a % signifies one file per processor and MPI-IO creates one
large file for all processors.
Read_data shrink wrap did not assign all atoms correctly
This is typically because the box-size specified in the data file is large compared
to the actual extent of atoms in a shrink-wrapped dimension. When LAMMPS
shrink-wraps the box atoms will be lost if the processor they are re-assigned to
is too far away. Choose a box size closer to the actual extent of the atoms.
Read_dump command before simulation box is defined
create_box command.
Self-explanatory.
Read_dump triclinic status does not match simulation
Both the dump snapshot and the current LAMMPS simulation must be using
either an orthogonal or triclinic box.
Read_dump xyz fields do not have consistent scaling/wrapping
Self-explanatory.
Reading from MPI-IO filename when MPIIO package is not installed
Self-explanatory.
Reax_defs.h setting for NATDEF is too small
Edit the setting in the ReaxFF library and re-compile the library and re-build
LAMMPS.
Reax_defs.h setting for NNEIGHMAXDEF is too small
Edit the setting in the ReaxFF library and re-compile the library and re-build
LAMMPS.
Cannot specify a partition to be a receiver twice.
Region ID for compute chunk/atom does not exist
Self-explanatory.
Region ID for compute reduce/region does not exist
Self-explanatory.
Region ID for compute temp/region does not exist
Self-explanatory.
Region ID for dump custom does not exist
Self-explanatory.
335

LAMMPS Users Manual
Region ID for fix addforce does not exist
Self-explanatory.
Region ID for fix atom/swap does not exist
Self-explanatory.
Region ID for fix ave/spatial does not exist
Self-explanatory.
Region ID for fix aveforce does not exist
Self-explanatory.
Region ID for fix deposit does not exist
Self-explanatory.
Region ID for fix efield does not exist
Self-explanatory.
Region ID for fix evaporate does not exist
Self-explanatory.
Region ID for fix gcmc does not exist
Self-explanatory.
Region ID for fix heat does not exist
Self-explanatory.
Region ID for fix setforce does not exist
Self-explanatory.
Region ID for fix wall/region does not exist
Self-explanatory.
Region ID for group dynamic does not exist
Self-explanatory.
Region ID in variable formula does not exist
Self-explanatory.
Region cannot have 0 length rotation vector
Self-explanatory.
Region for fix oneway does not exist
Self-explanatory.
Region intersect region ID does not exist
Self-explanatory.
Region union or intersect cannot be dynamic
The sub-regions can be dynamic, but not the combined region.
Region union region ID does not exist
One or more of the region IDs specified by the region union command does not
exist.
Replacing a fix, but new style != old style
A fix ID can be used a 2nd time, but only if the style matches the previous fix. In
this case it is assumed you with to reset a fix's parameters. This error may mean
you are mistakenly re-using a fix ID when you do not intend to.
Replicate command before simulation box is defined
create_box command.
Replicate did not assign all atoms correctly
Atoms replicated by the replicate command were not assigned correctly to
processors. This is likely due to some atom coordinates being outside a
non-periodic simulation box.
Replicated system atom IDs are too big
See the setting for tagint in the src/lmptype.h file.
Replicated system is too big
336

LAMMPS Users Manual
See the setting for bigint in the src/lmptype.h file.
Required border comm not yet implemented with Kokkos
There are various limitations in the communication options supported by
Kokkos.
Rerun command before simulation box is defined
create_box command.
Rerun dump file does not contain requested snapshot
Self-explanatory.
Resetting timestep size is not allowed with fix move
This is because fix move is moving atoms based on elapsed time.
Respa inner cutoffs are invalid
The first cutoff must be <= the second cutoff.
Respa levels must be >= 1
Self-explanatory.
Respa middle cutoffs are invalid
The first cutoff must be <= the second cutoff.
Restart file MPI-IO output not allowed with % in filename
This is because a % signifies one file per processor and MPI-IO creates one
large file for all processors.
Restart file byte ordering is not recognized
The file does not appear to be a LAMMPS restart file since it doesn't contain a
recognized byte-orderomg flag at the beginning.
Restart file byte ordering is swapped
The file was written on a machine with different byte-ordering than the machine
you are reading it on. Convert it to a text data file instead, on the machine you
wrote it on.
Restart file incompatible with current version
This is probably because you are trying to read a file created with a version of
LAMMPS that is too old compared to the current version. Use your older
version of LAMMPS and convert the restart file to a data file.
Restart file is a MPI-IO file
The file is inconsistent with the filename you specified for it.
Restart file is a multi-proc file
The file is inconsistent with the filename you specified for it.
Restart file is not a MPI-IO file
The file is inconsistent with the filename you specified for it.
Restart file is not a multi-proc file
The file is inconsistent with the filename you specified for it.
Restart variable returned a bad timestep
The variable must return a timestep greater than the current timestep.
Restrain atoms %d %d %d %d missing on proc %d at step %ld
The 4 atoms in a restrain dihedral specified by the fix restrain command are not
all accessible to a processor. This probably means an atom has moved too far.
Restrain atoms %d %d %d missing on proc %d at step %ld
The 3 atoms in a restrain angle specified by the fix restrain command are not all
accessible to a processor. This probably means an atom has moved too far.
Restrain atoms %d %d missing on proc %d at step %ld
The 2 atoms in a restrain bond specified by the fix restrain command are not all
accessible to a processor. This probably means an atom has moved too far.
Reuse of compute ID
337

LAMMPS Users Manual
A compute ID cannot be used twice.
Reuse of dump ID
A dump ID cannot be used twice.
Reuse of molecule template ID
The template IDs must be unique.
Reuse of region ID
A region ID cannot be used twice.
Rigid body atoms %d %d missing on proc %d at step %ld
This means that an atom cannot find the atom that owns the rigid body it is part
of, or vice versa. The solution is to use the communicate cutoff command to
insure ghost atoms are acquired from far enough away to encompass the max
distance printed when the fix rigid/small command was invoked.
Rigid body has degenerate moment of inertia
Fix poems will only work with bodies (collections of atoms) that have non-zero
principal moments of inertia. This means they must be 3 or more non-collinear
atoms, even with joint atoms removed.
Rigid fix must come before NPT/NPH fix
NPT/NPH fix must be defined in input script after all rigid fixes, else the rigid
fix contribution to the pressure virial is incorrect.
Rmask function in equal-style variable formula
Run command before simulation box is defined
create_box command.
Run command start value is after start of run
Self-explanatory.
Run command stop value is before end of run
Self-explanatory.
Run_style command before simulation box is defined
create_box command.
SRD bin size for fix srd differs from user request
Fix SRD had to adjust the bin size to fit the simulation box. See the cubic
keyword if you want this message to be an error vs warning.
SRD bins for fix srd are not cubic enough
The bin shape is not within tolerance of cubic. See the cubic keyword if you
want this message to be an error vs warning.
SRD particle %d started inside big particle %d on step %ld bounce %d
See the inside keyword if you want this message to be an error vs warning.
SRD particle %d started inside wall %d on step %ld bounce %d
See the inside keyword if you want this message to be an error vs warning.
Same dimension twice in fix ave/spatial
Self-explanatory.
Sending partition in processors part command is already a sender
Cannot specify a partition to be a sender twice.
Set command before simulation box is defined
create_box command.
Set command floating point vector does not exist
Self-explanatory.
Set command integer vector does not exist
338

LAMMPS Users Manual
Self-explanatory.
Set command with no atoms existing
No atoms are yet defined so the set command cannot be used.
Set region ID does not exist
Region ID specified in set command does not exist.
Shake angles have different bond types
All 3-atom angle-constrained SHAKE clusters specified by the fix shake
command that are the same angle type, must also have the same bond types for
the 2 bonds in the angle.
Shake atoms %d %d %d %d missing on proc %d at step %ld
The 4 atoms in a single shake cluster specified by the fix shake command are
not all accessible to a processor. This probably means an atom has moved too
far.
Shake atoms %d %d %d missing on proc %d at step %ld
The 3 atoms in a single shake cluster specified by the fix shake command are
not all accessible to a processor. This probably means an atom has moved too
far.
Shake atoms %d %d missing on proc %d at step %ld
The 2 atoms in a single shake cluster specified by the fix shake command are
not all accessible to a processor. This probably means an atom has moved too
far.
Shake cluster of more than 4 atoms
A single cluster specified by the fix shake command can have no more than 4
atoms.
Shake clusters are connected
A single cluster specified by the fix shake command must have a single central
atom with up to 3 other atoms bonded to it.
Shake determinant = 0.0
The determinant of the matrix being solved for a single cluster specified by the
fix shake command is numerically invalid.
Shake fix must come before NPT/NPH fix
NPT fix must be defined in input script after SHAKE fix, else the SHAKE fix
contribution to the pressure virial is incorrect.
Shear history overflow, boost neigh_modify one
There are too many neighbors of a single atom. Use the neigh_modify command
to increase the max number of neighbors allowed for one atom. You may also
want to boost the page size.
Small to big integers are not sized correctly
This error occurs whenthe sizes of smallint, imageint, tagint, bigint, as defined
in src/lmptype.h are not what is expected. Contact the developers if this occurs.
Smallint setting in lmptype.h is invalid
It has to be the size of an integer.
Smallint setting in lmptype.h is not compatible
Smallint stored in restart file is not consistent with LAMMPS version you are
running.
Special list size exceeded in fix bond/create
See the "read_data extra/special/per/atom" command (or the "create_box
extra/special/per/atom" command) for info on how to leave space in the special
bonds list to allow for additional bonds to be formed.
Specified processors != physical processors
339

LAMMPS Users Manual
The 3d grid of processors defined by the processors command does not match
the number of processors LAMMPS is being run on.
Specified target stress must be uniaxial or hydrostatic
Self-explanatory.
Sqrt of negative value in variable formula
Self-explanatory.
Subsequent read data induced too many angles per atom
See the extra/angle/per/atom keyword for the create_box or the read_data
command to set this limit larger
Subsequent read data induced too many bonds per atom
See the extra/bond/per/atom keyword for the create_box or the read_data
command to set this limit larger
Subsequent read data induced too many dihedrals per atom
See the extra/dihedral/per/atom keyword for the create_box or the read_data
command to set this limit larger
Subsequent read data induced too many impropers per atom
See the extra/improper/per/atom keyword for the create_box or the read_data
command to set this limit larger
Substitution for illegal variable
Input script line contained a variable that could not be substituted for.
Support for writing images in JPEG format not included
LAMMPS was not built with the -DLAMMPS_JPEG switch in the Makefile.
Support for writing images in PNG format not included
LAMMPS was not built with the -DLAMMPS_PNG switch in the Makefile.
Support for writing movies not included
LAMMPS was not built with the -DLAMMPS_FFMPEG switch in the Makefile
System in data file is too big
See the setting for bigint in the src/lmptype.h file.
System is not charge neutral, net charge = %g
The total charge on all atoms on the system is not 0.0. For some KSpace solvers
this is an error.
TAD nsteps must be multiple of t_event
Self-explanatory.
TIP4P hydrogen has incorrect atom type
The TIP4P pairwise computation found an H atom whose type does not agree
with the specified H type.
TIP4P hydrogen is missing
The TIP4P pairwise computation failed to find the correct H atom within a
water molecule.
TMD target file did not list all group atoms
The target file for the fix tmd command did not list all atoms in the fix group.
Tad command before simulation box is defined
Self-explanatory.
Tagint setting in lmptype.h is invalid
Tagint must be as large or larger than smallint.
Tagint setting in lmptype.h is not compatible
Format of tagint stored in restart file is not consistent with LAMMPS version
you are running. See the settings in src/lmptype.h
Target pressure for fix rigid/nph cannot be < 0.0
Self-explanatory.
Target pressure for fix rigid/npt/small cannot be < 0.0
340

LAMMPS Users Manual
Self-explanatory.
Target temperature for fix nvt/npt/nph cannot be 0.0
Self-explanatory.
Target temperature for fix rigid/npt cannot be 0.0
Self-explanatory.
Target temperature for fix rigid/npt/small cannot be 0.0
Self-explanatory.
Target temperature for fix rigid/nvt cannot be 0.0
Self-explanatory.
Target temperature for fix rigid/nvt/small cannot be 0.0
Self-explanatory.
Temper command before simulation box is defined
create_box command.
Temperature ID for fix bond/swap does not exist
Self-explanatory.
Temperature ID for fix box/relax does not exist
Self-explanatory.
Temperature ID for fix nvt/npt does not exist
Self-explanatory.
Temperature ID for fix press/berendsen does not exist
Self-explanatory.
Temperature ID for fix rigid nvt/npt/nph does not exist
Self-explanatory.
Temperature ID for fix temp/berendsen does not exist
Self-explanatory.
Temperature ID for fix temp/csld does not exist
Self-explanatory.
Temperature ID for fix temp/csvr does not exist
Self-explanatory.
Temperature ID for fix temp/rescale does not exist
Self-explanatory.
Temperature compute degrees of freedom < 0
This should not happen if you are calculating the temperature on a valid set of
atoms.
Temperature control can not be used with fix nph
Self-explanatory.
Temperature control can not be used with fix nph/asphere
Self-explanatory.
Temperature control can not be used with fix nph/body
Self-explanatory.
Temperature control can not be used with fix nph/sphere
Self-explanatory.
Temperature control must be used with fix nphug
The temp keyword must be provided.
Temperature control must be used with fix npt
Self-explanatory.
Temperature control must be used with fix npt/asphere
Self-explanatory.
Temperature control must be used with fix npt/body
Self-explanatory.
341

LAMMPS Users Manual
Temperature control must be used with fix npt/sphere
Self-explanatory.
Temperature control must be used with fix nvt
Self-explanatory.
Temperature control must be used with fix nvt/asphere
Self-explanatory.
Temperature control must be used with fix nvt/body
Self-explanatory.
Temperature control must be used with fix nvt/sllod
Self-explanatory.
Temperature control must be used with fix nvt/sphere
Self-explanatory.
Temperature control must not be used with fix nph/small
Self-explanatory.
Temperature for fix nvt/sllod does not have a bias
The specified compute must compute temperature with a bias.
Tempering could not find thermo_pe compute
This compute is created by the thermo command. It must have been explicitly
deleted by a uncompute command.
Tempering fix ID is not defined
The fix ID specified by the temper command does not exist.
Tempering temperature fix is not valid
The fix specified by the temper command is not one that controls temperature
(nvt or langevin).
This is an internal error. Contact the developers.
The package gpu command is required for gpu styles
Self-explanatory.
Thermo and fix not computed at compatible times
Fixes generate values on specific timesteps. The thermo output does not match
these timesteps.
Thermo compute array is accessed out-of-range
Self-explanatory.
Thermo compute does not compute array
Self-explanatory.
Thermo compute does not compute scalar
Self-explanatory.
Thermo compute does not compute vector
Self-explanatory.
Thermo compute vector is accessed out-of-range
Self-explanatory.
Thermo custom variable cannot be indexed
Self-explanatory.
Thermo custom variable is not equal-style variable
Only equal-style variables can be output with thermodynamics, not atom-style
variables.
Thermo every variable returned a bad timestep
The variable must return a timestep greater than the current timestep.
Thermo fix array is accessed out-of-range
Self-explanatory.
Thermo fix does not compute array
342

LAMMPS Users Manual
Self-explanatory.
Thermo fix does not compute scalar
Self-explanatory.
Thermo fix does not compute vector
Self-explanatory.
Thermo fix vector is accessed out-of-range
Self-explanatory.
Thermo keyword in variable requires thermo to use/init pe
You are using a thermo keyword in a variable that requires potential energy to
output.
Thermo keyword in variable requires thermo to use/init press
You are using a thermo keyword in a variable that requires pressure to be
output.
Thermo keyword in variable requires thermo to use/init temp
You are using a thermo keyword in a variable that requires temperature to be
output.
Thermo style does not use press
Cannot use thermo_modify to set this parameter since the thermo_style is not
computing this quantity.
Thermo style does not use temp
Cannot use thermo_modify to set this parameter since the thermo_style is not
computing this quantity.
Thermo_modify every variable returned a bad timestep
The returned timestep is less than or equal to the current timestep.
Thermo_modify int format does not contain d character
Self-explanatory.
Thermo_modify pressure ID does not compute pressure
The specified compute ID does not compute pressure.
Thermo_modify temperature ID does not compute temperature
The specified compute ID does not compute temperature.
Thermo_style command before simulation box is defined
create_box command.
This variable thermo keyword cannot be used between runs
Keywords that refer to time (such as cpu, elapsed) do not make sense in
between runs.
Threshhold for an atom property that isn't allocated
A dump threshold has been requested on a quantity that is not defined by the
atom style used in this simulation.
Timestep must be >= 0
Specified timestep is invalid.
Too big a problem to use velocity create loop all
The system size must fit in a 32-bit integer to use this option.
Too big a timestep for dump dcd
The timestep must fit in a 32-bit integer to use this dump style.
Too big a timestep for dump xtc
The timestep must fit in a 32-bit integer to use this dump style.
Too few bits for lookup table
343

LAMMPS Users Manual

Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too
Too

Table size specified via pair_modify command does not work with your
machine's floating point representation.
few lines in %s section of data file
Self-explanatory.
few values in body lines in data file
Self-explanatory.
few values in body section of molecule file
Self-explanatory.
many -pk arguments in command line
The string formed by concatenating the arguments is too long. Use a package
command in the input script instead.
many MSM grid levels
The max number of MSM grid levels is hardwired to 10.
many args in variable function
More args are used than any variable function allows.
many atom pairs for pair bop
The number of atomic pairs exceeds the expected number. Check your atomic
structure to ensure that it is realistic.
many atom sorting bins
This is likely due to an immense simulation box that has blown up to a large
size.
many atom triplets for pair bop
The number of three atom groups for angle determinations exceeds the
expected number. Check your atomic structure to ensure that it is realistic.
many atoms for dump dcd
The system size must fit in a 32-bit integer to use this dump style.
many atoms for dump xtc
The system size must fit in a 32-bit integer to use this dump style.
many atoms to dump sort
Cannot sort when running with more than 2^31 atoms.
many exponent bits for lookup table
Table size specified via pair_modify command does not work with your
machine's floating point representation.
many groups
The maximum number of atom groups (including the "all" group) is given by
MAX_GROUP in group.cpp and is 32.
many iterations
You must use a number of iterations that fit in a 32-bit integer for minimization.
many lines in one body in data file - boost MAXBODY
MAXBODY is a setting at the top of the src/read_data.cpp file. Set it larger and
re-compile the code.
many local+ghost atoms for neighbor list
The number of nlocal + nghost atoms on a processor is limited by the size of a
32-bit integer with 2 bits removed for masking 1-2, 1-3, 1-4 neighbors.
many mantissa bits for lookup table
Table size specified via pair_modify command does not work with your
machine's floating point representation.
many masses for fix shake
The fix shake command cannot list more masses than there are atom types.
many molecules for fix poems
The limit is 2^31 = ~2 billion molecules.
344

LAMMPS Users Manual
Too many molecules for fix rigid
The limit is 2^31 = ~2 billion molecules.
Too many neighbor bins
This is likely due to an immense simulation box that has blown up to a large
size.
Too many timesteps
The cumulative timesteps must fit in a 64-bit integer.
Too many timesteps for NEB
You must use a number of timesteps that fit in a 32-bit integer for NEB.
Too many total atoms
See the setting for bigint in the src/lmptype.h file.
Too many total bits for bitmapped lookup table
Table size specified via pair_modify command is too large. Note that a value of
N generates a 2^N size table.
Too many values in body lines in data file
Self-explanatory.
Too many values in body section of molecule file
Self-explanatory.
Too much buffered per-proc info for dump
The size of the buffered string must fit in a 32-bit integer for a dump.
Too much per-proc info for dump
Number of local atoms times number of columns must fit in a 32-bit integer for
dump.
Tree structure in joint connections
Fix poems cannot (yet) work with coupled bodies whose joints connect the
bodies in a tree structure.
Triclinic box skew is too large
The displacement in a skewed direction must be less than half the box length in
that dimension. E.g. the xy tilt must be between -half and +half of the x box
length. This constraint can be relaxed by using the box tilt command.
Tried to convert a double to int, but input_double > INT_MAX
Self-explanatory.
Trying to build an occasional neighbor list before initialization completed
This is not allowed. Source code caller needs to be modified.
Two fix ave commands using same compute chunk/atom command in incompatible
ways
They are both attempting to "lock" the chunk/atom command so that the chunk
assignments persist for some number of timesteps, but are doing it in different
ways.
Two groups cannot be the same in fix spring couple
Self-explanatory.
USER-CUDA mode requires CUDA variant of min style
CUDA mode is enabled, so the min style must include a cuda suffix.
USER-CUDA mode requires CUDA variant of run style
CUDA mode is enabled, so the run style must include a cuda suffix.
USER-CUDA package does not yet support comm_style tiled
Self-explanatory.
USER-CUDA package requires a cuda enabled atom_style
Self-explanatory.
Unable to initialize accelerator for use
There was a problem initializing an accelerator for the gpu package
345

LAMMPS Users Manual
Unbalanced quotes in input line
No matching end double quote was found following a leading double quote.
Unexpected end of -reorder file
Self-explanatory.
Unexpected end of AngleCoeffs section
Unexpected end of BondCoeffs section
Unexpected end of DihedralCoeffs section
Unexpected end of ImproperCoeffs section
Unexpected end of PairCoeffs section
Unexpected end of custom file
Self-explanatory.
Unexpected end of data file
LAMMPS hit the end of the data file while attempting to read a section.
Something is wrong with the format of the data file.
Unexpected end of dump file
A read operation from the file failed.
Unexpected end of fix rigid file
A read operation from the file failed.
Unexpected end of fix rigid/small file
A read operation from the file failed.
Unexpected end of molecule file
Self-explanatory.
Unexpected end of neb file
A read operation from the file failed.
Units command after simulation box is defined
create_box command.
Universe/uloop variable count < # of partitions
A universe or uloop style variable must specify a number of values >= to the
number of processor partitions.
Unknown angle style
The choice of angle style is unknown.
Unknown atom style
The choice of atom style is unknown.
Unknown body style
The choice of body style is unknown.
Unknown bond style
The choice of bond style is unknown.
Unknown category for info is_active()
Self-explanatory.
Unknown category for info is_available()
Self-explanatory.
Unknown category for info is_defined()
Self-explanatory.
Unknown command: %s
The command is not known to LAMMPS. Check the input script.
346

LAMMPS Users Manual
Unknown compute style
The choice of compute style is unknown.
Unknown dihedral style
The choice of dihedral style is unknown.
The choice of dump reader style via the format keyword is unknown.
Unknown dump style
The choice of dump style is unknown.
Unknown error in GPU library
Self-explanatory.
Unknown fix style
The choice of fix style is unknown.
Unknown identifier in data file: %s
A section of the data file cannot be read by LAMMPS.
Unknown improper style
The choice of improper style is unknown.
Unknown keyword in thermo_style custom command
One or more specified keywords are not recognized.
Unknown kspace style
The choice of kspace style is unknown.
Unknown name for info newton category
Self-explanatory.
Unknown name for info package category
Self-explanatory.
Unknown name for info pair category
Self-explanatory.
Unknown pair style
The choice of pair style is unknown.
Unknown pair_modify hybrid sub-style
The choice of sub-style is unknown.
Unknown region style
The choice of region style is unknown.
Unknown section in molecule file
Self-explanatory.
Unknown table style in angle style table
Self-explanatory.
Unknown table style in bond style table
Self-explanatory.
Unknown table style in pair_style command
Style of table is invalid for use with pair_style table command.
Unknown unit_style
Self-explanatory. Check the input script or data file.
Unrecognized lattice type in MEAM file 1
The lattice type in an entry of the MEAM library file is not valid.
Unrecognized lattice type in MEAM file 2
The lattice type in an entry of the MEAM parameter file is not valid.
Unrecognized pair style in compute pair command
Self-explanatory.
Unrecognized virial argument in pair_style command
Only two options are supported: LAMMPSvirial and KIMvirial
Unsupported mixing rule in kspace_style ewald/disp
347

LAMMPS Users Manual
Only geometric mixing is supported.
Unsupported order in kspace_style ewald/disp
Only 1/r^6 dispersion or dipole terms are supported.
Unsupported order in kspace_style pppm/disp, pair_style %s
Only pair styles with 1/r and 1/r^6 dependence are currently supported.
Use cutoff keyword to set cutoff in single mode
Mode is single so cutoff/multi keyword cannot be used.
Use cutoff/multi keyword to set cutoff in multi mode
Mode is multi so cutoff keyword cannot be used.
Using fix nvt/sllod with inconsistent fix deform remap option
Fix nvt/sllod requires that deforming atoms have a velocity profile provided by
"remap v" as a fix deform option.
Using fix nvt/sllod with no fix deform defined
Self-explanatory.
Using fix srd with inconsistent fix deform remap option
When shearing the box in an SRD simulation, the remap v option for fix deform
needs to be used.
Using pair lubricate with inconsistent fix deform remap option
Must use remap v option with fix deform with this pair style.
Using pair lubricate/poly with inconsistent fix deform remap option
If fix deform is used, the remap v option is required.
Using suffix cuda without USER-CUDA package enabled
Self-explanatory.
Using suffix gpu without GPU package installed
Self-explanatory.
Using suffix intel without USER-INTEL package installed
Self-explanatory.
Using suffix kk without KOKKOS package enabled
Self-explanatory.
Using suffix omp without USER-OMP package installed
Self-explanatory.
Using update dipole flag requires atom attribute mu
Self-explanatory.
Using update dipole flag requires atom style sphere
Self-explanatory.
Variable ID in variable formula does not exist
Self-explanatory.
Variable atom ID is too large
Specified ID is larger than the maximum allowed atom ID.
Variable evaluation before simulation box is defined
Cannot evaluate a compute or fix or atom-based value in a variable before the
simulation has been setup.
Variable evaluation in fix wall gave bad value
The returned value for epsilon or sigma < 0.0.
Variable evaluation in region gave bad value
Variable returned a radius < 0.0.
Variable for compute ti is invalid style
Self-explanatory.
Variable for create_atoms is invalid style
The variables must be equal-style variables.
Variable for displace_atoms is invalid style
348

LAMMPS Users Manual
It must be an equal-style or atom-style variable.
Variable for dump every is invalid style
Only equal-style variables can be used.
Variable for dump image center is invalid style
Must be an equal-style variable.
Variable for dump image persp is invalid style
Must be an equal-style variable.
Variable for dump image phi is invalid style
Must be an equal-style variable.
Variable for dump image theta is invalid style
Must be an equal-style variable.
Variable for dump image zoom is invalid style
Must be an equal-style variable.
Variable for fix adapt is invalid style
Only equal-style variables can be used.
Variable for fix addforce is invalid style
Self-explanatory.
Variable for fix aveforce is invalid style
Only equal-style variables can be used.
Variable for fix deform is invalid style
The variable must be an equal-style variable.
Variable for fix efield is invalid style
The variable must be an equal- or atom-style variable.
Variable for fix gravity is invalid style
Only equal-style variables can be used.
Variable for fix heat is invalid style
Only equal-style or atom-style variables can be used.
Variable for fix indent is invalid style
Only equal-style variables can be used.
Variable for fix indent is not equal style
Only equal-style variables can be used.
Variable for fix langevin is invalid style
It must be an equal-style variable.
Variable for fix move is invalid style
Only equal-style variables can be used.
Variable for fix setforce is invalid style
Only equal-style variables can be used.
Variable for fix temp/berendsen is invalid style
Only equal-style variables can be used.
Variable for fix temp/csld is invalid style
Only equal-style variables can be used.
Variable for fix temp/csvr is invalid style
Only equal-style variables can be used.
Variable for fix temp/rescale is invalid style
Only equal-style variables can be used.
Variable for fix wall is invalid style
Only equal-style variables can be used.
Variable for fix wall/reflect is invalid style
Only equal-style variables can be used.
Variable for fix wall/srd is invalid style
Only equal-style variables can be used.
349

LAMMPS Users Manual
Variable for group dynamic is invalid style
The variable must be an atom-style variable.
Variable for group is invalid style
Only atom-style variables can be used.
Variable for region cylinder is invalid style
Only equal-style variables are allowed.
Variable for region is invalid style
Only equal-style variables can be used.
Variable for region is not equal style
Self-explanatory.
Variable for region sphere is invalid style
Only equal-style variables are allowed.
Variable for restart is invalid style
Only equal-style variables can be used.
Variable for set command is invalid style
Only atom-style variables can be used.
Variable for thermo every is invalid style
Only equal-style variables can be used.
Variable for velocity set is invalid style
Only atom-style variables can be used.
Variable for voronoi radius is not atom style
Self-explanatory.
Variable formula compute array is accessed out-of-range
Self-explanatory.
Variable formula compute vector is accessed out-of-range
Self-explanatory.
Variable formula fix array is accessed out-of-range
Self-explanatory.
Variable formula fix vector is accessed out-of-range
Self-explanatory.
Variable has circular dependency
A circular dependency is when variable "a" in used by variable "b" and variable
"b" is also used by variable "a". Circular dependencies with longer chains of
dependence are also not allowed.
Variable name between brackets must be alphanumeric or underscore characters
Self-explanatory.
Variable name for compute chunk/atom does not exist
Self-explanatory.
Variable name for compute reduce does not exist
Self-explanatory.
Variable name for compute ti does not exist
Self-explanatory.
Variable name for create_atoms does not exist
Self-explanatory.
Variable name for displace_atoms does not exist
Self-explanatory.
Variable name for dump every does not exist
Self-explanatory.
Variable name for dump image center does not exist
Self-explanatory.
Variable name for dump image persp does not exist
350

LAMMPS Users Manual
Self-explanatory.
Variable name for dump image phi does not exist
Self-explanatory.
Variable name for dump image theta does not exist
Self-explanatory.
Variable name for dump image zoom does not exist
Self-explanatory.
Variable name for fix adapt does not exist
Self-explanatory.
Variable name for fix addforce does not exist
Self-explanatory.
Variable name for fix ave/atom does not exist
Self-explanatory.
Variable name for fix ave/chunk does not exist
Self-explanatory.
Variable name for fix ave/correlate does not exist
Self-explanatory.
Variable name for fix ave/histo does not exist
Self-explanatory.
Variable name for fix ave/spatial does not exist
Self-explanatory.
Variable name for fix ave/time does not exist
Self-explanatory.
Variable name for fix aveforce does not exist
Self-explanatory.
Variable name for fix deform does not exist
Self-explanatory.
Variable name for fix efield does not exist
Self-explanatory.
Variable name for fix gravity does not exist
Self-explanatory.
Variable name for fix heat does not exist
Self-explanatory.
Variable name for fix indent does not exist
Self-explanatory.
Variable name for fix langevin does not exist
Self-explanatory.
Variable name for fix move does not exist
Self-explanatory.
Variable name for fix setforce does not exist
Self-explanatory.
Variable name for fix store/state does not exist
Self-explanatory.
Variable name for fix temp/berendsen does not exist
Self-explanatory.
Variable name for fix temp/csld does not exist
Self-explanatory.
Variable name for fix temp/csvr does not exist
Self-explanatory.
Variable name for fix temp/rescale does not exist
Self-explanatory.
351

LAMMPS Users Manual
Variable name for fix vector does not exist
Self-explanatory.
Variable name for fix wall does not exist
Self-explanatory.
Variable name for fix wall/reflect does not exist
Self-explanatory.
Variable name for fix wall/srd does not exist
Self-explanatory.
Variable name for group does not exist
Self-explanatory.
Variable name for group dynamic does not exist
Self-explanatory.
Variable name for region cylinder does not exist
Self-explanatory.
Variable name for region does not exist
Self-explanatory.
Variable name for region sphere does not exist
Self-explanatory.
Variable name for restart does not exist
Self-explanatory.
Variable name for set command does not exist
Self-explanatory.
Variable name for thermo every does not exist
Self-explanatory.
Variable name for velocity set does not exist
Self-explanatory.
Variable name for voronoi radius does not exist
Self-explanatory.
Variable name must be alphanumeric or underscore characters
Self-explanatory.
Variable uses atom property that isn't allocated
Self-explanatory.
Velocity command before simulation box is defined
create_box command.
Velocity command with no atoms existing
A velocity command has been used, but no atoms yet exist.
Velocity ramp in z for a 2d problem
Self-explanatory.
Velocity rigid used with non-rigid fix-ID
Self-explanatory.
Velocity temperature ID does calculate a velocity bias
The specified compute must compute a bias for temperature.
Velocity temperature ID does not compute temperature
The compute ID given to the velocity command must compute temperature.
Verlet/split can only currently be used with comm_style brick
This is a current restriction in LAMMPS.
Verlet/split does not yet support TIP4P
This is a current limitation.
Verlet/split requires 2 partitions
See the -partition command-line switch.
352

LAMMPS Users Manual
Verlet/split requires Rspace partition layout be multiple of Kspace partition layout in
each dim
This is controlled by the processors command.
Verlet/split requires Rspace partition size be multiple of Kspace partition size
This is so there is an equal number of Rspace processors for every Kspace
processor.
Virial was not tallied on needed timestep
You are using a thermo keyword that requires potentials to have tallied the
virial, but they didn't on this timestep. See the variable doc page for ideas on
how to make this work.
Voro++ error: narea and neigh have a different size
This error is returned by the Voro++ library.
Wall defined twice in fix wall command
Self-explanatory.
Wall defined twice in fix wall/reflect command
Self-explanatory.
Wall defined twice in fix wall/srd command
Self-explanatory.
Water H epsilon must be 0.0 for pair style lj/cut/tip4p/cut
This is because LAMMPS does not compute the Lennard-Jones interactions with
these particles for efficiency reasons.
Water H epsilon must be 0.0 for pair style lj/cut/tip4p/long
This is because LAMMPS does not compute the Lennard-Jones interactions with
these particles for efficiency reasons.
Water H epsilon must be 0.0 for pair style lj/long/tip4p/long
This is because LAMMPS does not compute the Lennard-Jones interactions with
these particles for efficiency reasons.
World variable count doesn't match # of partitions
A world-style variable must specify a number of values equal to the number of
processor partitions.
Write_data command before simulation box is defined
Self-explanatory.
Write_restart command before simulation box is defined
create_box command.
Writing to MPI-IO filename when MPIIO package is not installed
Self-explanatory.
Zero length rotation vector with displace_atoms
Self-explanatory.
Zero length rotation vector with fix move
Self-explanatory.
Zero-length lattice orient vector
Self-explanatory.
Warnings:
Adjusting Coulombic cutoff for MSM, new cutoff = %g
The adjust/cutoff command is turned on and the Coulombic cutoff has been
adjusted to match the user-specified accuracy.
Angle atoms missing at step %ld
353

LAMMPS Users Manual
One or more of 3 atoms needed to compute a particular angle are missing on
this processor. Typically this is because the pairwise cutoff is set too short or
the angle has blown apart and an atom is too far away.
Angle style in data file differs from currently defined angle style
Self-explanatory.
Atom style in data file differs from currently defined atom style
Self-explanatory.
Bond atom missing in box size check
The 2nd atoms needed to compute a particular bond is missing on this
processor. Typically this is because the pairwise cutoff is set too short or the
bond has blown apart and an atom is too far away.
Bond atom missing in image check
The 2nd atom in a particular bond is missing on this processor. Typically this is
because the pairwise cutoff is set too short or the bond has blown apart and an
atom is too far away.
Bond atoms missing at step %ld
The 2nd atom needed to compute a particular bond is missing on this processor.
Typically this is because the pairwise cutoff is set too short or the bond has
blown apart and an atom is too far away.
Bond style in data file differs from currently defined bond style
Self-explanatory.
Bond/angle/dihedral extent > half of periodic box length
This is a restriction because LAMMPS can be confused about which image of an
atom in the bonded interaction is the correct one to use. "Extent" in this context
means the maximum end-to-end length of the bond/angle/dihedral. LAMMPS
computes this by taking the maximum bond length, multiplying by the number
of bonds in the interaction (e.g. 3 for a dihedral) and adding a small amount of
stretch.
Both groups in compute group/group have a net charge; the Kspace boundary
correction to energy will be non-zero
Self-explanatory.
Calling write_dump before a full system init.
The write_dump command is used before the system has been fully initialized as
part of a 'run' or 'minimize' command. Not all dump styles and features are fully
supported at this point and thus the command may fail or produce incomplete
or incorrect output. Insert a "run 0" command, if a full system init is required.
Cannot count rigid body degrees-of-freedom before bodies are fully initialized
This means the temperature associated with the rigid bodies may be incorrect
on this timestep.
Cannot count rigid body degrees-of-freedom before bodies are initialized
This means the temperature associated with the rigid bodies may be incorrect
on this timestep.
Cannot include log terms without 1/r terms; setting flagHI to 1
Self-explanatory.
Cannot include log terms without 1/r terms; setting flagHI to 1.
Self-explanatory.
Charges are set, but coulombic solver is not used
Self-explanatory.
Charges did not converge at step %ld: %lg
Self-explanatory.
Communication cutoff is too small for SNAP micro load balancing, increased to %lf
354

LAMMPS Users Manual
Self-explanatory.
Compute cna/atom cutoff may be too large to find ghost atom neighbors
The neighbor cutoff used may not encompass enough ghost atoms to perform
this operation correctly.
Computing temperature of portions of rigid bodies
The group defined by the temperature compute does not encompass all the
atoms in one or more rigid bodies, so the change in degrees-of-freedom for the
atoms in those partial rigid bodies will not be accounted for.
Create_bonds max distance > minimum neighbor cutoff
This means atom pairs for some atom types may not be in the neighbor list and
thus no bond can be created between them.
Delete_atoms cutoff > minimum neighbor cutoff
This means atom pairs for some atom types may not be in the neighbor list and
thus an atom in that pair cannot be deleted.
Dihedral atoms missing at step %ld
One or more of 4 atoms needed to compute a particular dihedral are missing on
this processor. Typically this is because the pairwise cutoff is set too short or
the dihedral has blown apart and an atom is too far away.
Dihedral problem
Conformation of the 4 listed dihedral atoms is extreme; you may want to check
Dihedral problem: %d %ld %d %d %d %d
Conformation of the 4 listed dihedral atoms is extreme; you may want to check
Dihedral style in data file differs from currently defined dihedral style
Self-explanatory.
Dump dcd/xtc timestamp may be wrong with fix dt/reset
If the fix changes the timestep, the dump dcd file will not reflect the change.
Energy due to X extra global DOFs will be included in minimizer energies
When using fixes like box/relax, the potential energy used by the minimizer is
augmented by an additional energy provided by the fix. Thus the printed
converged energy may be different from the total potential energy.
Energy tally does not account for 'zero yes'
The energy removed by using the 'zero yes' flag is not accounted for in the
energy tally and thus energy conservation cannot be monitored in this case.
Estimated error in splitting of dispersion coeffs is %g
Error is greater than 0.0001 percent.
Ewald/disp Newton solver failed, using old method to estimate g_ewald
Self-explanatory. Choosing a different cutoff value may help.
FENE bond too long
A FENE bond has stretched dangerously far. It's interaction strength will be
truncated to attempt to prevent the bond from blowing up.
FENE bond too long: %ld %d %d %g
A FENE bond has stretched dangerously far. It's interaction strength will be
truncated to attempt to prevent the bond from blowing up.
FENE bond too long: %ld %g
A FENE bond has stretched dangerously far. It's interaction strength will be
truncated to attempt to prevent the bond from blowing up.
Fix SRD walls overlap but fix srd overlap not set
You likely want to set this in your input script.
Fix bond/swap will ignore defined angles
355

LAMMPS Users Manual
See the doc page for fix bond/swap for more info on this restriction.
Fix deposit near setting < possible overlap separation %g
This test is performed for finite size particles with a diameter, not for point
particles. The near setting is smaller than the particle diameter which can lead
to overlaps.
Fix evaporate may delete atom with non-zero molecule ID
This is probably an error, since you should not delete only one atom of a
molecule.
Fix gcmc using full_energy option
Fix gcmc has automatically turned on the full_energy option since it is required
for systems like the one specified by the user. User input included one or more
of the following: kspace, triclinic, a hybrid pair style, an eam pair style, or no
"single" function for the pair style.
Fix property/atom mol or charge w/out ghost communication
A model typically needs these properties defined for ghost atoms.
Fix qeq CG convergence failed (%g) after %d iterations at %ld step
Self-explanatory.
Fix qeq has non-zero lower Taper radius cutoff
Absolute value must be <= 0.01.
Fix qeq has very low Taper radius cutoff
Value should typically be >= 5.0.
Fix qeq/dynamic tolerance may be too small for damped dynamics
Self-explanatory.
Fix qeq/fire tolerance may be too small for damped fires
Self-explanatory.
Fix rattle should come after all other integration fixes
This fix is designed to work after all other integration fixes change atom
positions. Thus it should be the last integration fix specified. If not, it will not
satisfy the desired constraints as well as it otherwise would.
Fix recenter should come after all other integration fixes
Other fixes may change the position of the center-of-mass, so fix recenter
should come last.
Fix srd SRD moves may trigger frequent reneighboring
This is because the SRD particles may move long distances.
Fix srd grid size > 1/4 of big particle diameter
This may cause accuracy problems.
Fix srd particle moved outside valid domain
This may indicate a problem with your simulation parameters.
Fix srd particles may move > big particle diameter
This may cause accuracy problems.
Fix srd viscosity < 0.0 due to low SRD density
This may cause accuracy problems.
Fix thermal/conductivity comes before fix ave/spatial
The order of these 2 fixes in your input script is such that fix
thermal/conductivity comes first. If you are using fix ave/spatial to measure the
temperature profile induced by fix viscosity, then this may cause a glitch in the
profile since you are averaging immediately after swaps have occurred. Flipping
the order of the 2 fixes typically helps.
Fix viscosity comes before fix ave/spatial
The order of these 2 fixes in your input script is such that fix viscosity comes
first. If you are using fix ave/spatial to measure the velocity profile induced by
356

LAMMPS Users Manual
fix viscosity, then this may cause a glitch in the profile since you are averaging
immediately after swaps have occurred. Flipping the order of the 2 fixes
typically helps.
Fixes cannot send data in Kokkos communication, switching to classic communication
This is current restriction with Kokkos.
For better accuracy use 'pair_modify table 0'
The user-specified force accuracy cannot be achieved unless the table feature is
disabled by using 'pair_modify table 0'.
Geometric mixing assumed for 1/r^6 coefficients
Self-explanatory.
Group for fix_modify temp != fix group
The fix_modify command is specifying a temperature computation that
computes a temperature on a different group of atoms than the fix itself
operates on. This is probably not what you want to do.
H matrix size has been exceeded: m_fill=%d H.m=%d\n
This is the size of the matrix.
Ignoring unknown or incorrect info command flag
Self-explanatory. An unknown argument was given to the info command.
Compare your input with the documentation.
Improper atoms missing at step %ld
One or more of 4 atoms needed to compute a particular improper are missing
on this processor. Typically this is because the pairwise cutoff is set too short or
the improper has blown apart and an atom is too far away.
Improper problem: %d %ld %d %d %d %d
Conformation of the 4 listed improper atoms is extreme; you may want to check
Improper style in data file differs from currently defined improper style
Self-explanatory.
Inconsistent image flags
The image flags for a pair on bonded atoms appear to be inconsistent.
Inconsistent means that when the coordinates of the two atoms are unwrapped
using the image flags, the two atoms are far apart. Specifically they are further
apart than half a periodic box length. Or they are more than a box length apart
in a non-periodic dimension. This is usually due to the initial data file not having
correct image flags for the 2 atoms in a bond that straddles a periodic
boundary. They should be different by 1 in that case. This is a warning because
inconsistent image flags will not cause problems for dynamics or most LAMMPS
simulations. However they can cause problems when such atoms are used with
the fix rigid or replicate commands. Note that if you have an infinite periodic
crystal with bonds then it is impossible to have fully consistent image flags,
since some bonds will cross periodic boundaries and connect two atoms with
the same image flag.
KIM Model does not provide 'energy'; Potential energy will be zero
Self-explanatory.
KIM Model does not provide 'forces'; Forces will be zero
Self-explanatory.
KIM Model does not provide 'particleEnergy'; energy per atom will be zero
Self-explanatory.
KIM Model does not provide 'particleVirial'; virial per atom will be zero
Self-explanatory.
Kspace_modify slab param < 2.0 may cause unphysical behavior
357

LAMMPS Users Manual
The kspace_modify slab parameter should be larger to insure periodic grids
padded with empty space do not overlap.
Less insertions than requested
The fix pour command was unsuccessful at finding open space for as many
particles as it tried to insert.
Library error in lammps_gather_atoms
This library function cannot be used if atom IDs are not defined or are not
consecutively numbered.
Library error in lammps_scatter_atoms
This library function cannot be used if atom IDs are not defined or are not
consecutively numbered, or if no atom map is defined. See the atom_modify
command for details about atom maps.
Lost atoms via change_box: original %ld current %ld
The command options you have used caused atoms to be lost.
Lost atoms via displace_atoms: original %ld current %ld
The command options you have used caused atoms to be lost.
Lost atoms: original %ld current %ld
Lost atoms are checked for each time thermo output is done. See the
thermo_modify lost command for options. Lost atoms usually indicate bad
dynamics, e.g. atoms have been blown far out of the simulation box, or moved
further than one processor's sub-domain away before reneighboring.
MSM mesh too small, increasing to 2 points in each direction
Self-explanatory.
Mismatch between velocity and compute groups
The temperature computation used by the velocity command will not be on the
same group of atoms that velocities are being set for.
Mixing forced for lj coefficients
Self-explanatory.
Molecule attributes do not match system attributes
An attribute is specified (e.g. diameter, charge) that is not defined for the
specified atom style.
Molecule has bond topology but no special bond settings
This means the bonded atoms will not be excluded in pair-wise interactions.
Molecule template for create_atoms has multiple molecules
The create_atoms command will only create molecules of a single type, i.e. the
first molecule in the template.
Molecule template for fix gcmc has multiple molecules
The fix gcmc command will only create molecules of a single type, i.e. the first
molecule in the template.
Molecule template for fix shake has multiple molecules
The fix shake command will only recognize molecules of a single type, i.e. the
first molecule in the template.
More than one compute centro/atom
It is not efficient to use compute centro/atom more than once.
More than one compute cluster/atom
It is not efficient to use compute cluster/atom more than once.
More than one compute cna/atom defined
It is not efficient to use compute cna/atom more than once.
More than one compute contact/atom
It is not efficient to use compute contact/atom more than once.
More than one compute coord/atom
358

LAMMPS Users Manual
It is not efficient to use compute coord/atom more than once.
More than one compute damage/atom
It is not efficient to use compute ke/atom more than once.
More than one compute dilatation/atom
Self-explanatory.
More than one compute erotate/sphere/atom
It is not efficient to use compute erorate/sphere/atom more than once.
More than one compute hexorder/atom
It is not efficient to use compute hexorder/atom more than once.
More than one compute ke/atom
It is not efficient to use compute ke/atom more than once.
More than one compute orientorder/atom
It is not efficient to use compute orientorder/atom more than once.
More than one compute plasticity/atom
Self-explanatory.
More than one compute sna/atom
Self-explanatory.
Self-explanatory.
More than one compute snav/atom
Self-explanatory.
More than one fix poems
It is not efficient to use fix poems more than once.
More than one fix rigid
It is not efficient to use fix rigid more than once.
Neighbor exclusions used with KSpace solver may give inconsistent Coulombic
energies
This is because excluding specific pair interactions also excludes them from
long-range interactions which may not be the desired effect. The special_bonds
command handles this consistently by insuring excluded (or weighted) 1-2, 1-3,
1-4 interactions are treated consistently by both the short-range pair style and
the long-range solver. This is not done for exclusions of charged atom pairs via
the neigh_modify exclude command.
New thermo_style command, previous thermo_modify settings will be lost
If a thermo_style command is used after a thermo_modify command, the
settings changed by the thermo_modify command will be reset to their default
values. This is because the thermo_modify command acts on the currently
defined thermo style, and a thermo_style command creates a new style.
No Kspace calculation with verlet/split
The 2nd partition performs a kspace calculation so the kspace_style command
must be used.
No automatic unit conversion to XTC file format conventions possible for units lj
This means no scaling will be performed.
No fixes defined, atoms won't move
If you are not using a fix like nve, nvt, npt then atom velocities and coordinates
will not be updated during timestepping.
No joints between rigid bodies, use fix rigid instead
The bodies defined by fix poems are not connected by joints. POEMS will
integrate the body motion, but it would be more efficient to use fix rigid.
Not using real units with pair reax
359

LAMMPS Users Manual
This is most likely an error, unless you have created your own ReaxFF
parameter file in a different set of units.
Number of MSM mesh points changed to be a multiple of 2
MSM requires that the number of grid points in each direction be a multiple of
two and the number of grid points in one or more directions have been adjusted
to meet this requirement.
This environment variable must be set appropriately to use the USER-OMP
package.
One or more atoms are time integrated more than once
This is probably an error since you typically do not want to advance the
positions or velocities of an atom more than once per timestep.
One or more chunks do not contain all atoms in molecule
This may not be what you intended.
One or more dynamic groups may not be updated at correct point in timestep
If there are other fixes that act immediately after the initial stage of time
integration within a timestep (i.e. after atoms move), then the command that
sets up the dynamic group should appear after those fixes. This will insure that
dynamic group assignments are made after all atoms have moved.
One or more respa levels compute no forces
This is computationally inefficient.
Pair COMB charge %.10f with force %.10f hit max barrier
Something is possibly wrong with your model.
Pair COMB charge %.10f with force %.10f hit min barrier
Something is possibly wrong with your model.
Pair brownian needs newton pair on for momentum conservation
Self-explanatory.
Pair dpd needs newton pair on for momentum conservation
Self-explanatory.
Pair dsmc: num_of_collisions > number_of_A
Collision model in DSMC is breaking down.
Pair dsmc: num_of_collisions > number_of_B
Collision model in DSMC is breaking down.
Pair style in data file differs from currently defined pair style
Self-explanatory.
Particle deposition was unsuccessful
The fix deposit command was not able to insert as many atoms as needed. The
requested volume fraction may be too high, or other atoms may be in the
insertion region.
Proc sub-domain size < neighbor skin, could lead to lost atoms
The decomposition of the physical domain (likely due to load balancing) has led
to a processor's sub-domain being smaller than the neighbor skin in one or
more dimensions. Since reneighboring is triggered by atoms moving the skin
distance, this may lead to lost atoms, if an atom moves all the way across a
neighboring processor's sub-domain before reneighboring is triggered.
Reducing PPPM order b/c stencil extends beyond nearest neighbor processor
This may lead to a larger grid than desired. See the kspace_modify overlap
command to prevent changing of the PPPM order.
Reducing PPPMDisp Coulomb order b/c stencil extends beyond neighbor processor
This may lead to a larger grid than desired. See the kspace_modify overlap
command to prevent changing of the PPPM order.
360

LAMMPS Users Manual
Reducing PPPMDisp dispersion order b/c stencil extends beyond neighbor processor
This may lead to a larger grid than desired. See the kspace_modify overlap
command to prevent changing of the PPPM order.
Replacing a fix, but new group != old group
The ID and style of a fix match for a fix you are changing with a fix command,
but the new group you are specifying does not match the old group.
Replicating in a non-periodic dimension
The parameters for a replicate command will cause a non-periodic dimension to
be replicated; this may cause unwanted behavior.
Resetting reneighboring criteria during PRD
A PRD simulation requires that neigh_modify settings be delay = 0, every = 1,
check = yes. Since these settings were not in place, LAMMPS changed them
and will restore them to their original values after the PRD simulation.
A TAD simulation requires that neigh_modify settings be delay = 0, every = 1,
check = yes. Since these settings were not in place, LAMMPS changed them
and will restore them to their original values after the PRD simulation.
Resetting reneighboring criteria during minimization
Minimization requires that neigh_modify settings be delay = 0, every = 1, check
= yes. Since these settings were not in place, LAMMPS changed them and will
restore them to their original values after the minimization.
Restart file used different # of processors
The restart file was written out by a LAMMPS simulation running on a different
number of processors. Due to round-off, the trajectories of your restarted
simulation may diverge a little more quickly than if you ran on the same # of
processors.
Restart file used different 3d processor grid
The restart file was written out by a LAMMPS simulation running on a different
3d grid of processors. Due to round-off, the trajectories of your restarted
simulation may diverge a little more quickly than if you ran on the same # of
processors.
Restart file used different boundary settings, using restart file values
Your input script cannot change these restart file settings.
Restart file used different newton bond setting, using restart file value
The restart file value will override the setting in the input script.
Restart file used different newton pair setting, using input script value
The input script value will override the setting in the restart file.
Restrain problem: %d %ld %d %d %d %d
Conformation of the 4 listed dihedral atoms is extreme; you may want to check
Running PRD with only one replica
This is allowed, but you will get no parallel speed-up.
SRD bin shifting turned on due to small lamda
This is done to try to preserve accuracy.
SRD bin size for fix srd differs from user request
Fix SRD had to adjust the bin size to fit the simulation box. See the cubic
keyword if you want this message to be an error vs warning.
SRD bins for fix srd are not cubic enough
The bin shape is not within tolerance of cubic. See the cubic keyword if you
want this message to be an error vs warning.
SRD particle %d started inside big particle %d on step %ld bounce %d
361

LAMMPS Users Manual
See the inside keyword if you want this message to be an error vs warning.
SRD particle %d started inside wall %d on step %ld bounce %d
See the inside keyword if you want this message to be an error vs warning.
Shake determinant < 0.0
The determinant of the quadratic equation being solved for a single cluster
specified by the fix shake command is numerically suspect. LAMMPS will set it
to 0.0 and continue.
Shell command '%s' failed with error '%s'
Self-explanatory.
Shell command returned with non-zero status
This may indicate the shell command did not operate as expected.
Should not allow rigid bodies to bounce off relecting walls
LAMMPS allows this, but their dynamics are not computed correctly.
Should not use fix nve/limit with fix shake or fix rattle
This will lead to invalid constraint forces in the SHAKE/RATTLE computation.
Simulations might be very slow because of large number of structure factors
Self-explanatory.
Slab correction not needed for MSM
Slab correction is intended to be used with Ewald or PPPM and is not needed by
MSM.
System is not charge neutral, net charge = %g
The total charge on all atoms on the system is not 0.0. For some KSpace solvers
this is only a warning.
Table inner cutoff >= outer cutoff
You specified an inner cutoff for a Coulombic table that is longer than the global
cutoff. Probably not what you wanted.
Temperature for MSST is not for group all
User-assigned temperature to MSST fix does not compute temperature for all
atoms. Since MSST computes a global pressure, the kinetic energy contribution
from the temperature is assumed to also be for all atoms. Thus the pressure
used by MSST could be inaccurate.
Temperature for NPT is not for group all
User-assigned temperature to NPT fix does not compute temperature for all
atoms. Since NPT computes a global pressure, the kinetic energy contribution
from the temperature is assumed to also be for all atoms. Thus the pressure
used by NPT could be inaccurate.
Temperature for fix modify is not for group all
The temperature compute is being used with a pressure calculation which does
operate on group all, so this may be inconsistent.
Temperature for thermo pressure is not for group all
User-assigned temperature to thermo via the thermo_modify command does not
compute temperature for all atoms. Since thermo computes a global pressure,
the kinetic energy contribution from the temperature is assumed to also be for
all atoms. Thus the pressure printed by thermo could be inaccurate.
The fix ave/spatial command has been replaced by the more flexible fix ave/chunk and
compute chunk/atom commands -- fix ave/spatial will be removed in the summer of
2015
Self-explanatory.
The minimizer does not re-orient dipoles when using fix efield
This means that only the atom coordinates will be minimized, not the
orientation of the dipoles.
362

LAMMPS Users Manual
Too many common neighbors in CNA %d times
More than the maximum # of neighbors was found multiple times. This was
unexpected.
Too many inner timesteps in fix ttm
Self-explanatory.
Too many neighbors in CNA for %d atoms
More than the maximum # of neighbors was found multiple times. This was
unexpected.
Triclinic box skew is large
The displacement in a skewed direction is normally required to be less than half
the box length in that dimension. E.g. the xy tilt must be between -half and
+half of the x box length. You have relaxed the constraint using the box tilt
command, but the warning means that a LAMMPS simulation may be inefficient
as a result.
Use special bonds = 0,1,1 with bond style fene
Most FENE models need this setting for the special_bonds command.
Use special bonds = 0,1,1 with bond style fene/expand
Most FENE models need this setting for the special_bonds command.
Using a manybody potential with bonds/angles/dihedrals and special_bond exclusions
This is likely not what you want to do. The exclusion settings will eliminate
neighbors in the neighbor list, which the manybody potential needs to
calculated its terms correctly.
Using compute temp/deform with inconsistent fix deform remap option
Fix nvt/sllod assumes deforming atoms have a velocity profile provided by
"remap v" or "remap none" as a fix deform option.
Using compute temp/deform with no fix deform defined
This is probably an error, since it makes little sense to use compute
temp/deform in this case.
Using fix srd with box deformation but no SRD thermostat
The deformation will heat the SRD particles so this can be dangerous.
Using kspace solver on system with no charge
Self-explanatory.
Using largest cut-off for lj/long/dipole/long long long
Self-explanatory.
Using largest cutoff for buck/long/coul/long
Self-explanatory.
Using largest cutoff for lj/long/coul/long
Self-explanatory.
Using largest cutoff for pair_style lj/long/tip4p/long
Self-explanatory.
Using package gpu without any pair style defined
Self-explanatory.
Using pair potential shift with pair_modify compute no
The shift effects will thus not be computed.
Using pair tail corrections with nonperiodic system
This is probably a bogus thing to do, since tail corrections are computed by
integrating the density of a periodic system out to infinity.
Using pair tail corrections with pair_modify compute no
The tail corrections will thus not be computed.
pair style reax is now deprecated and will soon be retired. Users should switch to
pair_style reax/c
363

LAMMPS Users Manual
Self-explanatory.

364

LAMMPS Users Manual
Previous Section - LAMMPS WWW Site - LAMMPS Documentation - LAMMPS
Commands - Next Section

13. Future and history
This section lists features we plan to add to LAMMPS, features of previous versions of
LAMMPS, and features of other parallel molecular dynamics codes our group has
distributed.
13.1 Coming attractions
13.2 Past versions

13.1 Coming attractions
As of summer 2016 we are using the LAMMPS project issue tracker on GitHub for
keeping track of suggested, planned or pending new features. This includes
discussions of how to best implement them, or why they would be useful. Especially if
a planned or proposed feature is non-trivial to add, e.g. because it requires changes to
some of the core classes of LAMMPS, people planning to contribute a new feature to
LAMMS are encouraged to submit an issue about their planned implementation this
way in order to receive feedback from the LAMMPS core developers. They will provide
suggestions about the validity of the proposed approach and possible improvements,
pitfalls or alternatives.
Please see some of the closed issues for examples of how to suggest code
enhancements, submit proposed changes, or report possible bugs and how they are
resolved.
As an alternative to using GitHub, you may e-mail the core developers or send an
e-mail to the LAMMPS Mail list if you want to have your suggestion added to the list.
13.2 Past versions
LAMMPS development began in the mid 1990s under a cooperative research &
development agreement (CRADA) between two DOE labs (Sandia and LLNL) and 3
companies (Cray, Bristol Myers Squibb, and Dupont). The goal was to develop a
large-scale parallel classical MD code; the coding effort was led by Steve Plimpton at
Sandia.
After the CRADA ended, a final F77 version, LAMMPS 99, was released. As
development of LAMMPS continued at Sandia, its memory management was
converted to F90; a final F90 version was released as LAMMPS 2001.
The current LAMMPS is a rewrite in C++ and was first publicly released as an open
source code in 2004. It includes many new features beyond those in LAMMPS 99 or
2001. It also includes features from older parallel MD codes written at Sandia, namely
ParaDyn, Warp, and GranFlow (see below).

365

LAMMPS Users Manual
In late 2006 we began merging new capabilities into LAMMPS that were developed by
Aidan Thompson at Sandia for his MD code GRASP, which has a parallel framework
similar to LAMMPS. Most notably, these have included many-body potentials Stillinger-Weber, Tersoff, ReaxFF - and the associated charge-equilibration routines
needed for ReaxFF.
The History link on the LAMMPS WWW page gives a timeline of features added to the
C++ open-source version of LAMMPS over the last several years.
These older codes are available for download from the LAMMPS WWW site, except for
Warp & GranFlow which were primarily used internally. A brief listing of their
features is given here.
LAMMPS 2001
• F90 + MPI
• dynamic memory
• spatial-decomposition parallelism
• NVE, NVT, NPT, NPH, rRESPA integrators
• LJ and Coulombic pairwise force fields
• all-atom, united-atom, bead-spring polymer force fields
• CHARMM-compatible force fields
• class 2 force fields
• 3d/2d Ewald & PPPM
• various force and temperature constraints
• SHAKE
• Hessian-free truncated-Newton minimizer
• user-defined diagnostics
LAMMPS 99
• F77 + MPI
• static memory allocation
• spatial-decomposition parallelism
• most of the LAMMPS 2001 features with a few exceptions
• no 2d Ewald & PPPM
• molecular force fields are missing a few CHARMM terms
• no SHAKE
Warp
• F90 + MPI
• spatial-decomposition parallelism
• embedded atom method (EAM) metal potentials + LJ
• lattice and grain-boundary atom creation
• NVE, NVT integrators
• boundary conditions for applying shear stresses
• temperature controls for actively sheared systems
• per-atom energy and centro-symmetry computation and output
366

LAMMPS Users Manual
• F77 + MPI
• atom- and force-decomposition parallelism
• embedded atom method (EAM) metal potentials
• lattice atom creation
• NVE, NVT, NPT integrators
• all serial DYNAMO features for controls and constraints
GranFlow
• F90 + MPI
• spatial-decomposition parallelism
• frictional granular potentials
• NVE integrator
• boundary conditions for granular flow and packing and walls
• particle insertion

367

LAMMPS Users Manual

Tutorials
The following pages contain some in-depth tutorials for selected topics, that did not fit
into any other place in the manual.

368

LAMMPS Users Manual
LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

Using LAMMPS with Bash on Windows
written by Richard Berger
Starting with Windows 10 you can install Linux tools directly in Windows. This allows
you to compile LAMMPS following the same procedure as on a real Ubuntu Linux
installation. Software can be easily installed using the package manager via apt-get
and all files are accessible in both the Windows Explorer and your Linux shell (bash).
This avoids switching to a different operating system or installing a virtual machine.
Everything runs on Windows.
Installing Bash on Windows
Prerequisites

• Windows 10 (64bit only)
Enable developer mode

You enable this feature by first opening Windows Settings and enabling Developer
mode. Go to the Windows settings and search for "developer". This will allow you to
install software which comes from outside of the Windows Store. You might be

369

LAMMPS Users Manual

Install Windows Subsystem for Linux

Next you must ensure that the Window Subsystem for Linux is installed. Again, search
for "enable windows features" in the Settings dialog. This opens a dialog with a list of
features you can install. Add a checkmark to Windows Subsystem for Linux (Beta) and
press OK.

370

LAMMPS Users Manual

Install Bash for Windows

After installation completes, type "bash" in the Windows Start menu search. Select the
first found option. This will launch a command-line window which will prompt you
about installing Ubuntu on Windows. Confirm with "y" and press enter. This will then

371

LAMMPS Users Manual

372

LAMMPS Users Manual

During installation, you will be asked for a new password. This will be used for
installing new software and running commands with sudo.

373

LAMMPS Users Manual

Type exit to close the command-line window.
Go to the Start menu and type "bash" again. This time you will see a "Bash on Ubuntu
on Windows" Icon. Start this program.

374

LAMMPS Users Manual

Congratulations, you have installed Bash on Ubuntu on Windows.

375

LAMMPS Users Manual

Compiling LAMMPS in Bash on Windows
The installation of LAMMPS in this environment is identical to working inside of a real
Ubuntu Linux installation. At the time writing, it uses Ubuntu 16.04.
Installing prerequisite packages

First upgrade all existing packages using
sudo apt update

Next install the following packages, which include compilers and libraries needed for
various LAMMPS features:

sudo apt install -y build-essential ccache gfortran openmpi-bin libopenmpi-dev libfftw3-dev lib
Files in Ubuntu on Windows

When you launch "Bash on Ubuntu on Windows" you will start out in your Linux user

376

LAMMPS Users Manual

Obtain a copy of the LAMMPS code and go into it using "cd"

wget http://lammps.sandia.gov/tars/lammps-stable.tar.gz
tar xvzf lammps-stable.tar.gz
cd lammps-31Mar17
Option 2: Obtaining LAMMPS code from GitHub

git clone https://github.com/lammps/lammps.git
cd lammps
Compiling LAMMPS

At this point you can compile LAMMPS like on Ubuntu Linux.
Compiling serial version

cd src/
make -j 4 serial

This will create an executable called lmp_serial in the src/ directory
Compiling MPI version

cd src/
make -j 4 mpi

This will create an executable called lmp_mpi in the src/ directory
Finally, please note the absolute path of your src folder. You can get this using
pwd

or
echo $PWD To run any examples you need the location of the executable. For now, let us save this location in a temporary variable LAMMPS_DIR=$PWD
Running an example script

Once compiled you can execute some of the LAMMPS examples. Switch into the
examples/melt folder
cd ../examples/melt

377

LAMMPS Users Manual
The full path of the serial executable is $LAMMPS_DIR/lmp_serial, while the mpi version is$LAMMPS_DIR/lmp_mpi. You can run the melt example with either version
as follows:
$LAMMPS_DIR/lmp_serial -in in.melt or mpirun -np 4$LAMMPS_DIR/lmp_mpi -in in.melt

Note the use of our variable $LAMMPS_DIR, which expands into the full path of the LAMMPS src folder we saved earlier. Adding your executable directory to your PATH You can avoid having to type the full path of your LAMMPS binary by adding its parent folder to the PATH environment variable as follows: export PATH=$LAMMPS_DIR:$PATH Input scripts can then be run like this: lmp_serial -in in.melt or mpirun -np 4 lmp_mpi -in in.melt However, this PATH variable will not persist if you close your bash window. To persist this setting edit the$HOME/.bashrc file using your favorite editor and add this line
export PATH=/full/path/to/your/lammps/src:$PATH Example: For an executable lmp_serial with a full path /home/richard/lammps/src/lmp_serial the PATH variable should be export PATH=/home/richard/lammps/src:$PATH

NOTE: This should give you a jump start when trying to run LAMMPS on Windows. To
become effective in this environment I encourage you to look into Linux tutorials
explaining Bash and Basic Unix commands (e.g., Linux Journey)

378

LAMMPS Users Manual
LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

Tutorial for Thermalized Drude oscillators in LAMMPS
This tutorial explains how to use Drude oscillators in LAMMPS to simulate polarizable
systems using the USER-DRUDE package. As an illustration, the input files for a
simulation of 250 phenol molecules are documented. First of all, LAMMPS has to be
compiled with the USER-DRUDE package activated. Then, the data file and input
scripts have to be modified to include the Drude dipoles and how to handle them.
Overview of Drude induced dipoles
Polarizable atoms acquire an induced electric dipole moment under the action of an
external electric field, for example the electric field created by the surrounding
particles. Drude oscillators represent these dipoles by two fixed charges: the core
(DC) and the Drude particle (DP) bound by a harmonic potential. The Drude particle
can be thought of as the electron cloud whose center can be displaced from the
position of the corresponding nucleus.
The sum of the masses of a core-Drude pair should be the mass of the initial (unsplit)
atom, $$m_C + m_D = m$$. The sum of their charges should be the charge of the initial
(unsplit) atom, $$q_C + q_D = q$$. A harmonic potential between the core and Drude
partners should be present, with force constant $$k_D$$ and an equilibrium distance of
zero. The (half-)stiffness of the harmonic bond $$K_D = k_D/2$$ and the Drude charge
$$q_D$$ are related to the atom polarizability $$\alpha$$ by
$$K_D = \frac 1 2\, \frac {q_D^2} \alpha$$
Ideally, the mass of the Drude particle should be small, and the stiffness of the
harmonic bond should be large, so that the Drude particle remains close ot the core.
The values of Drude mass, Drude charge, and force constant can be chosen following
different strategies, as in the following examples of polarizable force fields:
• Lamoureux and Roux suggest adopting a global half-stiffness, $$K_D$$ = 500
kcal/(mol Ang $${}^2$$) - which corresponds to a force constant $$k_D$$ = 4184
kJ/(mol Ang $${}^2$$) - for all types of core-Drude bond, a global mass $$m_D$$ =
0.4 g/mol (or u) for all types of Drude particles, and to calculate the Drude
charges for individual atom types from the atom polarizabilities using equation
(1). This choice is followed in the polarizable CHARMM force field.
• Alternately Schroeder and Steinhauser suggest adopting a global charge $$q_D$$
= -1.0e and a global mass $$m_D$$ = 0.1 g/mol (or u) for all Drude particles, and
to calculate the force constant for each type of core-Drude bond from equation
(1). The timesteps used by these authors are between 0.5 and 2 fs, with the
degrees of freedom of the Drude oscillators kept cold at 1 K.
• In both these force fields hydrogen atoms are treated as non-polarizable.
The motion of of the Drude particles can be calculated by minimizing the energy of the
induced dipoles at each timestep, by an iterative, self-consistent procedure. The Drude
particles can be massless and therefore do not contribute to the kinetic energy.
However, the relaxed method is computational slow. An extended-lagrangian method
379

LAMMPS Users Manual
can be used to calculate the positions of the Drude particles, but this requires them to
have mass. It is important in this case to decouple the degrees of freedom associated
with the Drude oscillators from those of the normal atoms. Thermalizing the Drude
dipoles at temperatures comparable to the rest of the simulation leads to several
problems (kinetic energy transfer, very short timestep, etc.), which can be remediate
by the "cold Drude" technique (Lamoureux and Roux).
Two closely related models are used to represent polarization through "charges on a
spring": the core-shell model and the Drude model. Although the basic idea is the
same, the core-shell model is normally used for ionic/crystalline materials, whereas
the Drude model is normally used for molecular systems and fluid states. In ionic
crystals the symmetry around each ion and the distance between them are such that
the core-shell model is sufficiently stable. But to be applicable to molecular/covalent
systems the Drude model includes two important features:
1. The possibility to thermostat the additional degrees of freedom associated with
the induced dipoles at very low temperature, in terms of the reduced
coordinates of the Drude particles with respect to their cores. This makes the
trajectory close to that of relaxed induced dipoles.
2. The Drude dipoles on covalently bonded atoms interact too strongly due to the
short distances, so an atom may capture the Drude particle (shell) of a
neighbor, or the induced dipoles within the same molecule may align too much.
To avoid this, damping at short of the interactions between the point charges
composing the induced dipole can be done by Thole functions.
Preparation of the data file
The data file is similar to a standard LAMMPS data file for atom_style full. The DPs
and the harmonic bonds connecting them to their DC should appear in the data file as
normal atoms and bonds.
You can use the polarizer tool (Python script distributed with the USER-DRUDE
package) to convert a non-polarizable data file (here data.102494.lmp) to a polarizable
data file (data-p.lmp)
polarizer -q -f phenol.dff data.102494.lmp data-p.lmp

This will automatically insert the new atoms and bonds. The masses and charges of
DCs and DPs are computed from phenol.dff, as well as the DC-DP bond constants. The
file phenol.dff contains the polarizabilities of the atom types and the mass of the
Drude particles, for instance:
# units: kJ/mol, A, deg
# kforce is in the form k/2 r_D^2
# type m_D/u
q_D/e
k_D
alpha/A3
OH
0.4
-1.0
4184.0
0.63
CA
0.4
-1.0
4184.0
1.36
CAI
0.4
-1.0
4184.0
1.09

thole
0.67
2.51
2.51

The hydrogen atoms are absent from this file, so they will be treated as
non-polarizable atoms. In the non-polarizable data file data.102494.lmp, atom names
corresponding to the atom type numbers have to be specified as comments at the end
380

LAMMPS Users Manual
of lines of the Masses section. You probably need to edit it to add these names. It
should look like
Masses
1
2
3
4
5

12.011
12.011
15.999
1.008
1.008

#
#
#
#
#

CAI
CA
OH
HA
HO

Basic input file
The atom style should be set to (or derive from) full, so that you can define atomic
charges and molecular bonds, angles, dihedrals...
The polarizer tool also outputs certain lines related to the input script (the use of
these lines will be explained below). In order for LAMMPS to recognize that you are
using Drude oscillators, you should use the fix drude. The command is
fix DRUDE all drude C C C N N D D D

The N, C, D following the drude keyword have the following meaning: There is one tag
for each atom type. This tag is C for DCs, D for DPs and N for non-polarizable atoms.
Here the atom types 1 to 3 (C and O atoms) are DC, atom types 4 and 5 (H atoms) are
non-polarizable and the atom types 6 to 8 are the newly created DPs.
By recognizing the fix drude, LAMMPS will find and store matching DC-DP pairs and
will treat DP as equivalent to their DC in the special bonds relations. It may be
necessary to extend the space for storing such special relations. In this case extra
space should be reserved by using the extra/special/per/atom keyword of either the
read_data or create_box command. With our phenol, there is 1 more special neighbor
for which space is required. Otherwise LAMMPS crashes and gives the required value.

Let us assume we want to run a simple NVT simulation at 300 K. Note that Drude
oscillators need to be thermalized at a low temperature in order to approximate a
self-consistent field (SCF), therefore it is not possible to simulate an NVE ensemble
with this package. Since dipoles are approximated by a charged DC-DP pair, the
pair_style must include Coulomb interactions, for instance lj/cut/coul/long with
kspace_style pppm. For example, with a cutoff of 10. and a precision 1.e-4:
pair_style lj/cut/coul/long 10.0
kspace_style pppm 1.0e-4

As compared to the non-polarizable input file, pair_coeff lines need to be added for the
DPs. Since the DPs have no Lennard-Jones interactions, their epsilon is 0. so the only
pair_coeff line that needs to be added is
pair_coeff * 6* 0.0 0.0 # All-DPs

381

LAMMPS Users Manual
Now for the thermalization, the simplest choice is to use the fix langevin/drude.
fix LANG all langevin/drude 300. 100 12435 1. 20 13977

This applies a Langevin thermostat at temperature 300. to the centers of mass of the
DC-DP pairs, with relaxation time 100 and with random seed 12345. This fix applies
also a Langevin thermostat at temperature 1. to the relative motion of the DPs around
their DCs, with relaxation time 20 and random seed 13977. Only the DCs and
non-polarizable atoms need to be in this fix's group. LAMMPS will thermostate the
DPs together with their DC. For this, ghost atoms need to know their velocities. Thus
you need to add the following command:
comm_modify vel yes

In order to avoid that the center of mass of the whole system drifts due to the random
forces of the Langevin thermostat on DCs, you can add the zero yes option at the end
of the fix line.
If the fix shake is used to constrain the C-H bonds, it should be invoked after the fix
langevin/drude for more accuracy.
fix SHAKE ATOMS shake 0.0001 20 0 t 4 5

NOTE: The group of the fix shake must not include the DPs. If the group ATOMS is
defined by non-DPs atom types, you could use
Since the fix langevin/drude does not perform time integration (just modification of
forces but no position/velocity updates), the fix nve should be used in conjunction.
fix NVE all nve

Finally, do not forget to update the atom type elements if you use them in a
dump_modify ... element ... command, by adding the element type of the DPs. Here for
instance
dump DUMP all custom 10 dump.lammpstrj id mol type element x y z ix iy iz
dump_modify DUMP element C C O H H D D D

The input file should now be ready for use!
You will notice that the global temperature thermo_temp computed by LAMMPS is not
300. K as wanted. This is because LAMMPS treats DPs as standard atoms in his
default compute. If you want to output the temperatures of the DC-DP pair centers of
mass and of the DPs relative to their DCs, you should use the compute temp_drude
compute TDRUDE all temp/drude

And then output the correct temperatures of the Drude oscillators using thermo_style
custom with respectively c_TDRUDE[1] and c_TDRUDE[2]. These should be close to
300.0 and 1.0 on average.
thermo_style custom step temp c_TDRUDE[1] c_TDRUDE[2]

382

LAMMPS Users Manual
Thole screening
Dipolar interactions represented by point charges on springs may not be stable, for
example if the atomic polarizability is too high for instance, a DP can escape from its
DC and be captured by another DC, which makes the force and energy diverge and
the simulation crash. Even without reaching this extreme case, the correlation
between nearby dipoles on the same molecule may be exaggerated. Often, special
bond relations prevent bonded neighboring atoms to see the charge of each other's
DP, so that the problem does not always appear. It is possible to use screened dipole
dipole interactions by using the pair_style thole. This is implemented as a correction
to the Coulomb pair_styles, which dampens at short distance the interactions between
the charges representing the induced dipoles. It is to be used as hybrid/overlay with
any standard coul pair style. In our example, we would use
pair_style hybrid/overlay lj/cut/coul/long 10.0 thole 2.6 10.0

This tells LAMMPS that we are using two pair_styles. The first one is as above
(lj/cut/coul/long 10.0). The second one is a thole pair_style with default screening
factor 2.6 (Noskov) and cutoff 10.0.
Since hybrid/overlay does not support mixing rules, the interaction coefficients of all
the pairs of atom types with i < j should be explicitly defined. The output of the
polarizer script can be used to complete the pair_coeff section of the input file. In our
example, this will look like:
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff
pair_coeff

1
1
1
1
2
2
2
3
3
4
*
*
1
1
1
1
1
1
2
2
2
2
2
3
3
3
3
6
6
6

1
2
3
4
2
3
4
3
4
4
5
6*
1
2
3
6
7
8
2
3
6
7
8
3
6
7
8
6
7
8

lj/cut/coul/long
0.0700
lj/cut/coul/long
0.0700
lj/cut/coul/long
0.1091
lj/cut/coul/long
0.0458
lj/cut/coul/long
0.0700
lj/cut/coul/long
0.1091
lj/cut/coul/long
0.0458
lj/cut/coul/long
0.1700
lj/cut/coul/long
0.0714
lj/cut/coul/long
0.0300
lj/cut/coul/long
0.0000
lj/cut/coul/long
0.0000
thole
1.090
2.510
thole
1.218
2.510
thole
0.829
1.590
thole
1.090
2.510
thole
1.218
2.510
thole
0.829
1.590
thole
1.360
2.510
thole
0.926
1.590
thole
1.218
2.510
thole
1.360
2.510
thole
0.926
1.590
thole
0.630
0.670
thole
0.829
1.590
thole
0.926
1.590
thole
0.630
0.670
thole
1.090
2.510
thole
1.218
2.510
thole
0.829
1.590

3.550
3.550
3.310
2.985
3.550
3.310
2.985
3.070
2.745
2.420
0.000
0.000

383

LAMMPS Users Manual
pair_coeff
pair_coeff
pair_coeff

7
7
8

7 thole
8 thole
8 thole

1.360
0.926
0.630

2.510
1.590
0.670

For the thole pair style the coefficients are
1. the atom polarizability in units of cubic length
2. the screening factor of the Thole function (optional, default value specified by
the pair_style command)
3. the cutoff (optional, default value defined by the pair_style command)
The special neighbors have charge-charge and charge-dipole interactions screened by
the coul factors of the special_bonds command (0.0, 0.0, and 0.5 in the example
above). Without using the pair_style thole, dipole-dipole interactions are screened by
the same factor. By using the pair_style thole, dipole-dipole interactions are screened
by Thole's function, whatever their special relationship (except within each DC-DP
pair of course). Consider for example 1-2 neighbors: using the pair_style thole, their
dipoles will see each other (despite the coul factor being 0.) and the interactions
between these dipoles will be damped by Thole's function.
Thermostats and barostats
Using a Nose-Hoover barostat with the langevin/drude thermostat is straightforward
using fix nph instead of nve. For example:
fix NPH all nph iso 1. 1. 500

It is also possible to use a Nose-Hoover instead of a Langevin thermostat. This
requires to use fix drude/transform just before and after the time intergation fixes.
The fix drude/transform/direct converts the atomic masses, positions, velocities and
forces into a reduced representation, where the DCs transform into the centers of
mass of the DC-DP pairs and the DPs transform into their relative position with
respect to their DC. The fix drude/transform/inverse performs the reverse
transformation. For a NVT simulation, with the DCs and atoms at 300 K and the DPs
at 1 K relative to their DC one would use
fix
fix
fix
fix

DIRECT all drude/transform/direct
NVT1 ATOMS nvt temp 300. 300. 100
NVT2 DRUDES nvt temp 1. 1. 20
INVERSE all drude/transform/inverse

For our phenol example, the groups would be defined as
group ATOMS type 1 2 3 4 5 # DCs and non-polarizable atoms
group CORES type 1 2 3
# DCs
group DRUDES type 6 7 8
# DPs

Note that with the fixes drude/transform, it is not required to specify comm_modify vel
yes because the fixes do it anyway (several times and for the forces also). To avoid the
flying ice cube artifact (Lamoureux), where the atoms progressively freeze and the
center of mass of the whole system drifts faster and faster, the fix momentum can be
used. For instance:
384

LAMMPS Users Manual
fix MOMENTUM all momentum 100 linear 1 1 1

It is a bit more tricky to run a NPT simulation with Nose-Hoover barostat and
thermostat. First, the volume should be integrated only once. So the fix for DCs and
atoms should be npt while the fix for DPs should be nvt (or vice versa). Second, the fix
npt computes a global pressure and thus a global temperature whatever the fix group.
We do want the pressure to correspond to the whole system, but we want the
temperature to correspond to the fix group only. We must then use the fix_modify
command for this. In the