"Higher level section"_Commands.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Commands_all.html)

:line

LAMMPS input scripts :h3

LAMMPS executes by reading commands from a input script (text file),
one line at a time.  When the input script ends, LAMMPS exits.  Each
command causes LAMMPS to take some action.  It may set an internal
variable, read in a file, or run a simulation.  Most commands have
default settings, which means you only need to use the command if you
wish to change the default.

In many cases, the ordering of commands in an input script is not
important.  However the following rules apply:

(1) LAMMPS does not read your entire input script and then perform a
simulation with all the settings.  Rather, the input script is read
one line at a time and each command takes effect when it is read.
Thus this sequence of commands:

timestep 0.5
run      100
run      100 :pre

does something different than this sequence:

run      100
timestep 0.5
run      100 :pre

In the first case, the specified timestep (0.5 fs) is used for two
simulations of 100 timesteps each.  In the 2nd case, the default
timestep (1.0 fs) is used for the 1st 100 step simulation and a 0.5 fs
timestep is used for the 2nd one.

(2) Some commands are only valid when they follow other commands.  For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group.

(3) Sometimes command B will use values that can be set by command A.
This means command A must precede command B in the input script if it
is to have the desired effect.  For example, the
"read_data"_read_data.html command initializes the system by setting
up the simulation box and assigning atoms to processors.  If default
values are not desired, the "processors"_processors.html and
"boundary"_boundary.html commands need to be used before read_data to
tell LAMMPS how to map processors to the simulation box.

Many input script errors are detected by LAMMPS and an ERROR or
WARNING message is printed.  The "Errors"_Errors.html doc page gives
more information on what errors mean.  The documentation for each
command lists restrictions on how the command can be used.

