LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

fix command

Syntax:

fix ID group-ID style args 

Examples:

fix 1 all nve
fix 3 all nvt 300.0 300.0 0.01
fix mine top setforce 0.0 NULL 0.0 

Description:

Set a fix that will be applied to a group of atoms. In LAMMPS, a "fix" is any operation that is applied to the system during timestepping or minimization. Examples include updating of atom positions and velocities due to time integration, controlling temperature, applying constraint forces to atoms, enforcing boundary conditions, computing diagnostics, etc. There are dozens of fixes defined in LAMMPS and new ones can be added; see this section for a discussion.

Fixes perform their operations at different stages of the timestep. If 2 or more fixes operate at the same stage of the timestep, they are invoked in the order they were specified in the input script.

The ID of a fix can only contain alphanumeric characters and underscores.

Fixes can be deleted with the unfix command.

IMPORTANT NOTE: The unfix command is the only way to turn off a fix; simply specifying a new fix with a similar style will not turn off the first one. This is especially important to realize for integration fixes. For example, using a fix nve command for a second run after using a fix nvt command for the first run, will not cancel out the NVT time integration invoked by the "fix nvt" command. Thus two time integrators would be in place!

If you specify a new fix with the same ID and style as an existing fix, the old fix is deleted and the new one is created (presumably with new settings). This is the same as if an "unfix" command were first performed on the old fix, except that the new fix is kept in the same order relative to the existing fixes as the old one originally was. Note that this operation also wipes out any additional changes made to the old fix via the fix_modify command.

The fix modify command allows settings for some fixes to be reset. See the doc page for individual fixes for details.

Some fixes calculate a global scalar or vector quantity which can be accessed by various commands for output, including equal- and atom-style variables, thermo_style custom, and fix ave/time.

Some fixes calculate a per-atom scalar or vector quantity which can be accessed by various commands for output, including atom-style variables, dump_style custom, and fix ave/spatial.

The results of fixes that calculate global quantities can be either "intensive" or "extensive" values. Intensive means the value is independent of the number of atoms in the simulation, e.g. timestep size. Extensive means the value scales with the number of atoms in the simulation, e.g. total force applied by the fix. Thermodynamic output will normalize extensive values depending on the "thermo_modify norm" setting. But if a fix value is accessed in another way, e.g. by a variable, you may need to know whether it is an intensive or extensive value. See the doc page for individual fixes for further info.

See this howto section for a summary of various LAMMPS output options. See the doc pages for individual fixes for info on which ones calculate these quantities.

Some fixes store an internal "state" which is written to binary restart files via the restart or write_restart commands. This allows the fix to continue on with its calculations in a restarted simulation. See the read_restart command for info on how to re-specify a fix in an input script that reads a restart file. See the doc pages for individual fixes for info on which ones can be restarted.

Each fix style has its own documentation page which describes its arguments and what it does, as listed below. Here is an alphabetic list of fix styles available in LAMMPS:

There are also additional fix styles submitted by users which are included in the LAMMPS distribution. The list of these with links to the individual styles are given in the fix section of this page.

Restrictions:

Some fix styles are part of specific packages. They are only enabled if LAMMPS was built with that package. See the Making LAMMPS section for more info on packages. The doc pages for individual fixes tell if it is part of a package.

Related commands:

unfix, fix_modify

Default: none