LAMMPS Users Manual - KFUPMhpc.kfupm.edu.sa/Documentation/LAMMPS/User_Manaul_LAMMPS.pdf · LAMMPS...

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 LAMMPS Users Manual - KFUPMhpc.kfupm.edu.sa/Documentation/LAMMPS/User_Manaul_LAMMPS.pdf · LAMMPS...

  • LAMMPS Users ManualLargescale Atomic/Molecular Massively Parallel Simulator

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

  • Table of ContentsLAMMPS Documentation.............................................................................................................................11. Introduction................................................................................................................................................3

    1.1 What is LAMMPS.............................................................................................................................31.2 LAMMPS features.............................................................................................................................4General features.......................................................................................................................................4Particle and model types..........................................................................................................................4Force fields..............................................................................................................................................4Atom creation..........................................................................................................................................5Ensembles, constraints, and boundary conditions...................................................................................5Integrators................................................................................................................................................5Diagnostics..............................................................................................................................................6Output......................................................................................................................................................6Multireplica models...............................................................................................................................6Pre and postprocessing........................................................................................................................6Specialized features.................................................................................................................................61.3 LAMMPS nonfeatures....................................................................................................................61.4 Open source distribution....................................................................................................................81.5 Acknowledgments and citations........................................................................................................9

    2. Getting Started.........................................................................................................................................132.1 What's in the LAMMPS distribution...............................................................................................132.2 Making LAMMPS...........................................................................................................................132.3 Making LAMMPS with optional packages.....................................................................................182.4 Building LAMMPS as a library......................................................................................................212.5 Running LAMMPS.........................................................................................................................212.6 Commandline options...................................................................................................................232.7 LAMMPS screen output..................................................................................................................242.8 Running on GPUs............................................................................................................................26GPU configuration.................................................................................................................................26GPU input script....................................................................................................................................27GPU asynchronous pair computation....................................................................................................27GPU timing............................................................................................................................................27GPU single vs double precision............................................................................................................272.9 Tips for users of previous LAMMPS versions................................................................................27

    3. Commands...............................................................................................................................................293.1 LAMMPS input script.....................................................................................................................293.2 Parsing rules....................................................................................................................................303.3 Input script structure........................................................................................................................303.4 Commands listed by category.........................................................................................................323.5 Individual commands......................................................................................................................32Fix styles................................................................................................................................................33Compute styles......................................................................................................................................33Pair_style potentials...............................................................................................................................34Bond_style potentials............................................................................................................................34Angle_style potentials...........................................................................................................................35Dihedral_style potentials.......................................................................................................................35Improper_style potentials......................................................................................................................35Kspace solvers.......................................................................................................................................35

    4. Howto discussions.................................................................................................................................36

    LAMMPS Users Manual

    i

  • Table of Contents4.1 Restarting a simulation....................................................................................................................364.2 2d simulations..................................................................................................................................374.3 CHARMM, AMBER, and DREIDING force fields.......................................................................384.4 Running multiple simulations from one input script.......................................................................394.5 Multireplica simulations................................................................................................................404.6 Granular models..............................................................................................................................414.7 TIP3P water model..........................................................................................................................424.8 TIP4P water model..........................................................................................................................434.9 SPC water model.............................................................................................................................444.10 Coupling LAMMPS to other codes...............................................................................................444.11 Visualizing LAMMPS snapshots..................................................................................................464.12 Triclinic (nonorthogonal) simulation boxes................................................................................464.13 NEMD simulations........................................................................................................................484.14 Extended spherical and aspherical particles..................................................................................494.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables)..........................................514.16 Thermostatting, barostatting, and computing temperature............................................................554.17 Walls..............................................................................................................................................574.18 Elastic constants............................................................................................................................584.19 Library interface to LAMMPS......................................................................................................584.20 Calculating thermal conductivity..................................................................................................604.21 Calculating viscosity.....................................................................................................................60

    5. Example problems....................................................................................................................................636. Performance &scalability.........................................................................................................................657. Additional tools........................................................................................................................................66

    amber2lmp tool......................................................................................................................................66binary2txt tool.......................................................................................................................................67ch2lmp tool............................................................................................................................................67chain tool...............................................................................................................................................67createatoms tool.....................................................................................................................................67data2xmovie tool...................................................................................................................................68eam database tool..................................................................................................................................68eam generate tool...................................................................................................................................68eff tool...................................................................................................................................................68emacs tool..............................................................................................................................................68ipp tool...................................................................................................................................................68lmp2arc tool...........................................................................................................................................69lmp2cfg tool...........................................................................................................................................69lmp2traj tool..........................................................................................................................................69lmp2vmd tool.........................................................................................................................................69matlab tool.............................................................................................................................................69micelle2d tool........................................................................................................................................69msi2lmp tool..........................................................................................................................................70pymol_asphere tool...............................................................................................................................70python tool.............................................................................................................................................70reax tool.................................................................................................................................................70restart2data tool.....................................................................................................................................70thermo_extract tool................................................................................................................................71vim tool..................................................................................................................................................71

    LAMMPS Users Manual

    ii

  • Table of Contentsxmovie tool............................................................................................................................................71

    8. Modifying &extending LAMMPS...........................................................................................................72Atom styles............................................................................................................................................73Bond, angle, dihedral, improper potentials...........................................................................................74Compute styles......................................................................................................................................75Dump styles...........................................................................................................................................75Dump custom output options.................................................................................................................75Fix styles................................................................................................................................................76Input script commands..........................................................................................................................77Kspace computations.............................................................................................................................77Minimization solvers.............................................................................................................................78Pairwise potentials.................................................................................................................................78Region styles.........................................................................................................................................78Thermodynamic output options.............................................................................................................79Variable options.....................................................................................................................................79Submitting new features to the developers to include in LAMMPS.....................................................80

    10. Errors......................................................................................................................................................8210.1 Common problems........................................................................................................................8210.2 Reporting bugs...............................................................................................................................8310.3 Error &warning messages.............................................................................................................83Errors:....................................................................................................................................................83Warnings:............................................................................................................................................135

    11. Future and history................................................................................................................................14011.1 Coming attractions.......................................................................................................................14011.2 Past versions................................................................................................................................140

    angle_style charmm command...................................................................................................................143angle_style class2 command......................................................................................................................144angle_style cg/cmm command...................................................................................................................146angle_coeff command................................................................................................................................147angle_style cosine command.....................................................................................................................149angle_style cosine/delta command.............................................................................................................150angle_style cosine/periodic command.......................................................................................................151angle_style cosine/squared command........................................................................................................152angle_style harmonic command.................................................................................................................153angle_style hybrid command.....................................................................................................................154angle_style none command........................................................................................................................155angle_style command.................................................................................................................................156angle_style table command........................................................................................................................158atom_modify command.............................................................................................................................160atom_style command.................................................................................................................................162bond_style class2 command.......................................................................................................................164bond_coeff command.................................................................................................................................165bond_style fene command.........................................................................................................................167bond_style fene/expand command.............................................................................................................168bond_style harmonic command.................................................................................................................170bond_style hybrid command......................................................................................................................171bond_style morse command.......................................................................................................................172bond_style none command.........................................................................................................................173

    LAMMPS Users Manual

    iii

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

    LAMMPS Users Manual

    iv

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

    LAMMPS Users Manual

    v

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

    LAMMPS Users Manual

    vi

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

    LAMMPS Users Manual

    vii

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

    LAMMPS Users Manual

    viii

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

    LAMMPS Users Manual

    ix

  • Table of Contentspair_style yukawa command......................................................................................................................727pair_style yukawa/colloid command.........................................................................................................729prd command..............................................................................................................................................731print command...........................................................................................................................................735processors command..................................................................................................................................736read_data command...................................................................................................................................737read_restart command................................................................................................................................747region command.........................................................................................................................................749replicate command.....................................................................................................................................753reset_timestep command............................................................................................................................754restart command.........................................................................................................................................755run command..............................................................................................................................................757run_style command....................................................................................................................................760set command..............................................................................................................................................763shape command..........................................................................................................................................766shell command...........................................................................................................................................768special_bonds command............................................................................................................................770tad command..............................................................................................................................................773temper command........................................................................................................................................777thermo command........................................................................................................................................779thermo_modify command..........................................................................................................................780thermo_style command..............................................................................................................................783timestep command.....................................................................................................................................787uncompute command.................................................................................................................................788undump command......................................................................................................................................789unfix command..........................................................................................................................................790units command...........................................................................................................................................791variable command......................................................................................................................................794

    Math Operators....................................................................................................................................798Math Functions....................................................................................................................................798Group and Region Functions...............................................................................................................800Special Functions.................................................................................................................................800Atom Values and Vectors....................................................................................................................801Compute References............................................................................................................................801Fix References.....................................................................................................................................801Variable References.............................................................................................................................802

    velocity command......................................................................................................................................806write_restart command...............................................................................................................................809

    LAMMPS Users Manual

    x

  • LAMMPS Documentation

    Version info:

    The LAMMPS "version" is the date when it was released, such as 1 May 2010. LAMMPS is updatedcontinuously. Whenever we fix a bug or add a feature, we release it immediately, and post a notice on this page ofthe WWW site. Each dated copy of LAMMPS contains all the features and bugfixes up to and including thatversion date. The version date is printed to the screen and logfile every time you run LAMMPS. It is also in thefile 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 currentversion 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 islarge, 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. Itwas 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 becontacted at sjplimp,athomps,pscrozi at sandia.gov. The LAMMPS WWW Site at http://lammps.sandia.gov hasmore information about the code and its uses.

    The LAMMPS documentation is organized into the following sections. If you find errors or omissions in thismanual or have suggestions for useful information to add, please send an email to the developers so we canimprove the LAMMPS documentation.

    Once you are familiar with LAMMPS, you may want to bookmark this page at Section_commands.html#commsince it gives quick access to documentation for all LAMMPS commands.

    PDF file of the entire manual, generated by htmldoc

    Introduction1.1 What is LAMMPS1.2 LAMMPS features1.3 LAMMPS nonfeatures1.4 Open source distribution1.5 Acknowledgments and citations

    1.

    Getting started2.1 What's in the LAMMPS distribution2.2 Making LAMMPS2.3 Making LAMMPS with optional packages2.4 Building LAMMPS as a library2.5 Running LAMMPS2.6 Commandline options2.7 Screen output2.8 Running on GPUs2.9 Tips for users of previous versions

    2.

    Commands3.

    1

    http://lammps.sandia.gov/bug.htmlhttp://lammps.sandia.gov/bug.htmlhttp://www.sandia.gov/~sjplimphttp://lammps.sandia.govhttp://www.easysw.com/htmldoc

  • 3.1 LAMMPS input script3.2 Parsing rules3.3 Input script structure3.4 Commands listed by category3.5 Commands listed alphabeticallyHowto discussions4.1 Restarting a simulation4.2 2d simulations4.3 CHARMM and AMBER force fields4.4 Running multiple simulations from one input script4.5 Multireplica simulations4.6 Granular models4.7 TIP3P water model4.8 TIP4P water model4.9 SPC water model4.10 Coupling LAMMPS to other codes4.11 Visualizing LAMMPS snapshots4.12 Triclinic (nonorthogonal) simulation boxes4.13 NEMD simulations4.14 Extended spherical and aspherical particles4.15 Output from LAMMPS (thermo, dumps, computes, fixes, variables)4.16 Thermostatting, barostatting, and compute temperature4.17 Walls4.18 Elastic constants4.19 Library interface to LAMMPS4.20 Calculating thermal conductivity4.21 Calculating viscosity

    4.

    Example problems5. Performance &scalability6. Additional tools7. Modifying &Extending LAMMPS8. Python interface9.1 Extending Python with a serial version of LAMMPS9.2 Creating a shared MPI library9.3 Extending Python with a parallel version of LAMMPS9.4 Extending Python with MPI9.5 Testing the PythonLAMMPS interface9.6 Using LAMMPS from Python9.7 Example Python scripts that use LAMMPS

    9.

    Errors10.1 Common problems10.2 Reporting bugs10.3 Error &warning messages

    10.

    Future and history11.1 Coming attractions11.2 Past versions

    11.

    2

  • Previous Section LAMMPS WWW Site LAMMPS Documentation LAMMPS Commands Next Section

    1. Introduction

    These sections provide an overview of what LAMMPS can and can't do, describe what it means for LAMMPS tobe an opensource code, and acknowledge the funding and people who have contributed to LAMMPS over theyears.

    1.1 What is LAMMPS1.2 LAMMPS features1.3 LAMMPS nonfeatures1.4 Open source distribution1.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, orgaseous state. It can model atomic, polymeric, biological, metallic, granular, and coarsegrained systems using avariety 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 parallelcomputers. 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 informationon 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, whichmeans you can use or modify the code however you wish. See this section for a brief discussion of theopensource 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 sectionfor 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 andDevelopment Agreement) between two DOE labs and 3 companies. It is distributed by Sandia National Labs. Seethis 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 boundaryconditions. For computational efficiency LAMMPS uses neighbor lists to keep track of nearby particles. The listsare optimized for systems with particles that are repulsive at short distances, so that the local density of particlesnever becomes too large. On parallel machines, LAMMPS uses spatialdecomposition techniques to partition thesimulation domain into small 3d subdomains, one of which is assigned to each processor. Processorscommunicate and store "ghost" atom information for atoms that border their subdomain. LAMMPS is mostefficient (in a parallel sense) for systems whose particles fill a 3d rectangular box with roughly uniform density.

    3

    http://lammps.sandia.govhttp://lammps.sandia.govhttp://www-unix.mcs.anl.gov/mpihttp://lammps.sandia.govhttp://www.gnu.org/copyleft/gpl.htmlhttp://lammps.sandia.govhttp://www.sandia.gov

  • 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. IfLAMMPS 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 forlongrange 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 overlaidpotentials: 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 doingsetup, analysis, plotting, and visualization for LAMMPS simulations. Pizza.py is written in Python and isavailable 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 theLAMMPS kernel for several reasons:

    6

    http://www.sandia.gov/~sjplimp/pizza.htmlhttp://www.python.orghttp://www.sandia.gov/~sjplimp/pizza.html

  • 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 describedin 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 someof the listed bullets. It provides tools for doing setup, analysis, plotting, and visualization for LAMMPSsimulations. 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, andforcefield coefficients assigned to all atoms and bonds. LAMMPS will not build molecular systems and assignforcefield 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, bondcoeff, angle coeff, etc commands. For molecular systems or more complicated simulation geometries, userstypically use another code as a builder and convert its output to LAMMPS input format, or write their own codeto 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 offorcefield coefficients must typically be specified. We suggest you use a program like CHARMM or AMBER orother molecular builders to setup such problems and dump its information to a file. You can then reformat the fileas 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 ownanalysis tools or reformat them for input into other programs, including visualization packages. If you areconvinced you need to compute something onthefly as LAMMPS runs, see this section for a discussion of howyou can use the dump and compute and fix commands to print out data of your choosing. Keep in mind thatcomplicated computations can slow down the molecular dynamics timestepping, particularly if the computationsare 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. Itcreates xyz projection views of atomic coordinates and animates them. We find it very useful for debuggingpurposes. For highquality visualization we recommend the following packages:

    VMD AtomEye PyMol Raster3d RasMol

    7

    http://www.sandia.gov/~sjplimp/pizza.htmlhttp://www.python.orghttp://www.sandia.gov/~sjplimp/pizza.htmlhttp://www.scripps.edu/brookshttp://amber.scripps.eduhttp://www.ks.uiuc.edu/Research/vmdhttp://mt.seas.upenn.edu/Archive/Graphics/Ahttp://pymol.sourceforge.nethttp://www.bmsc.washington.edu/raster3d/raster3d.htmlhttp://www.openrasmol.org

  • 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 tothe problems you want to model. They can also be used in conjunction with LAMMPS to perform complementarymodeling 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 andNWCHEM use spatialdecomposition approaches, similar to LAMMPS. Tinker is a serial code. DL_POLYincludes potentials for a variety of biological and nonbiological materials; both a replicateddata andspatialdecomposition 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 codethat is distributed freeof charge, under the terms of the GNU Public License (GPL). This is often referred to asopensource distribution see www.gnu.org or www.opensource.org for more details. The legal text of the GPLis 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 commercialpurposes.

    (2) If you distribute a modified version of LAMMPS, it must remain opensource, meaning you distribute itunder 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 youdistribute 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 thecopyright 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. Youcan 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 WWWsite.

    If you find an error or omission in this manual or on the LAMMPS WWW Site, or have a suggestion forsomething 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 pap