Input script structure ====================== This page describes the structure of a typical LAMMPS input script. The examples directory in the LAMMPS distribution contains many sample input scripts; it is discussed on the :doc:`Examples ` doc page. A LAMMPS input script typically has 4 parts: 1. :ref:`Initialization ` 2. :ref:`System definition ` 3. :ref:`Simulation settings ` 4. :ref:`Run a simulation ` The last 2 parts can be repeated as many times as desired. I.e. run a simulation, change some settings, run some more, etc. Each of the 4 parts is now described in more detail. Remember that almost all commands need only be used if a non-default value is desired. .. _init: Initialization ------------------------------ Set parameters that need to be defined before atoms are created or read-in from a file. The relevant commands are :doc:`units `, :doc:`dimension `, :doc:`newton `, :doc:`processors `, :doc:`boundary `, :doc:`atom_style `, :doc:`atom_modify `. If force-field parameters appear in the files that will be read, these commands tell LAMMPS what kinds of force fields are being used: :doc:`pair_style `, :doc:`bond_style `, :doc:`angle_style `, :doc:`dihedral_style `, :doc:`improper_style `. .. _system: System definition ------------------------------ There are 3 ways to define the simulation cell and reserve space for force field info and fill it with atoms in LAMMPS. Read them in from (1) a data file or (2) a restart file via the :doc:`read_data ` or :doc:`read_restart ` commands, respectively. These files can also contain molecular topology information. Or (3) create a simulation cell and fill it with atoms on a lattice (with no molecular topology), using these commands: :doc:`lattice `, :doc:`region `, :doc:`create_box `, :doc:`create_atoms ` or :doc:`read_dump `. The entire set of atoms can be duplicated to make a larger simulation using the :doc:`replicate ` command. .. _settings: Simulation settings ------------------------------ Once atoms and molecular topology are defined, a variety of settings can be specified: force field coefficients, simulation parameters, output options, and more. Force field coefficients are set by these commands (they can also be set in the read-in files): :doc:`pair_coeff `, :doc:`bond_coeff `, :doc:`angle_coeff `, :doc:`dihedral_coeff `, :doc:`improper_coeff `, :doc:`kspace_style `, :doc:`dielectric `, :doc:`special_bonds `. Various simulation parameters are set by these commands: :doc:`neighbor `, :doc:`neigh_modify `, :doc:`group `, :doc:`timestep `, :doc:`reset_timestep `, :doc:`run_style `, :doc:`min_style `, :doc:`min_modify `. Fixes impose a variety of boundary conditions, time integration, and diagnostic options. The :doc:`fix ` command comes in many flavors. Various computations can be specified for execution during a simulation using the :doc:`compute `, :doc:`compute_modify `, and :doc:`variable ` commands. Output options are set by the :doc:`thermo `, :doc:`dump `, and :doc:`restart ` commands. .. _run: Run a simulation ------------------------------ A molecular dynamics simulation is run using the :doc:`run ` command. Energy minimization (molecular statics) is performed using the :doc:`minimize ` command. A parallel tempering (replica-exchange) simulation can be run using the :doc:`temper ` command.