2006-09-22 00:22:34 +08:00
< HTML >
< CENTER > < A HREF = "http://lammps.sandia.gov" > LAMMPS WWW Site< / A > - < A HREF = "Manual.html" > LAMMPS Documentation< / A > - < A HREF = "Section_commands.html#comm" > LAMMPS Commands< / A >
< / CENTER >
< HR >
< H3 > fix command
< / H3 >
< P > < B > Syntax:< / B >
< / P >
< PRE > fix ID group-ID style args
< / PRE >
< UL > < LI > ID = user-assigned name for the fix
< LI > group-ID = ID of the group of atoms to apply the fix to
< LI > style = one of a long list of possible style names (see below)
< LI > args = arguments used by a particular style
< / UL >
< P > < B > Examples:< / B >
< / P >
< PRE > fix 1 all nve
2010-06-15 22:02:04 +08:00
fix 3 all nvt temp 300.0 300.0 0.01
2006-09-22 00:22:34 +08:00
fix mine top setforce 0.0 NULL 0.0
< / PRE >
< P > < B > Description:< / B >
< / P >
< P > 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
2008-01-03 03:25:15 +08:00
defined in LAMMPS and new ones can be added; see < A HREF = "Section_modify.html" > this
2006-09-22 00:22:34 +08:00
section< / A > for a discussion.
< / P >
< P > Fixes perform their operations at different stages of the timestep.
2008-01-03 03:25:15 +08:00
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.
< / P >
< P > The ID of a fix can only contain alphanumeric characters and
underscores.
< / P >
< P > Fixes can be deleted with the < A HREF = "unfix.html" > unfix< / A > command.
2006-09-22 00:22:34 +08:00
< / P >
2008-01-03 03:25:15 +08:00
< P > IMPORTANT NOTE: The < A HREF = "unfix.html" > unfix< / A > 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 < A HREF = "fix_nve.html" > fix nve< / A >
2010-04-03 00:51:06 +08:00
command for a second run after using a < A HREF = "fix_nh.html" > fix nvt< / A > command
2008-01-03 03:25:15 +08:00
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!
2006-09-22 00:22:34 +08:00
< / P >
2006-12-16 06:53:57 +08:00
< P > 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 < A HREF = "fix_modify.html" > fix_modify< / A > command.
< / P >
2007-06-25 22:36:36 +08:00
< P > The < A HREF = "fix_modify.html" > fix modify< / A > command allows settings for some
fixes to be reset. See the doc page for individual fixes for details.
< / P >
< P > Some fixes store an internal "state" which is written to binary
restart files via the < A HREF = "restart.html" > restart< / A > or
< A HREF = "write_restart.html" > write_restart< / A > commands. This allows the fix to
continue on with its calculations in a restarted simulation. See the
< A HREF = "read_restart.html" > read_restart< / A > 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.
< / P >
2009-12-10 05:20:59 +08:00
< HR >
< P > Some fixes calculate one of three styles of quantities: global,
per-atom, or local, which can be used by other commands or output as
described below. A global quantity is one or more system-wide values,
e.g. the energy of a wall interacting with particles. A per-atom
quantity is one or more values per atom, e.g. the displacement vector
for each atom since time 0. Per-atom values are set to 0.0 for atoms
not in the specified fix group. Local quantities are calculated by
each processor based on the atoms it owns, but there may be zero or
more per atoms.
< / P >
< P > Note that a single fix may produces either global or per-atom or local
quantities (or none at all), but never more than one of these.
< / P >
< P > Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The
doc page for each fix describes the style and kind of values it
produces, e.g. a per-atom vector. Some fixes produce more than one
kind of a single style, e.g. a global scalar and a global vector.
< / P >
< P > When a fix quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the fix:
< / P >
< DIV ALIGN = center > < TABLE BORDER = 1 >
< TR > < TD > f_ID < / TD > < TD > entire scalar, vector, or array< / TD > < / TR >
< TR > < TD > f_ID[I] < / TD > < TD > one element of vector, one column of array< / TD > < / TR >
< TR > < TD > f_ID[I][J] < / TD > < TD > one element of array
< / TD > < / TR > < / TABLE > < / DIV >
< P > In other words, using one bracket reduces the dimension of the
quantity once (vector -> scalar, array -> vector). Using two brackets
reduces the dimension twice (array -> scalar). Thus a command that
uses scalar fix values as input can also process elements of a vector
or array.
< / P >
< P > Note that commands and < A HREF = "variable.html" > variables< / A > which use fix
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a fix quantity as f_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.
< / P >
< HR >
< P > In LAMMPS, the values generated by a fix can be used in several ways:
< / P >
< UL > < LI > Global values can be output via the < A HREF = "thermo_style.html" > thermo_style
custom< / A > or < A HREF = "fix_ave_time.html" > fix ave/time< / A > command.
Or the values can be referenced in a < A HREF = "variable.html" > variable equal< / A > or
< A HREF = "variable.html" > variable atom< / A > command.
< LI > Per-atom values can be output via the < A HREF = "dump.html" > dump custom< / A > command
or the < A HREF = "fix_ave_spatial.html" > fix ave/spatial< / A > command. Or they can be
time-averaged via the < A HREF = "fix_ave_atom.html" > fix ave/atom< / A > command or
reduced by the < A HREF = "compute_reduce.html" > compute reduce< / A > command. Or the
per-atom values can be referenced in an < A HREF = "variable.html" > atom-style
variable< / A > .
< LI > Local values can be reduced by the < A HREF = "compute_reduce.html" > compute
reduce< / A > command, or histogrammed by the < A HREF = "fix_ave_histo.html" > fix
ave/histo< / A > command.
< / UL >
2011-08-26 01:01:01 +08:00
< P > See this < A HREF = "Section_howto.html#howto_15" > howto section< / A > for a summary of
2009-12-10 05:20:59 +08:00
various LAMMPS output options, many of which involve fixes.
< / P >
< P > 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. temperature. Extensive means the value scales with the number of
atoms in the simulation, e.g. total rotational kinetic energy.
< A HREF = "thermo_style.html" > Thermodynamic output< / A > will normalize extensive
2010-03-03 05:51:16 +08:00
values by the number of atoms in the system, depending on the
"thermo_modify norm" setting. It will not normalize intensive values.
If a fix value is accessed in another way, e.g. by a
< A HREF = "variable.html" > variable< / A > , you may want to know whether it is an
intensive or extensive value. See the doc page for individual fixes
for further info.
2009-12-10 05:20:59 +08:00
< / P >
< HR >
2008-01-03 03:25:15 +08:00
< P > 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:
2006-09-22 00:22:34 +08:00
< / P >
2010-06-18 23:59:35 +08:00
< UL > < LI > < A HREF = "fix_adapt.html" > adapt< / A > - change a simulation parameter over time
< LI > < A HREF = "fix_addforce.html" > addforce< / A > - add a force to each atom
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_aveforce.html" > aveforce< / A > - add an averaged force to each atom
< LI > < A HREF = "fix_ave_atom.html" > ave/atom< / A > - compute per-atom time-averaged quantities
2009-12-15 09:21:23 +08:00
< LI > < A HREF = "fix_ave_atom.html" > ave/histo< / A > - compute/output time-averaged histograms
< LI > < A HREF = "fix_ave_spatial.html" > ave/spatial< / A > - compute/output time-averaged per-atom quantities by layer
< LI > < A HREF = "fix_ave_time.html" > ave/time< / A > - compute/output global time-averaged quantities
2009-01-06 06:26:31 +08:00
< LI > < A HREF = "fix_bond_break.html" > bond/break< / A > - break bonds on the fly
< LI > < A HREF = "fix_bond_create.html" > bond/create< / A > - create bonds on the fly
2008-05-16 05:22:59 +08:00
< LI > < A HREF = "fix_bond_swap.html" > bond/swap< / A > - Monte Carlo bond swapping
2009-02-28 06:26:36 +08:00
< LI > < A HREF = "fix_box_relax.html" > box/relax< / A > - relax box size during energy minimization
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_deform.html" > deform< / A > - change the simulation box size/shape
< LI > < A HREF = "fix_deposit.html" > deposit< / A > - add new atoms above a surface
< LI > < A HREF = "fix_drag.html" > drag< / A > - drag atoms towards a defined coordinate
2007-10-11 06:28:11 +08:00
< LI > < A HREF = "fix_dt_reset.html" > dt/reset< / A > - reset the timestep based on velocity, forces
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_efield.html" > efield< / A > - impose electric field on system
< LI > < A HREF = "fix_enforce2d.html" > enforce2d< / A > - zero out z-dimension velocity and force
2009-03-19 01:37:50 +08:00
< LI > < A HREF = "fix_evaporate.html" > evaporate< / A > - remove atoms from simulation periodically
2010-09-17 03:46:13 +08:00
< LI > < A HREF = "fix_external.html" > external< / A > - callback to an external driver program
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_freeze.html" > freeze< / A > - freeze atoms in a granular simulation
< LI > < A HREF = "fix_gravity.html" > gravity< / A > - add gravity to atoms in a granular simulation
2011-08-25 23:36:43 +08:00
< LI > < A HREF = "fix_gcmc.html" > gcmc< / A > - grand canonical insertions/deletions
2007-10-27 04:42:35 +08:00
< LI > < A HREF = "fix_heat.html" > heat< / A > - add/subtract momentum-conserving heat
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_indent.html" > indent< / A > - impose force due to an indenter
< LI > < A HREF = "fix_langevin.html" > langevin< / A > - Langevin temperature control
< LI > < A HREF = "fix_lineforce.html" > lineforce< / A > - constrain atoms to move in a line
2009-12-17 04:27:03 +08:00
< LI > < A HREF = "fix_momentum.html" > momentum< / A > - zero the linear and/or angular momentum of a group of atoms
2009-12-04 01:57:33 +08:00
< LI > < A HREF = "fix_move.html" > move< / A > - move atoms in a prescribed fashion
2010-06-17 06:47:44 +08:00
< LI > < A HREF = "fix_msst.html" > msst< / A > - multi-scale shock technique (MSST) integration
2010-10-01 04:38:58 +08:00
< LI > < A HREF = "fix_neb.html" > neb< / A > - nudged elastic band (NEB) spring forces
2010-04-03 00:51:06 +08:00
< LI > < A HREF = "fix_nh.html" > nph< / A > - constant NPH time integration via Nose/Hoover
< LI > < A HREF = "fix_nph_asphere.html" > nph/asphere< / A > - NPH for aspherical particles
< LI > < A HREF = "fix_nph_sphere.html" > nph/sphere< / A > - NPH for spherical particles
< LI > < A HREF = "fix_nh.html" > npt< / A > - constant NPT time integration via Nose/Hoover
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_npt_asphere.html" > npt/asphere< / A > - NPT for aspherical particles
2008-03-20 06:23:37 +08:00
< LI > < A HREF = "fix_npt_sphere.html" > npt/sphere< / A > - NPT for spherical particles
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_nve.html" > nve< / A > - constant NVE time integration
< LI > < A HREF = "fix_nve_asphere.html" > nve/asphere< / A > - NVT for aspherical particles
< LI > < A HREF = "fix_nve_limit.html" > nve/limit< / A > - NVE with limited step length
< LI > < A HREF = "fix_nve_noforce.html" > nve/noforce< / A > - NVE without forces (v only)
2010-03-02 23:22:43 +08:00
< LI > < A HREF = "fix_nve_sphere.html" > nve/sphere< / A > - NVT for spherical particles
2010-04-03 00:51:06 +08:00
< LI > < A HREF = "fix_nh.html" > nvt< / A > - constant NVT time integration via Nose/Hoover
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_nvt_asphere.html" > nvt/asphere< / A > - NVT for aspherical particles
< LI > < A HREF = "fix_nvt_sllod.html" > nvt/sllod< / A > - NVT for NEMD with SLLOD equations
2008-03-20 06:23:37 +08:00
< LI > < A HREF = "fix_nvt_sphere.html" > nvt/sphere< / A > - NVT for spherical particles
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_orient_fcc.html" > orient/fcc< / A > - add grain boundary migration force
< LI > < A HREF = "fix_planeforce.html" > planeforce< / A > - constrain atoms to move in a plane
< LI > < A HREF = "fix_poems.html" > poems< / A > - constrain clusters of atoms to move as coupled rigid bodies
< LI > < A HREF = "fix_pour.html" > pour< / A > - pour new atoms into a granular simulation domain
2008-03-19 06:21:46 +08:00
< LI > < A HREF = "fix_press_berendsen.html" > press/berendsen< / A > - pressure control by Berendsen barostat
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_print.html" > print< / A > - print text and variables during a simulation
2009-06-23 05:17:38 +08:00
< LI > < A HREF = "fix_reax_bonds.html" > reax/bonds< / A > - write out ReaxFF bond information < A HREF = "fix_recenter.html" > recenter< / A > - constrain the center-of-mass position of a group of atoms
2011-08-25 23:07:08 +08:00
< LI > < A HREF = "fix_restrain.html" > restrain< / A > - constrain a bond, angle, dihedral
2010-05-02 08:59:55 +08:00
< LI > < A HREF = "fix_rigid.html" > rigid< / A > - constrain one or more clusters of atoms to move as a rigid body with NVE integration
< LI > < A HREF = "fix_rigid.html" > rigid/nve< / A > - constrain one or more clusters of atoms to move as a rigid body with alternate NVE integration
< LI > < A HREF = "fix_rigid.html" > rigid/nvt< / A > - constrain one or more clusters of atoms to move as a rigid body with NVT integration
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_setforce.html" > setforce< / A > - set the force on each atom
< LI > < A HREF = "fix_shake.html" > shake< / A > - SHAKE constraints on bonds and/or angles
< LI > < A HREF = "fix_spring.html" > spring< / A > - apply harmonic spring force to group of atoms
< LI > < A HREF = "fix_spring_rg.html" > spring/rg< / A > - spring on radius of gyration of group of atoms
< LI > < A HREF = "fix_spring_self.html" > spring/self< / A > - spring from each atom to its origin
2010-10-01 23:48:37 +08:00
< LI > < A HREF = "fix_srd.html" > srd< / A > - stochastic rotation dynamics (SRD)
2009-12-22 08:22:16 +08:00
< LI > < A HREF = "fix_store_force.html" > store/force< / A > - store force on each atom
2010-06-04 08:37:28 +08:00
< LI > < A HREF = "fix_store_state.html" > store/state< / A > - store attributes for each atom
2008-03-12 00:37:01 +08:00
< LI > < A HREF = "fix_temp_berendsen.html" > temp/berendsen< / A > - temperature control by Berendsen thermostat
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_temp_rescale.html" > temp/rescale< / A > - temperature control by velocity rescaling
2008-05-15 05:40:02 +08:00
< LI > < A HREF = "fix_thermal_conductivity.html" > thermal/conductivity< / A > - Muller-Plathe kinetic energy exchange for thermal conductivity calculation
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_tmd.html" > tmd< / A > - guide a group of atoms to a new configuration
2009-04-07 05:26:59 +08:00
< LI > < A HREF = "fix_ttm.html" > ttm< / A > - two-temperature model for electronic/atomic coupling
2007-10-17 02:39:08 +08:00
< LI > < A HREF = "fix_viscosity.html" > viscosity< / A > - Muller-Plathe momentum exchange for viscosity calculation
2007-10-05 23:39:59 +08:00
< LI > < A HREF = "fix_viscous.html" > viscous< / A > - viscous damping for granular simulations
2010-01-09 06:54:29 +08:00
< LI > < A HREF = "fix_wall.html" > wall/colloid< / A > - Lennard-Jones wall interacting with finite-size particles
2009-11-07 05:01:28 +08:00
< LI > < A HREF = "fix_wall_gran.html" > wall/gran< / A > - frictional wall(s) for granular simulations
2010-01-09 06:54:29 +08:00
< LI > < A HREF = "fix_wall.html" > wall/harmonic< / A > - harmonic spring wall
< LI > < A HREF = "fix_wall.html" > wall/lj126< / A > - Lennard-Jones 12-6 wall
< LI > < A HREF = "fix_wall.html" > wall/lj93< / A > - Lennard-Jones 9-3 wall
2010-01-09 06:55:57 +08:00
< LI > < A HREF = "fix_wall_reflect.html" > wall/reflect< / A > - reflecting wall(s)
2010-10-28 05:01:30 +08:00
< LI > < A HREF = "fix_wall_region.html" > wall/region< / A > - use region surface as wall
< LI > < A HREF = "fix_wall_srd.html" > wall/srd< / A > - slip/no-slip wall for SRD particles
2006-09-22 00:22:34 +08:00
< / UL >
2007-10-03 06:56:45 +08:00
< P > There are also additional fix styles submitted by users which are
included in the LAMMPS distribution. The list of these with links to
2011-08-26 01:01:01 +08:00
the individual styles are given in the fix section of < A HREF = "Section_commands.html#cmd_5" > this
2007-10-03 06:56:45 +08:00
page< / A > .
< / P >
2011-05-27 08:22:06 +08:00
< P > There are also additional accelerated fix styles included in the
LAMMPS distribution for faster performance on CPUs and GPUs. The list
of these with links to the individual styles are given in the pair
2011-08-26 01:01:01 +08:00
section of < A HREF = "Section_commands.html#cmd_5" > this page< / A > .
2011-05-27 08:22:06 +08:00
< / P >
2006-09-22 00:22:34 +08:00
< P > < B > Restrictions:< / B >
< / P >
< P > Some fix styles are part of specific packages. They are only enabled
2011-08-26 00:46:23 +08:00
if LAMMPS was built with that package. See the < A HREF = "Section_start.html#start_3" > Making
LAMMPS< / A > section for more info on packages.
The doc pages for individual fixes tell if it is part of a package.
2006-09-22 00:22:34 +08:00
< / P >
< P > < B > Related commands:< / B >
< / P >
< P > < A HREF = "unfix.html" > unfix< / A > , < A HREF = "fix_modify.html" > fix_modify< / A >
< / P >
< P > < B > Default:< / B > none
< / P >
< / HTML >