2009-02-28 06:26:36 +08:00
|
|
|
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
|
|
|
|
|
|
|
:link(lws,http://lammps.sandia.gov)
|
|
|
|
:link(ld,Manual.html)
|
|
|
|
:link(lc,Section_commands.html#comm)
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
fix box/relax command :h3
|
|
|
|
|
|
|
|
[Syntax:]
|
|
|
|
|
2010-04-03 00:51:06 +08:00
|
|
|
fix ID group-ID box/relax keyword value ... :pre
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
ID, group-ID are documented in "fix"_fix.html command :ulb,l
|
|
|
|
box/relax = style name of this fix command :l
|
2010-04-03 00:51:06 +08:00
|
|
|
one or more keyword value pairs may be appended
|
|
|
|
keyword = {iso} or {aniso} or {tri} or {x} or {y} or {z} or {xy} or {yz} or {xz} or {couple} or {nreset} or {vmax} or {dilate}
|
|
|
|
{iso} or {aniso} or {tri} value = Ptarget = desired pressure (pressure units)
|
|
|
|
{x} or {y} or {z} or {xy} or {yz} or {xz} value = Ptarget = desired pressure (pressure units)
|
|
|
|
{couple} = {none} or {xyz} or {xy} or {yz} or {xz}
|
|
|
|
{nreset} value = reset reference cell every this many minimizer iterations
|
|
|
|
{vmax} value = fraction = max allowed volume change in one iteration
|
|
|
|
{dilate} value = {all} or {partial} :pre
|
2009-02-28 06:26:36 +08:00
|
|
|
:ule
|
|
|
|
|
|
|
|
[Examples:]
|
|
|
|
|
2010-04-08 02:33:34 +08:00
|
|
|
fix 1 all box/relax iso 0.0 vmax 0.001
|
2010-04-03 00:51:06 +08:00
|
|
|
fix 2 water box/relax aniso 0.0 dilate partial
|
|
|
|
fix 2 ice box/relax tri 0.0 couple xy nreset 100 :pre
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
[Description:]
|
|
|
|
|
2010-04-03 00:51:06 +08:00
|
|
|
Apply an external pressure or stress tensor to the simulation box
|
|
|
|
during an "energy minimization"_minimize.html. This allows the box
|
|
|
|
size and shape to vary during the iterations of the minimizer so that
|
|
|
|
the final configuration will be both an energy minimum for the
|
|
|
|
potential energy of the atoms, and the system pressure tensor will be
|
|
|
|
close to the specified external tensor. Conceptually, specifying a
|
|
|
|
positive pressure is like squeezing on the simulation box; a negative
|
|
|
|
pressure typically allows the box to expand.
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
The external pressure tensor is specified using one or more of the
|
|
|
|
{iso}, {aniso}, {tri}, {x}, {y}, {z}, {xy}, {xz}, {yz}, and {couple}
|
|
|
|
keywords. These keywords give you the ability to specify all 6
|
|
|
|
components of an external stress tensor, and to couple various of
|
|
|
|
these components together so that the dimensions they represent are
|
|
|
|
varied together during the mimimization.
|
|
|
|
|
|
|
|
Orthogonal simulation boxes have 3 adjustable dimensions (x,y,z).
|
|
|
|
Triclinic (non-orthogonal) simulation boxes have 6 adjustable
|
|
|
|
dimensions (x,y,z,xy,xz,yz). The "create_box"_create_box.html, "read
|
|
|
|
data"_read_data.html, and "read_restart"_read_restart.html commands
|
|
|
|
specify whether the simulation box is orthogonal or non-orthogonal
|
|
|
|
(triclinic) and explain the meaning of the xy,xz,yz tilt factors.
|
|
|
|
|
|
|
|
The target pressures {Ptarget} for each of the 6 components of the
|
|
|
|
stress tensor can be specified independently via the {x}, {y}, {z},
|
|
|
|
{xy}, {xz}, {yz} keywords, which correspond to the 6 simulation box
|
|
|
|
dimensions. For example, if the {y} keyword is used, the y-box length
|
|
|
|
will change during the minimization. If the {xy} keyword is used, the
|
|
|
|
xy tilt factor will change. A box dimension will not change if that
|
|
|
|
component is not specified.
|
|
|
|
|
|
|
|
Note that in order to use the {xy}, {xz}, or {yz} keywords, the
|
|
|
|
simulation box must be triclinic, even if its initial tilt factors are
|
|
|
|
0.0.
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
When the size of the simulation box changes, all atoms are re-scaled
|
|
|
|
to new positions, unless the keyword {dilate} is specified with a
|
|
|
|
value of {partial}, in which case only the atoms in the fix group are
|
|
|
|
re-scaled. This can be useful for leaving the coordinates of atoms in
|
|
|
|
a solid substrate unchanged and controlling the pressure of a
|
|
|
|
surrounding fluid.
|
|
|
|
|
2010-04-03 00:51:06 +08:00
|
|
|
:line
|
|
|
|
|
|
|
|
The {couple} keyword allows two or three of the diagonal components of
|
|
|
|
the pressure tensor to be "coupled" together. The value specified
|
|
|
|
with the keyword determines which are coupled. For example, {xz}
|
|
|
|
means the {Pxx} and {Pzz} components of the stress tensor are coupled.
|
|
|
|
{Xyz} means all 3 diagonal components are coupled. Coupling means two
|
|
|
|
things: the instantaneous stress will be computed as an average of the
|
|
|
|
corresponding diagonal components, and the coupled box dimensions will
|
|
|
|
be changed together in lockstep, meaning coupled dimensions will be
|
|
|
|
dilated or contracted by the same percentage every timestep. The
|
|
|
|
{Ptarget} values for any coupled dimensions must be identical.
|
|
|
|
{Couple xyz} can be used for a 2d simulation; the {z} dimension is
|
|
|
|
simply ignored.
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
The {iso}, {aniso}, and {tri} keywords are simply shortcuts that are
|
|
|
|
equivalent to specifying several other keywords together.
|
|
|
|
|
|
|
|
The keyword {iso} means couple all 3 diagonal components together when
|
|
|
|
pressure is computed (hydrostatic pressure), and dilate/contract the
|
|
|
|
dimensions together. Using "iso Ptarget" is the same as specifying
|
|
|
|
these 4 keywords:
|
|
|
|
|
|
|
|
x Ptarget
|
|
|
|
y Ptarget
|
|
|
|
z Ptarget
|
|
|
|
couple xyz :pre
|
|
|
|
|
|
|
|
The keyword {aniso} means {x}, {y}, and {z} dimensions are controlled
|
|
|
|
independently using the {Pxx}, {Pyy}, and {Pzz} components of the
|
|
|
|
stress tensor as the driving forces, and the specified scalar external
|
|
|
|
pressure. Using "aniso Ptarget" is the same as specifying these 4
|
|
|
|
keywords:
|
|
|
|
|
|
|
|
x Ptarget
|
|
|
|
y Ptarget
|
|
|
|
z Ptarget
|
|
|
|
couple none :pre
|
|
|
|
|
|
|
|
The keyword {tri} means {x}, {y}, {z}, {xy}, {xz}, and {yz} dimensions
|
|
|
|
are controlled independently using their individual stress components
|
|
|
|
as the driving forces, and the specified scalar pressure as the
|
|
|
|
external normal stress. Using "tri Ptarget" is the same as specifying
|
|
|
|
these 7 keywords:
|
|
|
|
|
|
|
|
x Ptarget
|
|
|
|
y Ptarget
|
|
|
|
z Ptarget
|
|
|
|
xy 0.0
|
|
|
|
yz 0.0
|
|
|
|
xz 0.0
|
|
|
|
couple none :pre
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
2009-03-06 05:17:05 +08:00
|
|
|
The {vmax} keyword can be used to limit the fractional change in the
|
|
|
|
volume of the simulation box that can occur in one iteration of the
|
|
|
|
minimizer. If the pressure is not settling down during the
|
|
|
|
minimization this can be because the volume is fluctuating too much.
|
2010-04-03 00:51:06 +08:00
|
|
|
The specified fraction must be greater than 0.0 and should be << 1.0.
|
2009-03-06 05:17:05 +08:00
|
|
|
A value of 0.001 means the volume cannot change by more than 1/10 of a
|
2010-04-03 00:51:06 +08:00
|
|
|
percent in one iteration when {couple xyz} has been specified. For
|
|
|
|
any other case it means no linear dimension of the simulation box can
|
|
|
|
change by more than 1/10 of a percent.
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
2010-04-08 02:33:34 +08:00
|
|
|
With this fix, the potential energy used by the minimizer is augmented
|
2010-04-03 00:51:06 +08:00
|
|
|
by an additional energy provided by the fix. The overall objective
|
|
|
|
function then is:
|
|
|
|
|
|
|
|
:c,image(Eqs/fix_box_relax1.jpg)
|
|
|
|
|
|
|
|
where {U} is the system potential energy, {P}_t is the desired
|
|
|
|
hydrostatic pressure, {V} and {V}_0 are the system and reference
|
|
|
|
volumes, respectively. {E}_{strain} is the strain energy expression
|
|
|
|
proposed by Parrinello and Rahman "(Parrinello1981)"_#Parrinello1981.
|
|
|
|
Taking derivatives of {E} w.r.t. the box dimensions, and setting these
|
|
|
|
to zero, we find that at the minimum of the objective function, the
|
|
|
|
global system stress tensor [P] will satisfy the relation:
|
|
|
|
|
|
|
|
:c,image(Eqs/fix_box_relax2.jpg)
|
|
|
|
|
2010-04-08 02:33:34 +08:00
|
|
|
where [I] is the identity matrix, [h]_0 is the box dimension tensor of
|
2010-04-03 00:51:06 +08:00
|
|
|
the reference cell, and [h]_0{d} is the diagonal part of
|
|
|
|
[h]_0. [S]_{t} is a symmetric stress tensor that is chosen by LAMMPS
|
|
|
|
so that the upper-triangular components of [P] equal the stress tensor
|
|
|
|
specified by the user.
|
|
|
|
|
|
|
|
This equation only applies when the box dimensions are equal to those
|
|
|
|
of the reference dimensions. If this is not the case, then the
|
|
|
|
converged stress tensor will not equal that specified by the user. We
|
|
|
|
can resolve this problem by periodically resetting the reference
|
|
|
|
dimensions. The keyword {nreset_ref} controls how often this is done.
|
|
|
|
If this keyword is not used, or is given a value of zero, then the
|
|
|
|
reference dimensions are set to those of the initial simulation domain
|
|
|
|
and are never changed. A value of {nstep} means that every {nstep}
|
|
|
|
minimization steps, the reference dimensions are set to those of the
|
|
|
|
current simulation domain. Note that resetting the reference
|
|
|
|
dimensions changes the objective function and gradients, which
|
|
|
|
sometimes causes the minimization to fail. This can be resolved by
|
|
|
|
changing the value of {nreset}, or simply continuing the minimization
|
|
|
|
from a restart file.
|
2009-03-06 05:17:05 +08:00
|
|
|
|
|
|
|
IMPORTANT NOTE: As normally computed, pressure includes a kinetic-
|
|
|
|
energy or temperature-dependent component; see the "compute
|
|
|
|
pressure"_compute_pressure.html command. However, atom velocities are
|
|
|
|
ignored during a minimization, and the applied pressure(s) specified
|
|
|
|
with this command are assumed to only be the virial component of the
|
|
|
|
pressure (the non-kinetic portion). Thus if atoms have a non-zero
|
|
|
|
temperature and you print the usual thermodynamic pressure, it may not
|
|
|
|
appear the system is converging to your specified pressure. The
|
|
|
|
solution for this is to either (a) zero the velocities of all atoms
|
|
|
|
before performing the minimization, or (b) make sure you are
|
2010-04-03 00:51:06 +08:00
|
|
|
monitoring the pressure without its kinetic component. The latter can
|
|
|
|
be done by outputting the pressure from the fix this command creates
|
|
|
|
(see below) or a pressure fix you define yourself.
|
2009-03-06 05:17:05 +08:00
|
|
|
|
|
|
|
IMPORTANT NOTE: Because pressure is often a very sensitive function of
|
|
|
|
volume, it can be difficult for the minimizer to equilibrate the
|
2010-04-03 00:51:06 +08:00
|
|
|
system the desired pressure with high precision, particularly for
|
2010-04-08 02:33:34 +08:00
|
|
|
solids. Some techniques that seem to help are (a) use the
|
2010-04-03 00:51:06 +08:00
|
|
|
"min_modify line quadratic" option when minimizing with box
|
|
|
|
relaxations, and (b) minimize several times in succession if need be,
|
|
|
|
to drive the pressure closer to the target pressure. Also note that
|
|
|
|
some systems (e.g. liquids) will not sustain a non-hydrostatic applied
|
|
|
|
pressure, which means the minimizer will not converge.
|
2009-03-06 05:17:05 +08:00
|
|
|
|
2009-02-28 06:26:36 +08:00
|
|
|
:line
|
|
|
|
|
|
|
|
This fix computes a temperature and pressure each timestep. The
|
|
|
|
temperature is used to compute the kinetic contribution to the
|
2009-03-06 05:17:05 +08:00
|
|
|
pressure, even though this is subsequently ignored by default. To do
|
|
|
|
this, the fix creates its own computes of style "temp" and "pressure",
|
|
|
|
as if these commands had been issued:
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
compute fix-ID_temp group-ID temp
|
2009-03-06 05:17:05 +08:00
|
|
|
compute fix-ID_press group-ID pressure fix-ID_temp virial :pre
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
See the "compute temp"_compute_temp.html and "compute
|
|
|
|
pressure"_compute_pressure.html commands for details. Note that the
|
|
|
|
IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID
|
|
|
|
+ underscore + "press", and the group for the new computes is the same
|
2009-03-06 05:17:05 +08:00
|
|
|
as the fix group. Also note that the pressure compute does not
|
|
|
|
include a kinetic component.
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
Note that these are NOT the computes used by thermodynamic output (see
|
|
|
|
the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}
|
|
|
|
and {thermo_press}. This means you can change the attributes of this
|
|
|
|
fix's temperature or pressure via the
|
|
|
|
"compute_modify"_compute_modify.html command or print this temperature
|
|
|
|
or pressure during thermodynamic output via the "thermo_style
|
|
|
|
custom"_thermo_style.html command using the appropriate compute-ID.
|
|
|
|
It also means that changing attributes of {thermo_temp} or
|
|
|
|
{thermo_press} will have no effect on this fix.
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
[Restart, fix_modify, output, run start/stop, minimize info:]
|
|
|
|
|
|
|
|
No information about this fix is written to "binary restart
|
|
|
|
files"_restart.html.
|
|
|
|
|
|
|
|
The "fix_modify"_fix_modify.html {temp} and {press} options are
|
|
|
|
supported by this fix. You can use them to assign a
|
|
|
|
"compute"_compute.html you have defined to this fix which will be used
|
2009-03-06 05:17:05 +08:00
|
|
|
in its temperature and pressure calculation, as described above. Note
|
|
|
|
that as described above, if you assign a pressure compute to this fix
|
|
|
|
that includes a kinetic energy component it will affect the
|
|
|
|
minimization, most likely in an undesirable way.
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
IMPORTANT NOTE: If both the {temp} and {press} keywords are used in a
|
|
|
|
single thermo_modify command (or in two separate commands), then the
|
|
|
|
order in which the keywords are specified is important. Note that a
|
|
|
|
"pressure compute"_compute_pressure.html defines its own temperature
|
|
|
|
compute as an argument when it is specified. The {temp} keyword will
|
|
|
|
override this (for the pressure compute being used by fix npt), but
|
|
|
|
only if the {temp} keyword comes after the {press} keyword. If the
|
|
|
|
{temp} keyword comes before the {press} keyword, then the new pressure
|
|
|
|
compute specified by the {press} keyword will be unaffected by the
|
|
|
|
{temp} setting.
|
|
|
|
|
2010-04-03 00:51:06 +08:00
|
|
|
This fix computes a global scalar which can be accessed by various
|
|
|
|
"output commands"_Section_howto.html#4_15. The scalar is the
|
|
|
|
pressure-volume energy, plus the strain energy, if it exists.
|
|
|
|
|
2009-02-28 06:26:36 +08:00
|
|
|
No parameter of this fix can be used with the {start/stop} keywords of
|
|
|
|
the "run"_run.html command.
|
|
|
|
|
|
|
|
This fix is invoked during "energy minimization"_minimize.html, but
|
|
|
|
not for the purpose of adding a contribution to the energy or forces
|
2009-03-06 05:17:05 +08:00
|
|
|
being minimized. Instead it alters the simulation box geometry as
|
|
|
|
described above.
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
[Restrictions:]
|
|
|
|
|
2010-04-03 00:51:06 +08:00
|
|
|
Only dimensions that are available can be adjusted by this fix.
|
|
|
|
Non-periodic dimensions are not available. {z}, {xz}, and {yz}, are
|
|
|
|
not available for 2D simulations. {xy}, {xz}, and {yz} are only
|
|
|
|
available if the simulation domain is non-orthogonal. The
|
|
|
|
"create_box"_create_box.html, "read data"_read_data.html, and
|
|
|
|
"read_restart"_read_restart.html commands specify whether the
|
|
|
|
simulation box is orthogonal or non-orthogonal (triclinic) and explain
|
|
|
|
the meaning of the xy,xz,yz tilt factors.
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
[Related commands:]
|
|
|
|
|
2010-04-03 00:51:06 +08:00
|
|
|
"fix npt"_fix_nh.html, "minimize"_minimize.html
|
2009-02-28 06:26:36 +08:00
|
|
|
|
|
|
|
[Default:]
|
|
|
|
|
2010-04-03 00:51:06 +08:00
|
|
|
The keyword defaults are dilate = all, vmax = 0.0001, nreset = 0.
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
:link(Parrinello1981)
|
|
|
|
[(Parrinello1981)] Parrinello and Rahman, J Appl Phys, 52, 7182 (1981).
|