Manual

820
LAMMPS Users Manual Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov - Sandia National Laboratories Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.

Transcript of Manual

LAMMPS Users ManualLargescale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov Sandia National Laboratories Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.

LAMMPS Users Manual

Table of ContentsLAMMPS Documentation.............................................................................................................................1 1. Introduction................................................................................................................................................3 1.1 What is LAMMPS.............................................................................................................................3 1.2 LAMMPS features .............................................................................................................................4 General features.......................................................................................................................................4 Particle and model types ..........................................................................................................................4 Force fields..............................................................................................................................................4 Atom creation..........................................................................................................................................5 Ensembles, constraints, and boundary conditions...................................................................................5 Integrators................................................................................................................................................5 Diagnostics..............................................................................................................................................6 Output......................................................................................................................................................6 Multireplica models ...............................................................................................................................6 Pre and postprocessing........................................................................................................................6 Specialized features.................................................................................................................................6 1.3 LAMMPS nonfeatures....................................................................................................................6 1.4 Open source distribution ....................................................................................................................8 1.5 Acknowledgments and citations........................................................................................................9 2. Getting Started.........................................................................................................................................13 2.1 What's in the LAMMPS distribution...............................................................................................13 2.2 Making LAMMPS...........................................................................................................................13 2.3 Making LAMMPS with optional packages.....................................................................................18 2.4 Building LAMMPS as a library......................................................................................................21 2.5 Running LAMMPS.........................................................................................................................21 2.6 Commandline options...................................................................................................................23 2.7 LAMMPS screen output..................................................................................................................24 2.8 Running on GPUs............................................................................................................................26 GPU configuration .................................................................................................................................26 GPU input script....................................................................................................................................27 GPU asynchronous pair computation....................................................................................................27 GPU timing ............................................................................................................................................27 GPU single vs double precision............................................................................................................27 2.9 Tips for users of previous LAMMPS versions................................................................................27 3. Commands...............................................................................................................................................29 3.1 LAMMPS input script.....................................................................................................................29 3.2 Parsing rules....................................................................................................................................30 3.3 Input script structure........................................................................................................................30 3.4 Commands listed by category.........................................................................................................32 3.5 Individual commands......................................................................................................................32 Fix styles ................................................................................................................................................33 Compute styles......................................................................................................................................33 Pair_style potentials ...............................................................................................................................34 Bond_style potentials............................................................................................................................34 Angle_style potentials...........................................................................................................................35 Dihedral_style potentials.......................................................................................................................35 Improper_style potentials......................................................................................................................35 Kspace solvers.......................................................................................................................................35 4. Howto discussions.................................................................................................................................36 i

LAMMPS Users Manual

Table of Contents4.1 Restarting a simulation....................................................................................................................36 4.2 2d simulations ..................................................................................................................................37 4.3 CHARMM, AMBER, and DREIDING force fields.......................................................................38 4.4 Running multiple simulations from one input script.......................................................................39 4.5 Multireplica simulations ................................................................................................................40 4.6 Granular models..............................................................................................................................41 4.7 TIP3P water model..........................................................................................................................42 4.8 TIP4P water model..........................................................................................................................43 4.9 SPC water model.............................................................................................................................44 4.10 Coupling LAMMPS to other codes...............................................................................................44 4.11 Visualizing LAMMPS snapshots..................................................................................................46 4.12 Triclinic (nonorthogonal) simulation boxes................................................................................46 4.13 NEMD simulations........................................................................................................................48 4.14 Extended spherical and aspherical particles..................................................................................49 4.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables)..........................................51 4.16 Thermostatting, barostatting, and computing temperature............................................................55 4.17 Walls..............................................................................................................................................57 4.18 Elastic constants............................................................................................................................58 4.19 Library interface to LAMMPS......................................................................................................58 4.20 Calculating thermal conductivity..................................................................................................60 4.21 Calculating viscosity.....................................................................................................................60 5. Example problems ....................................................................................................................................63 6. Performance &scalability .........................................................................................................................65 7. Additional tools........................................................................................................................................66 amber2lmp tool .....................................................................................................................................66 . binary2txt tool.......................................................................................................................................67 ch2lmp tool............................................................................................................................................67 chain tool...............................................................................................................................................67 createatoms tool.....................................................................................................................................67 data2xmovie tool...................................................................................................................................68 eam database tool..................................................................................................................................68 eam generate tool...................................................................................................................................68 eff tool...................................................................................................................................................68 emacs tool..............................................................................................................................................68 ipp tool...................................................................................................................................................68 lmp2arc tool...........................................................................................................................................69 lmp2cfg tool..........................................................................................................................................69 . lmp2traj tool..........................................................................................................................................69 lmp2vmd tool........................................................................................................................................69 . matlab tool.............................................................................................................................................69 micelle2d tool........................................................................................................................................69 msi2lmp tool..........................................................................................................................................70 pymol_asphere tool...............................................................................................................................70 python tool.............................................................................................................................................70 reax tool.................................................................................................................................................70 restart2data tool.....................................................................................................................................70 thermo_extract tool ...............................................................................................................................71 . vim tool .................................................................................................................................................71 . ii

LAMMPS Users Manual

Table of Contentsxmovie tool............................................................................................................................................71 8. Modifying &extending LAMMPS...........................................................................................................72 Atom styles............................................................................................................................................73 Bond, angle, dihedral, improper potentials...........................................................................................74 Compute styles......................................................................................................................................75 Dump styles...........................................................................................................................................75 Dump custom output options .................................................................................................................75 Fix styles ................................................................................................................................................76 Input script commands..........................................................................................................................77 Kspace computations.............................................................................................................................77 Minimization solvers.............................................................................................................................78 Pairwise potentials.................................................................................................................................78 Region styles.........................................................................................................................................78 Thermodynamic output options .............................................................................................................79 Variable options .....................................................................................................................................79 Submitting new features to the developers to include in LAMMPS.....................................................80 10. Errors ......................................................................................................................................................82 10.1 Common problems........................................................................................................................82 10.2 Reporting bugs ...............................................................................................................................83 10.3 Error &warning messages.............................................................................................................83 Errors:....................................................................................................................................................83 Warnings:............................................................................................................................................135 11. Future and history................................................................................................................................140 11.1 Coming attractions .......................................................................................................................140 11.2 Past versions................................................................................................................................140 angle_style charmm command ...................................................................................................................143 angle_style class2 command......................................................................................................................144 angle_style cg/cmm command...................................................................................................................146 angle_coeff command................................................................................................................................147 angle_style cosine command.....................................................................................................................149 angle_style cosine/delta command .............................................................................................................150 angle_style cosine/periodic command.......................................................................................................151 angle_style cosine/squared command........................................................................................................152 angle_style harmonic command .................................................................................................................153 angle_style hybrid command.....................................................................................................................154 angle_style none command........................................................................................................................155 angle_style command .................................................................................................................................156 angle_style table command........................................................................................................................158 atom_modify command.............................................................................................................................160 atom_style command.................................................................................................................................162 bond_style class2 command .......................................................................................................................164 bond_coeff command .................................................................................................................................165 bond_style fene command.........................................................................................................................167 bond_style fene/expand command.............................................................................................................168 bond_style harmonic command.................................................................................................................170 bond_style hybrid command......................................................................................................................171 bond_style morse command .......................................................................................................................172 bond_style none command .........................................................................................................................173 iii

LAMMPS Users Manual

Table of Contentsbond_style nonlinear command.................................................................................................................174 bond_style quartic command.....................................................................................................................175 bond_style command.................................................................................................................................177 bond_style table command .........................................................................................................................179 boundary command....................................................................................................................................181 change_box command ................................................................................................................................182 clear command...........................................................................................................................................183 communicate command.............................................................................................................................184 compute command.....................................................................................................................................186 compute ackland/atom command ...............................................................................................................190 compute angle/local command ...................................................................................................................192 compute atom/molecule command............................................................................................................194 compute bond/local command...................................................................................................................196 compute centro/atom command.................................................................................................................198 compute cna/atom command.....................................................................................................................200 compute com command.............................................................................................................................202 compute com/molecule command.............................................................................................................203 compute coord/atom command..................................................................................................................205 compute damage/atom command ...............................................................................................................206 compute dihedral/local command..............................................................................................................207 compute displace/atom command..............................................................................................................208 compute erotate/asphere command............................................................................................................210 compute erotate/sphere command ..............................................................................................................211 compute event/displace command.............................................................................................................212 compute group/group command................................................................................................................213 compute gyration command.......................................................................................................................214 compute gyration/molecule command.......................................................................................................215 compute heat/flux command......................................................................................................................217 compute improper/local command .............................................................................................................220 compute ke command................................................................................................................................221 compute ke/atom command.......................................................................................................................222 compute ke/atom/eff command ..................................................................................................................223 compute ke/eff command...........................................................................................................................225 compute_modify command ........................................................................................................................227 compute msd command.............................................................................................................................228 compute msd/molecule command ..............................................................................................................230 compute pair command..............................................................................................................................232 compute pair/local command.....................................................................................................................234 compute pe command................................................................................................................................236 compute pe/atom command.......................................................................................................................238 compute pressure command.......................................................................................................................240 compute property/atom command.............................................................................................................242 compute property/local command ..............................................................................................................244 compute property/molecule command.......................................................................................................246 compute rdf command...............................................................................................................................247 compute reduce command.........................................................................................................................249 compute reduce/region command..............................................................................................................249 compute stress/atom command..................................................................................................................252 iv

LAMMPS Users Manual

Table of Contentscompute temp command............................................................................................................................254 compute temp/asphere command...............................................................................................................256 compute temp/com command....................................................................................................................258 compute temp/deform command...............................................................................................................260 compute temp/deform/eff command..........................................................................................................262 compute temp/eff command .......................................................................................................................263 compute temp/partial command.................................................................................................................265 compute temp/profile command................................................................................................................267 compute temp/ramp command...................................................................................................................269 compute temp/region command.................................................................................................................271 compute temp/region/eff command...........................................................................................................273 compute temp/sphere command .................................................................................................................274 compute ti command..................................................................................................................................276 create_atoms command..............................................................................................................................278 create_box command.................................................................................................................................281 delete_atoms command..............................................................................................................................283 delete_bonds command..............................................................................................................................285 dielectric command....................................................................................................................................287 dihedral_style charmm command..............................................................................................................288 dihedral_style class2 command.................................................................................................................290 dihedral_coeff command ............................................................................................................................293 dihedral_style harmonic command............................................................................................................295 dihedral_style helix command...................................................................................................................296 dihedral_style hybrid command.................................................................................................................297 dihedral_style multi/harmonic command ...................................................................................................298 dihedral_style none command...................................................................................................................299 dihedral_style opls command .....................................................................................................................300 dihedral_style command............................................................................................................................301 dimension command..................................................................................................................................303 dipole command.........................................................................................................................................304 displace_atoms command..........................................................................................................................305 displace_box command..............................................................................................................................307 dump command..........................................................................................................................................310 dump_modify command............................................................................................................................317 echo command...........................................................................................................................................321 fix command..............................................................................................................................................322 fix adapt command.....................................................................................................................................326 fix addforce command...............................................................................................................................330 fix atc command.........................................................................................................................................332 fix ave/atom command...............................................................................................................................336 fix ave/correlate command.........................................................................................................................338 fix ave/histo command...............................................................................................................................343 fix ave/spatial command............................................................................................................................348 fix ave/time command ................................................................................................................................353 fix aveforce command ................................................................................................................................358 fix bond/break command...........................................................................................................................360 fix bond/create command...........................................................................................................................363 fix bond/swap command............................................................................................................................366 v

LAMMPS Users Manual

Table of Contentsfix box/relax command..............................................................................................................................369 fix deform command..................................................................................................................................373 fix deposit command..................................................................................................................................379 fix drag command......................................................................................................................................382 fix dt/reset command ..................................................................................................................................383 fix efield command....................................................................................................................................385 fix enforce2d command.............................................................................................................................386 fix evaporate command..............................................................................................................................387 fix external command .................................................................................................................................389 fix freeze command ....................................................................................................................................391 fix gpu command.......................................................................................................................................392 fix gravity command..................................................................................................................................394 fix heat command.......................................................................................................................................396 fix imd command.......................................................................................................................................398 fix indent command...................................................................................................................................400 fix langevin command ................................................................................................................................403 fix langevin/eff command..........................................................................................................................406 fix lineforce command...............................................................................................................................408 fix_modify command.................................................................................................................................409 fix momentum command...........................................................................................................................410 fix move command .....................................................................................................................................412 fix msst command.....................................................................................................................................415 fix neb command ........................................................................................................................................418 fix nvt command........................................................................................................................................420 fix npt command........................................................................................................................................420 fix nph command.......................................................................................................................................420 fix nvt/eff command...................................................................................................................................427 fix npt/eff command...................................................................................................................................427 fix nph/eff command..................................................................................................................................427 fix nph/asphere command..........................................................................................................................430 fix nph/sphere command............................................................................................................................432 fix npt/asphere command...........................................................................................................................434 fix npt/sphere command.............................................................................................................................437 fix nve command ........................................................................................................................................439 fix nve/asphere command..........................................................................................................................440 fix nve/eff command..................................................................................................................................441 fix nve/limit command...............................................................................................................................442 fix nve/noforce command..........................................................................................................................444 fix nve/sphere command............................................................................................................................445 fix nvt/asphere command...........................................................................................................................447 fix nvt/sllod command...............................................................................................................................449 fix nvt/sllod/eff command..........................................................................................................................451 fix nvt/sphere command.............................................................................................................................453 fix orient/fcc command..............................................................................................................................455 fix planeforce command .............................................................................................................................459 fix poems....................................................................................................................................................460 fix pour command......................................................................................................................................462 fix press/berendsen command....................................................................................................................464 vi

LAMMPS Users Manual

Table of Contentsfix print command......................................................................................................................................467 fix qeq/comb command ..............................................................................................................................469 fix qeq/reax command ................................................................................................................................471 fix reax/bonds command............................................................................................................................473 fix recenter command .................................................................................................................................474 fix rigid command......................................................................................................................................476 fix rigid/nve command...............................................................................................................................476 fix rigid/nvt command ................................................................................................................................476 fix setforce command.................................................................................................................................481 fix shake command....................................................................................................................................483 fix smd command.......................................................................................................................................485 fix spring command...................................................................................................................................488 fix spring/rg command...............................................................................................................................490 fix spring/self command .............................................................................................................................492 fix srd command .........................................................................................................................................493 fix store/force command............................................................................................................................498 fix store/state command.............................................................................................................................499 fix temp/berendsen command....................................................................................................................501 fix temp/rescale command.........................................................................................................................503 fix temp/rescale/eff command ....................................................................................................................505 fix thermal/conductivity command............................................................................................................507 fix tmd command.......................................................................................................................................510 fix ttm command........................................................................................................................................512 fix viscosity command...............................................................................................................................515 fix viscous command.................................................................................................................................518 fix wall/lj93 command...............................................................................................................................520 fix wall/lj126 command.............................................................................................................................520 fix wall/colloid command..........................................................................................................................520 fix wall/harmonic command......................................................................................................................520 fix wall/gran command..............................................................................................................................524 fix wall/reflect command...........................................................................................................................527 fix wall/region command...........................................................................................................................530 fix wall/srd command .................................................................................................................................533 group command ..........................................................................................................................................536 if command................................................................................................................................................538 improper_style class2 command................................................................................................................541 improper_coeff command..........................................................................................................................543 improper_style cvff command...................................................................................................................545 improper_style harmonic command ...........................................................................................................546 improper_style hybrid command...............................................................................................................547 improper_style none command..................................................................................................................548 improper_style command ...........................................................................................................................549 improper_style umbrella command...........................................................................................................551 include command.......................................................................................................................................553 jump command ...........................................................................................................................................554 kspace_modify command..........................................................................................................................556 kspace_style command..............................................................................................................................558 label command...........................................................................................................................................560 vii

LAMMPS Users Manual

Table of Contentslattice command.........................................................................................................................................561 log command..............................................................................................................................................564 mass command...........................................................................................................................................565 min_modify command...............................................................................................................................567 min_style command...................................................................................................................................568 minimize command....................................................................................................................................570 neb command.............................................................................................................................................574 neigh_modify command............................................................................................................................579 neighbor command .....................................................................................................................................582 newton command.......................................................................................................................................584 next command............................................................................................................................................585 orient command ..........................................................................................................................................587 origin command.........................................................................................................................................588 pair_style airebo command........................................................................................................................589 pair_style born command...........................................................................................................................592 pair_style born/coul/long command ...........................................................................................................592 pair_style buck command..........................................................................................................................594 pair_style buck/coul/cut command............................................................................................................594 pair_style buck/coul/long command..........................................................................................................594 pair_style buck/coul command..................................................................................................................597 pair_style lj/charmm/coul/charmm command...........................................................................................600 pair_style lj/charmm/coul/charmm/implicit command..............................................................................600 pair_style lj/charmm/coul/long command.................................................................................................600 pair_style lj/charmm/coul/long/gpu command..........................................................................................600 pair_style lj/charmm/coul/long/opt command...........................................................................................600 pair_style lj/class2 command.....................................................................................................................604 pair_style lj/class2/coul/cut command.......................................................................................................604 pair_style lj/class2/coul/long command.....................................................................................................604 pair_style cg/cmm command.....................................................................................................................607 pair_style cg/cmm/gpu command..............................................................................................................607 pair_style cg/cmm/coul/cut command.......................................................................................................607 pair_style cg/cmm/coul/long command.....................................................................................................607 pair_style cg/cmm/coul/long/gpu command..............................................................................................607 pair_coeff command..................................................................................................................................611 pair_style colloid command.......................................................................................................................614 pair_style comb command.........................................................................................................................617 pair_style coul/cut command.....................................................................................................................621 pair_style coul/debye command .................................................................................................................621 pair_style coul/long command...................................................................................................................621 pair_style dipole/cut command..................................................................................................................623 pair_style dpd command............................................................................................................................626 pair_style dpd/tstat command....................................................................................................................626 pair_style dsmc command ..........................................................................................................................629 pair_style eam command...........................................................................................................................631 pair_style eam/opt command.....................................................................................................................631 pair_style eam/alloy command..................................................................................................................631 pair_style eam/alloy/opt command............................................................................................................631 pair_style eam/cd command .......................................................................................................................631 viii

LAMMPS Users Manual

Table of Contentspair_style eam/fs command.......................................................................................................................631 pair_style eam/fs/opt command.................................................................................................................631 pair_style eff/cut command ........................................................................................................................638 pair_style eim command............................................................................................................................642 pair_style gauss command.........................................................................................................................645 pair_style gayberne command...................................................................................................................647 pair_style gayberne/gpu command............................................................................................................647 pair_style gran/hooke command................................................................................................................651 pair_style gran/hooke/history command....................................................................................................651 pair_style gran/hertz/history command ......................................................................................................651 pair_style lj/gromacs command.................................................................................................................655 pair_style lj/gromacs/coul/gromacs command ...........................................................................................655 pair_style hbond/dreiding/lj command......................................................................................................657 pair_style hbond/dreiding/morse command...............................................................................................657 pair_style hybrid command ........................................................................................................................661 pair_style hybrid/overlay command ...........................................................................................................661 pair_style lj/cut command..........................................................................................................................665 pair_style lj/cut/gpu command...................................................................................................................665 pair_style lj/cut/opt command ....................................................................................................................665 pair_style lj/cut/coul/cut command............................................................................................................665 pair_style lj/cut/coul/cut/gpu command.....................................................................................................665 pair_style lj/cut/coul/debye command.......................................................................................................665 pair_style lj/cut/coul/long command ..........................................................................................................665 pair_style lj/cut/coul/long/gpu command ...................................................................................................665 pair_style lj/cut/coul/long/tip4p command................................................................................................665 pair_style lj96/cut command......................................................................................................................670 pair_style lj96/cut/gpu command...............................................................................................................670 pair_style lj/coul command........................................................................................................................672 pair_style lj/expand command...................................................................................................................675 pair_style lj/smooth command...................................................................................................................677 pair_style lubricate command....................................................................................................................679 pair_style meam command........................................................................................................................682 pair_modify command...............................................................................................................................687 pair_style morse command........................................................................................................................690 pair_style morse/opt command..................................................................................................................690 pair_style none command..........................................................................................................................692 pair_style peri/pmb command ....................................................................................................................693 pair_style peri/lps command......................................................................................................................693 pair_style reax command...........................................................................................................................695 pair_style reax/c command........................................................................................................................698 pair_style resquared command ...................................................................................................................702 pair_style soft command............................................................................................................................705 pair_style command...................................................................................................................................707 pair_style sw command ..............................................................................................................................710 pair_style table command..........................................................................................................................713 pair_style tersoff command ........................................................................................................................716 pair_style tersoff/zbl command ..................................................................................................................720 pair_write command..................................................................................................................................725 ix

LAMMPS Users Manual

Table of Contentspair_style yukawa command ......................................................................................................................727 pair_style yukawa/colloid command.........................................................................................................729 prd command ..............................................................................................................................................731 print command...........................................................................................................................................735 processors command..................................................................................................................................736 read_data command...................................................................................................................................737 read_restart command................................................................................................................................747 region command .........................................................................................................................................749 replicate command.....................................................................................................................................753 reset_timestep command............................................................................................................................754 restart command.........................................................................................................................................755 run command ..............................................................................................................................................757 run_style command....................................................................................................................................760 set command..............................................................................................................................................763 shape command..........................................................................................................................................766 shell command...........................................................................................................................................768 special_bonds command............................................................................................................................770 tad command..............................................................................................................................................773 temper command........................................................................................................................................777 thermo command ........................................................................................................................................779 thermo_modify command..........................................................................................................................780 thermo_style command..............................................................................................................................783 timestep command.....................................................................................................................................787 uncompute command.................................................................................................................................788 undump command......................................................................................................................................789 unfix command..........................................................................................................................................790 units command...........................................................................................................................................791 variable command......................................................................................................................................794 Math Operators....................................................................................................................................798 Math Functions....................................................................................................................................798 Group and Region Functions...............................................................................................................800 Special Functions .................................................................................................................................800 Atom Values and Vectors....................................................................................................................801 Compute References............................................................................................................................801 Fix References.....................................................................................................................................801 Variable References .............................................................................................................................802 velocity command......................................................................................................................................806 write_restart command ...............................................................................................................................809

x

LAMMPS DocumentationVersion 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. Each dated copy of LAMMPS contains all the features and bugfixes 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. If you browse the HTML doc pages on the LAMMPS WWW site, they always describe the most current 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 very patch. LAMMPS stands for Largescale 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 opensource code, distributed freely under the terms of the GNU Public License (GPL). The primary developers of LAMMPS are Steve Plimpton, Aidan Thompson, and Paul Crozier who can be contacted at sjplimp,athomps,pscrozi at sandia.gov. The LAMMPS WWW Site at http://lammps.sandia.gov has more information about the code and its uses. 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 Section_commands.html#comm since it gives quick access to documentation for all 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 nonfeatures 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 Commandline options 2.7 Screen output 2.8 Running on GPUs 2.9 Tips for users of previous versions 3. Commands 1

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. Howto discussions 4.1 Restarting a simulation 4.2 2d simulations 4.3 CHARMM and AMBER force fields 4.4 Running multiple simulations from one input script 4.5 Multireplica simulations 4.6 Granular models 4.7 TIP3P water model 4.8 TIP4P water model 4.9 SPC water model 4.10 Coupling LAMMPS to other codes 4.11 Visualizing LAMMPS snapshots 4.12 Triclinic (nonorthogonal) simulation boxes 4.13 NEMD simulations 4.14 Extended spherical and aspherical particles 4.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables) 4.16 Thermostatting, barostatting, and compute temperature 4.17 Walls 4.18 Elastic constants 4.19 Library interface to LAMMPS 4.20 Calculating thermal conductivity 4.21 Calculating viscosity 5. Example problems 6. Performance &scalability 7. Additional tools 8. Modifying &Extending LAMMPS 9. Python interface 9.1 Extending Python with a serial version of LAMMPS 9.2 Creating a shared MPI library 9.3 Extending Python with a parallel version of LAMMPS 9.4 Extending Python with MPI 9.5 Testing the PythonLAMMPS interface 9.6 Using LAMMPS from Python 9.7 Example Python scripts that use LAMMPS 10. Errors 10.1 Common problems 10.2 Reporting bugs 10.3 Error &warning messages 11. Future and history 11.1 Coming attractions 11.2 Past versions

2

Previous Section LAMMPS WWW Site LAMMPS Documentation LAMMPS Commands Next Section

1. IntroductionThese sections provide an overview of what LAMMPS can and can't do, describe what it means for LAMMPS to be an opensource code, and acknowledge the funding and people who have contributed to LAMMPS over the years. 1.1 What is LAMMPS 1.2 LAMMPS features 1.3 LAMMPS nonfeatures 1.4 Open source distribution 1.5 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 coarsegrained 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 singleprocessor desktop or laptop machines, but is designed for parallel computers. It will run on any parallel machine that compiles C++ and supports the MPI messagepassing library. This includes distributed or sharedmemory parallel machines and Beowulfstyle clusters. LAMMPS can model systems with only a few particles up to millions or billions. See this section for information on LAMMPS performance and scalability, or the Benchmarks section of the LAMMPS WWW Site. LAMMPS is a freelyavailable opensource 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 opensource 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 this section for more details. The current version of LAMMPS is written in C++. Earlier versions were written in F77 and F90. See this section for more information on different versions. All versions can be downloaded from the LAMMPS WWW Site. LAMMPS was originally developed under a US Department of Energy CRADA (Cooperative Research and Development Agreement) between two DOE labs and 3 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 longrange 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 spatialdecomposition techniques to partition the simulation domain into small 3d subdomains, one of which is assigned to each processor. Processors communicate and store "ghost" atom information for atoms that border their subdomain. LAMMPS is most efficient (in a parallel sense) for systems whose particles fill a 3d rectangular box with roughly uniform density. 3

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 this section, which describes how you can add it to LAMMPS. General features runs on a single processor or in parallel distributedmemory messagepassing parallelism (MPI) spatialdecomposition of simulation domain for parallelism opensource distribution highly portable C++ optional libraries used: MPI and singleprocessor FFT 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 coarsegrained particles (e.g. beadspring polymers) unitedatom polymers or organic molecules allatom polymers, organic molecules, proteins, DNA metals granular materials coarsegrained mesoscale models extended spherical and ellipsoidal particles point dipolar 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: LennardJones, Buckingham, Morse, BornMayerHuggins, Yukawa, soft, class 2 (COMPASS), hydrogen bond, tabulated charged pairwise potentials: Coulombic, pointdipole manybody potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM), embedded ion method (EIM), StillingerWeber, Tersoff, AIREBO, ReaxFF, COMB electron force field (eFF) coarsegrained potentials: DPD, GayBerne, REsquared, colloidal, DLVO 4

mesoscopic potentials: granular, Peridynamics 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, multiharmonic, helix, class 2 (COMPASS), OPLS improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS) polymer potentials: allatom, unitedatom, beadspring, breakable water potentials: TIP3P, TIP4P, SPC implicit solvent potentials: hydrodynamic lubrication, Debye longrange Coulombics and dispersion: Ewald, PPPM (similar to particlemesh Ewald), Ewald/N for longrange LennardJones forcefield compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options handful of GPUenabled pair styles 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) replicate existing atoms multiple times displace atoms Ensembles, constraints, and boundary conditions (fix command) 2d or 3d systems orthogonal or nonorthogonal (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 bond breaking, formation, swapping walls of various kinds nonequilibrium molecular dynamics (NEMD) variety of additional boundary conditions and constraints Integrators (run, run_style, minimize commands) velocityVerlet integrator Brownian dynamics rigid body integration 5

energy minimization via conjugate gradient or steepest descent relaxation rRESPA hierarchical timestepping 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 peratom quantities binary restart files parallel I/O of dump and restart files peratom quantities (energy, stress, centrosymmetry parameter, CNA, etc) userdefined systemwide (log file) or peratom (dump file) calculations spatial and time averaging of peratom quantities time averaging of systemwide quantities atom snapshots in native, XYZ, XTC, DCD, CFG formats Multireplica models nudged elastic band parallel replica dynamics temperature accelerated dynamics parallel tempering Pre and postprocessing Various pre and postprocessing 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 These are LAMMPS capabilities which you may not think of as typical molecular dynamics options: stochastic rotation dynamics (SRD) realtime visualization and interactive MD atomtocontinuum coupling with finite elements coupled rigid body integration via the POEMS library Direct Simulation Monte Carlo for lowdensity fluids Peridynamics mesoscale modeling targeted and steered molecular dynamics twotemperature electron model

1.3 LAMMPS nonfeatures 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 postprocess the data for such simulations are not included in the LAMMPS kernel for several reasons:

6

the desire to keep LAMMPS simple they are not parallel operations other codes already do them limited development resources Specifically, LAMMPS itself does not: run thru a GUI build molecular systems assign forcefield coefficients automagically perform sophisticated analyses of your MD simulation visualize your MD simulation plot your output data A few tools for pre and postprocessing 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 Python and is available for download from the Pizza.py WWW site. LAMMPS requires as input a list of initial atom coordinates and types, molecular topology information, and forcefield coefficients assigned to all atoms and bonds. LAMMPS will not build molecular systems and assign forcefield parameters for you. For atomic systems LAMMPS provides a create_atoms command which places atoms on solidstate lattices (fcc, bcc, userdefined, 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 LAMMPS to read in. For complicated molecular systems (e.g. a protein), a multitude of topology information and hundreds of forcefield 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 postprocess these files with their own analysis tools or reformat them for input into other programs, including visualization packages. If you are convinced you need to compute something onthefly as LAMMPS runs, see this section 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 postprocessing codes. A very simple (yet fast) visualizer is provided with the LAMMPS package see the xmovie tool in this section. It creates xyz projection views of atomic coordinates and animates them. We find it very useful for debugging purposes. For highquality visualization we recommend the following packages: VMD AtomEye PyMol Raster3d RasMol 7

Other features that LAMMPS does not yet (and may never) support are discussed in this section. Finally, these are freelyavailable molecular dynamics codes, most of them parallel, which may be wellsuited 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 atomdecomposition (replicateddata) strategies for parallelism; NAMD and NWCHEM use spatialdecomposition approaches, similar to LAMMPS. Tinker is a serial code. DL_POLY includes potentials for a variety of biological and nonbiological materials; both a replicateddata and spatialdecomposition 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 freeof charge, under the terms of the GNU Public License (GPL). This is often referred to as opensource 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 opensource, 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 opensourced, 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 opensource code, these are various ways you can contribute to making LAMMPS better. You can send email to the developers on any of these items. Point prospective users to the LAMMPS WWW Site. Mention it in talks or link to it from your WWW site. 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, this section 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. 8

Create a new Makefile.machine that can be added to the src/MAKE directory. The tools subdirectory of the LAMMPS distribution has various standalone codes for pre and postprocessing of LAMMPS data. More details are given in this section. 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 r