git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5022 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2010-10-12 17:58:24 +00:00
parent 4c837166d3
commit a7c21670c8
6 changed files with 470 additions and 260 deletions

View File

@ -19,39 +19,40 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>fix ID group-ID style keyword values ... <PRE>fix ID group-ID style face args ... keyword value ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command <UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>style = <I>wall/lj93</I> or <I>wall/lj126</I> or <I>wall/colloid</I> or <I>wall/harmonic</I> <LI>style = <I>wall/lj93</I> or <I>wall/lj126</I> or <I>wall/colloid</I> or <I>wall/harmonic</I>
<LI>one or more keyword/value pairs may be appended <LI>one or more face/arg pairs may be appended
<LI>keyword = <I>xlo</I> or <I>xhi</I> or <I>ylo</I> or <I>yhi</I> or <I>zlo</I> or <I>zhi</I> or <I>vel</I> or <I>wiggle/sin</I> or <I>wiggle/cos</I> or <I>units</I> <LI>face = <I>xlo</I> or <I>xhi</I> or <I>ylo</I> or <I>yhi</I> or <I>zlo</I> or <I>zhi</I>
<PRE> <I>xlo</I>, <I>xhi</I>, <I>ylo</I>, <I>yhi</I>, <I>zlo</I>, <I>zhi</I> values = coord epsilon sigma cutoff <PRE> args = coord epsilon sigma cutoff
coord = position of wall (distance units) coord = position of wall = EDGE or constant or variable
EDGE = current lo or hi edge of simulation box
constant = number like 0.0 or -30.0 (distance units)
variable = <A HREF = "variable.html">equal-style variable</A> like v_x or v_wiggle
epsilon = strength factor for wall-particle interaction (energy or energy/distance^2 units) epsilon = strength factor for wall-particle interaction (energy or energy/distance^2 units)
sigma = size factor for wall-particle interaction (distance units) sigma = size factor for wall-particle interaction (distance units)
cutoff = distance from wall at which wall-particle interaction is cut off (distance units) cutoff = distance from wall at which wall-particle interaction is cut off (distance units)
<I>vel</I> value = v </PRE>
v = velocity of wall in perpendicular direction (velocity units) <LI>zero or more keyword/value pairs may be appended
<I>wiggle/sin</I> values = amplitude period
amplitude = size of oscillation (distance units) <LI>keyword = <I>units</I>
period = time of oscillation (time units)
<I>wiggle/cos</I> values = amplitude period <PRE> <I>units</I> value = <I>lattice</I> or <I>box</I>
amplitude = size of oscillation (distance units) <I>lattice</I> = the wall position is defined in lattice units
period = time of oscillation (time units) <I>box</I> = the wall position is defined in simulation box units
<I>units</I> value = <I>lattice</I> or <I>box</I>
lattice = the wall is defined in lattice units
box = the wall is defined in simulation box units
</PRE> </PRE>
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>fix wallhi all wall/lj93 xhi 10.0 1.0 1.0 2.5 <PRE>fix wallhi all wall/lj93 xlo -1.0 1.0 1.0 2.5 units box
fix wallhi all wall/lj126 xhi 23.2 1.0 1.0 2.5 vel 1.0 units box fix wallhi all wall/lj93 xhi EDGE 1.0 1.0 2.5
fix wallhi all wall/lj126 v_wiggle 23.2 1.0 1.0 2.5
fix zwalls all wall/colloid zlo 0.0 1.0 1.0 0.858 zhi 40.0 1.0 1.0 0.858 fix zwalls all wall/colloid zlo 0.0 1.0 1.0 0.858 zhi 40.0 1.0 1.0 0.858
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
@ -85,6 +86,27 @@ particle and wall no longer interact. The energy of the wall
potential is shifted so that the wall-particle interaction energy is potential is shifted so that the wall-particle interaction energy is
0.0 at the cutoff distance. 0.0 at the cutoff distance.
</P> </P>
<P>Up to 6 walls or faces can be specified in a single command: <I>xlo</I>,
<I>xhi</I>, <I>ylo</I>, <I>yhi</I>, <I>zlo</I>, <I>zhi</I>. A <I>lo</I> face interacts with
particles near the lower side of the simulation box in that dimension.
A <I>hi</I> face interacts with particles near the upper side of the
simulation box in that dimension.
</P>
<P>The position of each wall can be specified in one of 3 ways: as the
EDGE of the simulation box, as a constant value, or as a variable. If
EDGE is used, then the corresponding boundary of the current
simulation box is used. If a numeric constant is specified then the
wall is placed at that position in the appropriate dimension (x, y, or
z). In both the EDGE and constant cases, the wall will never move.
If the wall position is a variable, it should be specified as v_name,
where name is an <A HREF = "variable.html">equal-style variable</A> name. In this
case the variable is evaluated each timestep and the result becomes
the current position of the reflecting wall. Equal-style variables
can specify formulas with various mathematical functions, and include
<A HREF = "thermo_style.html">thermo_style</A> command keywords for the simulation
box parameters and timestep and elapsed time. Thus it is easy to
specify a time-dependent wall position. See examples below.
</P>
<P>For the <I>wall/lj93</I> and <I>wall/lj126</I> styles, <I>epsilon</I> and <I>sigma</I> are <P>For the <I>wall/lj93</I> and <I>wall/lj126</I> styles, <I>epsilon</I> and <I>sigma</I> are
the usual Lennard-Jones parameters, which determine the strength and the usual Lennard-Jones parameters, which determine the strength and
size of the particle as it interacts with the wall. Epsilon has size of the particle as it interacts with the wall. Epsilon has
@ -129,56 +151,55 @@ potential and does not blow up as r -> 0, but you must use a large
enough <I>epsilon</I> that particles always reamin on the correct side of enough <I>epsilon</I> that particles always reamin on the correct side of
the wall (r > 0). the wall (r > 0).
</P> </P>
<P>If the <I>vel</I> keyword is specified, the position of all walls will move
during the simulation in a perpendicular direction, based on their
initial <I>coord</I> position, the specified velocity <I>vel</I>, and the time
elapsed since the fix was specified. A positive velocity means each
wall moves inward, towards the center of the box. I.e. an <I>xlo</I> wall
will move in the +x direction and an <I>xhi</I> wall will move in the -x
direction. A negative velocity means each wall moves outward, away
from the center of the box. If you want different walls to move with
different velocities, then you need to use multiple fix wall commands.
</P>
<P>If the <I>wiggle/sin</I> keyword is specified, the position of all walls
will oscillate sinusoidally during the simulation in the perpendicular
direction, according to the equation:
</P>
<PRE>position = coord + A sin(omega*delta)
</PRE>
<P>If the <I>wiggle/cos</I> keyword is specified, the position of all walls
will oscillate sinusoidally during the simulation in the perpendicular
direction, according to the equation:
</P>
<PRE>position = coord + A (1 - cos(omega*delta))
</PRE>
<P>In both cases, <I>coord</I> is the specified initial position of the wall,
<I>A</I> is the <I>amplitude</I>, <I>omega</I> is 2 PI / <I>period</I>, and <I>delta</I> is the
time elapsed since the fix was specified. A positive amplitude means
each wall initially moves inward, towards the center of the box.
I.e. an <I>xlo</I> wall will move initially in the +x direction and an
<I>xhi</I> wall will move initially in the -x direction. A negative
velocity means each wall moves initially outward, away from the center
of the box. Note that the <I>wiggle/sin</I> option oscillates with
amplitude <I>A</I> around the pos0 position and the velocity of the wall is
a maximum at time 0. By contrast, for the <I>wiggle/cos</I> option the
wall moves up to <I>2A</I> away from pos0 in one direction and the velocity
of the wall is 0 at time 0. If you want different walls to oscillate
with different amplitudes or periods, then you need to use multiple
fix wall commands.
</P>
<P>The <I>units</I> keyword determines the meaning of the distance units used <P>The <I>units</I> keyword determines the meaning of the distance units used
to define the position of the wall and its velocity and wiggle to define a wall position, but only when a numeric constant is used.
amplitude. A <I>box</I> value selects standard distance units as defined It is not relevant when EDGE or a variable is used to specify a face
by the <A HREF = "units.html">units</A> command, e.g. Angstroms for units = real or position.
metal. A <I>lattice</I> value means the distance units are in lattice
spacings. The <A HREF = "lattice.html">lattice</A> command must have been
previously used to define the lattice spacing. Note that with the
<I>lattice</I> option, the wall's position is specified in lattice
spacings, the wall's velocity is specified in lattice spacings per
time, and the wall's oscillation amplitude is specified in lattice
spacings. Each of these 3 quantities may be dependent on the x,y,z
dimension, since the lattice spacings can be different in x,y,z.
</P> </P>
<P>A <I>box</I> value selects standard distance units as defined by the
<A HREF = "units.html">units</A> command, e.g. Angstroms for units = real or metal.
A <I>lattice</I> value means the distance units are in lattice spacings.
The <A HREF = "lattice.html">lattice</A> command must have been previously used to
define the lattice spacings.
</P>
<HR>
<P>Here are examples of variable definitions that move the wall position
in a time-dependent fashion using equal-style
<A HREF = "variable.html">variables</A>.
</P>
<PRE>variable ramp equal ramp(0,10)
fix 1 all wall xlo v_ramp 1.0 1.0 2.5
</PRE>
<PRE>variable linear equal vlinear(0,20)
fix 1 all wall xlo v_linear 1.0 1.0 2.5
</PRE>
<PRE>variable wiggle equal swiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5
</PRE>
<PRE>variable wiggle equal cwiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5
</PRE>
<P>The ramp(lo,hi) function adjusts the wall position linearly from lo to
hi over the course of a run. The linear(c0,velocity) function does
something similar using the equation position = c0 + velocity*delta,
where delta is the elapsed time.
</P>
<P>The swiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, where omega = 2 PI
/ period:
</P>
<PRE>position = c0 + A sin(omega*delta)
</PRE>
<P>The cwiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, which will have an
initial wall velocity of 0.0, and thus may impose a gentler
perturbation on the particles:
</P>
<PRE>position = c0 + A (1 - cos(omega*delta))
</PRE>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B> <P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P> </P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart <P>No information about this fix is written to <A HREF = "restart.html">binary restart

View File

@ -13,34 +13,32 @@ fix wall/harmonic command :h3
[Syntax:] [Syntax:]
fix ID group-ID style keyword values ... :pre fix ID group-ID style face args ... keyword value ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l ID, group-ID are documented in "fix"_fix.html command :ulb,l
style = {wall/lj93} or {wall/lj126} or {wall/colloid} or {wall/harmonic} :l style = {wall/lj93} or {wall/lj126} or {wall/colloid} or {wall/harmonic} :l
one or more keyword/value pairs may be appended :l one or more face/arg pairs may be appended :l
keyword = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} or {vel} or {wiggle/sin} or {wiggle/cos} or {units} :l face = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l
{xlo}, {xhi}, {ylo}, {yhi}, {zlo}, {zhi} values = coord epsilon sigma cutoff args = coord epsilon sigma cutoff
coord = position of wall (distance units) coord = position of wall = EDGE or constant or variable
EDGE = current lo or hi edge of simulation box
constant = number like 0.0 or -30.0 (distance units)
variable = "equal-style variable"_variable.html like v_x or v_wiggle
epsilon = strength factor for wall-particle interaction (energy or energy/distance^2 units) epsilon = strength factor for wall-particle interaction (energy or energy/distance^2 units)
sigma = size factor for wall-particle interaction (distance units) sigma = size factor for wall-particle interaction (distance units)
cutoff = distance from wall at which wall-particle interaction is cut off (distance units) cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :pre
{vel} value = v zero or more keyword/value pairs may be appended :l
v = velocity of wall in perpendicular direction (velocity units) keyword = {units} :l
{wiggle/sin} values = amplitude period
amplitude = size of oscillation (distance units)
period = time of oscillation (time units)
{wiggle/cos} values = amplitude period
amplitude = size of oscillation (distance units)
period = time of oscillation (time units)
{units} value = {lattice} or {box} {units} value = {lattice} or {box}
lattice = the wall is defined in lattice units {lattice} = the wall position is defined in lattice units
box = the wall is defined in simulation box units :pre {box} = the wall position is defined in simulation box units :pre
:ule :ule
[Examples:] [Examples:]
fix wallhi all wall/lj93 xhi 10.0 1.0 1.0 2.5 fix wallhi all wall/lj93 xlo -1.0 1.0 1.0 2.5 units box
fix wallhi all wall/lj126 xhi 23.2 1.0 1.0 2.5 vel 1.0 units box fix wallhi all wall/lj93 xhi EDGE 1.0 1.0 2.5
fix wallhi all wall/lj126 v_wiggle 23.2 1.0 1.0 2.5
fix zwalls all wall/colloid zlo 0.0 1.0 1.0 0.858 zhi 40.0 1.0 1.0 0.858 :pre fix zwalls all wall/colloid zlo 0.0 1.0 1.0 0.858 zhi 40.0 1.0 1.0 0.858 :pre
[Description:] [Description:]
@ -74,6 +72,27 @@ particle and wall no longer interact. The energy of the wall
potential is shifted so that the wall-particle interaction energy is potential is shifted so that the wall-particle interaction energy is
0.0 at the cutoff distance. 0.0 at the cutoff distance.
Up to 6 walls or faces can be specified in a single command: {xlo},
{xhi}, {ylo}, {yhi}, {zlo}, {zhi}. A {lo} face interacts with
particles near the lower side of the simulation box in that dimension.
A {hi} face interacts with particles near the upper side of the
simulation box in that dimension.
The position of each wall can be specified in one of 3 ways: as the
EDGE of the simulation box, as a constant value, or as a variable. If
EDGE is used, then the corresponding boundary of the current
simulation box is used. If a numeric constant is specified then the
wall is placed at that position in the appropriate dimension (x, y, or
z). In both the EDGE and constant cases, the wall will never move.
If the wall position is a variable, it should be specified as v_name,
where name is an "equal-style variable"_variable.html name. In this
case the variable is evaluated each timestep and the result becomes
the current position of the reflecting wall. Equal-style variables
can specify formulas with various mathematical functions, and include
"thermo_style"_thermo_style.html command keywords for the simulation
box parameters and timestep and elapsed time. Thus it is easy to
specify a time-dependent wall position. See examples below.
For the {wall/lj93} and {wall/lj126} styles, {epsilon} and {sigma} are For the {wall/lj93} and {wall/lj126} styles, {epsilon} and {sigma} are
the usual Lennard-Jones parameters, which determine the strength and the usual Lennard-Jones parameters, which determine the strength and
size of the particle as it interacts with the wall. Epsilon has size of the particle as it interacts with the wall. Epsilon has
@ -118,55 +137,54 @@ potential and does not blow up as r -> 0, but you must use a large
enough {epsilon} that particles always reamin on the correct side of enough {epsilon} that particles always reamin on the correct side of
the wall (r > 0). the wall (r > 0).
If the {vel} keyword is specified, the position of all walls will move
during the simulation in a perpendicular direction, based on their
initial {coord} position, the specified velocity {vel}, and the time
elapsed since the fix was specified. A positive velocity means each
wall moves inward, towards the center of the box. I.e. an {xlo} wall
will move in the +x direction and an {xhi} wall will move in the -x
direction. A negative velocity means each wall moves outward, away
from the center of the box. If you want different walls to move with
different velocities, then you need to use multiple fix wall commands.
If the {wiggle/sin} keyword is specified, the position of all walls
will oscillate sinusoidally during the simulation in the perpendicular
direction, according to the equation:
position = coord + A sin(omega*delta) :pre
If the {wiggle/cos} keyword is specified, the position of all walls
will oscillate sinusoidally during the simulation in the perpendicular
direction, according to the equation:
position = coord + A (1 - cos(omega*delta)) :pre
In both cases, {coord} is the specified initial position of the wall,
{A} is the {amplitude}, {omega} is 2 PI / {period}, and {delta} is the
time elapsed since the fix was specified. A positive amplitude means
each wall initially moves inward, towards the center of the box.
I.e. an {xlo} wall will move initially in the +x direction and an
{xhi} wall will move initially in the -x direction. A negative
velocity means each wall moves initially outward, away from the center
of the box. Note that the {wiggle/sin} option oscillates with
amplitude {A} around the pos0 position and the velocity of the wall is
a maximum at time 0. By contrast, for the {wiggle/cos} option the
wall moves up to {2A} away from pos0 in one direction and the velocity
of the wall is 0 at time 0. If you want different walls to oscillate
with different amplitudes or periods, then you need to use multiple
fix wall commands.
The {units} keyword determines the meaning of the distance units used The {units} keyword determines the meaning of the distance units used
to define the position of the wall and its velocity and wiggle to define a wall position, but only when a numeric constant is used.
amplitude. A {box} value selects standard distance units as defined It is not relevant when EDGE or a variable is used to specify a face
by the "units"_units.html command, e.g. Angstroms for units = real or position.
metal. A {lattice} value means the distance units are in lattice
spacings. The "lattice"_lattice.html command must have been A {box} value selects standard distance units as defined by the
previously used to define the lattice spacing. Note that with the "units"_units.html command, e.g. Angstroms for units = real or metal.
{lattice} option, the wall's position is specified in lattice A {lattice} value means the distance units are in lattice spacings.
spacings, the wall's velocity is specified in lattice spacings per The "lattice"_lattice.html command must have been previously used to
time, and the wall's oscillation amplitude is specified in lattice define the lattice spacings.
spacings. Each of these 3 quantities may be dependent on the x,y,z
dimension, since the lattice spacings can be different in x,y,z. :line
Here are examples of variable definitions that move the wall position
in a time-dependent fashion using equal-style
"variables"_variable.html.
variable ramp equal ramp(0,10)
fix 1 all wall xlo v_ramp 1.0 1.0 2.5 :pre
variable linear equal vlinear(0,20)
fix 1 all wall xlo v_linear 1.0 1.0 2.5 :pre
variable wiggle equal swiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5 :pre
variable wiggle equal cwiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5 :pre
The ramp(lo,hi) function adjusts the wall position linearly from lo to
hi over the course of a run. The linear(c0,velocity) function does
something similar using the equation position = c0 + velocity*delta,
where delta is the elapsed time.
The swiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, where omega = 2 PI
/ period:
position = c0 + A sin(omega*delta) :pre
The cwiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, which will have an
initial wall velocity of 0.0, and thus may impose a gentler
perturbation on the particles:
position = c0 + A (1 - cos(omega*delta)) :pre
:line
[Restart, fix_modify, output, run start/stop, minimize info:] [Restart, fix_modify, output, run start/stop, minimize info:]

View File

@ -32,13 +32,13 @@
constant = number like 50.0 or 100.3 (distance units) constant = number like 50.0 or 100.3 (distance units)
variable = <A HREF = "variable.html">equal-style variable</A> like v_x or v_wiggle variable = <A HREF = "variable.html">equal-style variable</A> like v_x or v_wiggle
</PRE> </PRE>
<LI>zero or more keyword/avlue pairs may be appended <LI>zero or more keyword/value pairs may be appended
<LI>keyword = <I>units</I> <LI>keyword = <I>units</I>
<PRE> <I>units</I> value = <I>lattice</I> or <I>box</I> <PRE> <I>units</I> value = <I>lattice</I> or <I>box</I>
<I>lattice</I> = the geometry is defined in lattice units <I>lattice</I> = the wall position is defined in lattice units
<I>box</I> = the geometry is defined in simulation box units <I>box</I> = the wall position is defined in simulation box units
</PRE> </PRE>
</UL> </UL>
@ -68,17 +68,17 @@ velocity-Verlet integration without reflective walls.
</P> </P>
<P>Up to 6 walls or faces can be specified in a single command: <I>xlo</I>, <P>Up to 6 walls or faces can be specified in a single command: <I>xlo</I>,
<I>xhi</I>, <I>ylo</I>, <I>yhi</I>, <I>zlo</I>, <I>zhi</I>. A <I>lo</I> face reflects particles <I>xhi</I>, <I>ylo</I>, <I>yhi</I>, <I>zlo</I>, <I>zhi</I>. A <I>lo</I> face reflects particles
that move to a coordinate less than the face position, back in the that move to a coordinate less than the wall position, back in the
<I>hi</I> direction. A <I>hi</I> face reflects particles that move to a <I>hi</I> direction. A <I>hi</I> face reflects particles that move to a
coordinate higher than the face position, back in the <I>lo</I> direction. coordinate higher than the wall position, back in the <I>lo</I> direction.
</P> </P>
<P>The position of each face can be specified in one of 3 ways: as the <P>The position of each wall can be specified in one of 3 ways: as the
EDGE of the simulation box, as a constant value, or as a variable. If EDGE of the simulation box, as a constant value, or as a variable. If
EDGE is used, then the corresponding boundary of the current EDGE is used, then the corresponding boundary of the current
simulation box is used. If a numeric constant is specified then the simulation box is used. If a numeric constant is specified then the
wall is placed at that position in the appropriate dimension (x, y, or wall is placed at that position in the appropriate dimension (x, y, or
z). In both the EDGE and constant cases, the wall will never move. z). In both the EDGE and constant cases, the wall will never move.
If the face position is a variable, it should be specified as v_name, If the wall position is a variable, it should be specified as v_name,
where name is an <A HREF = "variable.html">equal-style variable</A> name. In this where name is an <A HREF = "variable.html">equal-style variable</A> name. In this
case the variable is evaluated each timestep and the result becomes case the variable is evaluated each timestep and the result becomes
the current position of the reflecting wall. Equal-style variables the current position of the reflecting wall. Equal-style variables
@ -88,7 +88,7 @@ box parameters and timestep and elapsed time. Thus it is easy to
specify a time-dependent wall position. specify a time-dependent wall position.
</P> </P>
<P>The <I>units</I> keyword determines the meaning of the distance units used <P>The <I>units</I> keyword determines the meaning of the distance units used
to define a face position, but only when a numeric constant is used. to define a wall position, but only when a numeric constant is used.
It is not relevant when EDGE or a variable is used to specify a face It is not relevant when EDGE or a variable is used to specify a face
position. position.
</P> </P>
@ -100,6 +100,42 @@ define the lattice spacings.
</P> </P>
<HR> <HR>
<P>Here are examples of variable definitions that move the wall position
in a time-dependent fashion using equal-style
<A HREF = "variable.html">variables</A>.
</P>
<PRE>variable ramp equal ramp(0,10)
fix 1 all wall xlo v_ramp 1.0 1.0 2.5
</PRE>
<PRE>variable linear equal vlinear(0,20)
fix 1 all wall xlo v_linear 1.0 1.0 2.5
</PRE>
<PRE>variable wiggle equal swiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5
</PRE>
<PRE>variable wiggle equal cwiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5
</PRE>
<P>The ramp(lo,hi) function adjusts the wall position linearly from lo to
hi over the course of a run. The linear(c0,velocity) function does
something similar using the equation position = c0 + velocity*delta,
where delta is the elapsed time.
</P>
<P>The swiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, where omega = 2 PI
/ period:
</P>
<PRE>position = c0 + A sin(omega*delta)
</PRE>
<P>The cwiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, which will have an
initial wall velocity of 0.0, and thus may impose a gentler
perturbation on the particles:
</P>
<PRE>position = c0 + A (1 - cos(omega*delta))
</PRE>
<HR>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B> <P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P> </P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart <P>No information about this fix is written to <A HREF = "restart.html">binary restart

View File

@ -24,11 +24,11 @@ face = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l
EDGE = current hi edge of simulation box EDGE = current hi edge of simulation box
constant = number like 50.0 or 100.3 (distance units) constant = number like 50.0 or 100.3 (distance units)
variable = "equal-style variable"_variable.html like v_x or v_wiggle :pre variable = "equal-style variable"_variable.html like v_x or v_wiggle :pre
zero or more keyword/avlue pairs may be appended :l zero or more keyword/value pairs may be appended :l
keyword = {units} :l keyword = {units} :l
{units} value = {lattice} or {box} {units} value = {lattice} or {box}
{lattice} = the geometry is defined in lattice units {lattice} = the wall position is defined in lattice units
{box} = the geometry is defined in simulation box units :pre {box} = the wall position is defined in simulation box units :pre
:ule :ule
[Examples:] [Examples:]
@ -57,17 +57,17 @@ velocity-Verlet integration without reflective walls.
Up to 6 walls or faces can be specified in a single command: {xlo}, Up to 6 walls or faces can be specified in a single command: {xlo},
{xhi}, {ylo}, {yhi}, {zlo}, {zhi}. A {lo} face reflects particles {xhi}, {ylo}, {yhi}, {zlo}, {zhi}. A {lo} face reflects particles
that move to a coordinate less than the face position, back in the that move to a coordinate less than the wall position, back in the
{hi} direction. A {hi} face reflects particles that move to a {hi} direction. A {hi} face reflects particles that move to a
coordinate higher than the face position, back in the {lo} direction. coordinate higher than the wall position, back in the {lo} direction.
The position of each face can be specified in one of 3 ways: as the The position of each wall can be specified in one of 3 ways: as the
EDGE of the simulation box, as a constant value, or as a variable. If EDGE of the simulation box, as a constant value, or as a variable. If
EDGE is used, then the corresponding boundary of the current EDGE is used, then the corresponding boundary of the current
simulation box is used. If a numeric constant is specified then the simulation box is used. If a numeric constant is specified then the
wall is placed at that position in the appropriate dimension (x, y, or wall is placed at that position in the appropriate dimension (x, y, or
z). In both the EDGE and constant cases, the wall will never move. z). In both the EDGE and constant cases, the wall will never move.
If the face position is a variable, it should be specified as v_name, If the wall position is a variable, it should be specified as v_name,
where name is an "equal-style variable"_variable.html name. In this where name is an "equal-style variable"_variable.html name. In this
case the variable is evaluated each timestep and the result becomes case the variable is evaluated each timestep and the result becomes
the current position of the reflecting wall. Equal-style variables the current position of the reflecting wall. Equal-style variables
@ -77,7 +77,7 @@ box parameters and timestep and elapsed time. Thus it is easy to
specify a time-dependent wall position. specify a time-dependent wall position.
The {units} keyword determines the meaning of the distance units used The {units} keyword determines the meaning of the distance units used
to define a face position, but only when a numeric constant is used. to define a wall position, but only when a numeric constant is used.
It is not relevant when EDGE or a variable is used to specify a face It is not relevant when EDGE or a variable is used to specify a face
position. position.
@ -89,6 +89,42 @@ define the lattice spacings.
:line :line
Here are examples of variable definitions that move the wall position
in a time-dependent fashion using equal-style
"variables"_variable.html.
variable ramp equal ramp(0,10)
fix 1 all wall xlo v_ramp 1.0 1.0 2.5 :pre
variable linear equal vlinear(0,20)
fix 1 all wall xlo v_linear 1.0 1.0 2.5 :pre
variable wiggle equal swiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5 :pre
variable wiggle equal cwiggle(0.0,5.0,3.0)
fix 1 all wall xlo v_wiggle 1.0 1.0 2.5 :pre
The ramp(lo,hi) function adjusts the wall position linearly from lo to
hi over the course of a run. The linear(c0,velocity) function does
something similar using the equation position = c0 + velocity*delta,
where delta is the elapsed time.
The swiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, where omega = 2 PI
/ period:
position = c0 + A sin(omega*delta) :pre
The cwiggle(c0,A,period) function causes the wall position to
oscillate sinusoidally according to this equation, which will have an
initial wall velocity of 0.0, and thus may impose a gentler
perturbation on the particles:
position = c0 + A (1 - cos(omega*delta)) :pre
:line
[Restart, fix_modify, output, run start/stop, minimize info:] [Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart No information about this fix is written to "binary restart

View File

@ -41,12 +41,14 @@
<I>string</I> arg = one string <I>string</I> arg = one string
<I>equal</I> or <I>atom</I> args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references <I>equal</I> or <I>atom</I> args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references
numbers = 0.0, 100, -5.4, 2.8e-4, etc numbers = 0.0, 100, -5.4, 2.8e-4, etc
constants = PI
thermo keywords = vol, ke, press, etc from <A HREF = "thermo_style.html">thermo_style</A> thermo keywords = vol, ke, press, etc from <A HREF = "thermo_style.html">thermo_style</A>
math operators = (), -x, x+y, x-y, x*y, x/y, x^y, math operators = (), -x, x+y, x-y, x*y, x/y, x^y,
x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y
math functions = sqrt(x), exp(x), ln(x), log(x), math functions = sqrt(x), exp(x), ln(x), log(x),
sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x),
random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x) random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x)
ramp(x,y), stagger(x,y), logfreq(x,y,z), vlinear(x,y), swiggle(x,y,z), cwiggle(x,y,z)
group functions = count(group), mass(group), charge(group), group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim), xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group), ke(group), bound(group,xmin), gyration(group), ke(group),
@ -55,7 +57,7 @@
xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region), xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region),
bound(group,xmin,region), gyration(group,region), ke(group,reigon), bound(group,xmin,region), gyration(group,region), ke(group,reigon),
angmom(group,dim,region), inertia(group,dimdim,region),omega(group,dim,region) angmom(group,dim,region), inertia(group,dimdim,region),omega(group,dim,region)
special functions = ramp(x,y), stagger(x,y), logfreq(x,y,z), sum(x), min(x), max(x), ave(x), trap(x) special functions = sum(x), min(x), max(x), ave(x), trap(x)
atom value = mass[i], type[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i] atom value = mass[i], type[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i]
atom vector = mass, type, x, y, z, vx, vy, vz, fx, fy, fz atom vector = mass, type, x, y, z, vx, vy, vz, fx, fy, fz
compute references = c_ID, c_ID[i], c_ID[i][j] compute references = c_ID, c_ID[i], c_ID[i][j]
@ -268,12 +270,13 @@ references to other variables.
</P> </P>
<DIV ALIGN=center><TABLE BORDER=1 > <DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >Number</TD><TD > 0.2, 100, 1.0e20, -15.4, etc</TD></TR> <TR><TD >Number</TD><TD > 0.2, 100, 1.0e20, -15.4, etc</TD></TR>
<TR><TD >Constant</TD><TD > PI</TD></TR>
<TR><TD >Thermo keywords</TD><TD > vol, pe, ebond, etc</TD></TR> <TR><TD >Thermo keywords</TD><TD > vol, pe, ebond, etc</TD></TR>
<TR><TD >Math operators</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y</TD></TR> <TR><TD >Math operators</TD><TD > (), -x, x+y, x-y, x*y, x/y, x^y, x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y</TD></TR>
<TR><TD >Math functions</TD><TD > sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x)</TD></TR> <TR><TD >Math functions</TD><TD > sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x), ramp(x,y), stagger(x,y), logfreq(x,y,z), vlinear(x,y), swiggle(x,y,z), cwiggle(x,y,z)</TD></TR>
<TR><TD >Group functions</TD><TD > count(ID), mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID), angmom(ID,dim), inertia(ID,dimdim), omega(ID,dim)</TD></TR> <TR><TD >Group functions</TD><TD > count(ID), mass(ID), charge(ID), xcm(ID,dim), vcm(ID,dim), fcm(ID,dim), bound(ID,dir), gyration(ID), ke(ID), angmom(ID,dim), inertia(ID,dimdim), omega(ID,dim)</TD></TR>
<TR><TD >Region functions</TD><TD > count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR), angmom(ID,dim,IDR), inertia(ID,dimdim,IDR), omega(ID,dim,IDR)</TD></TR> <TR><TD >Region functions</TD><TD > count(ID,IDR), mass(ID,IDR), charge(ID,IDR), xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR), angmom(ID,dim,IDR), inertia(ID,dimdim,IDR), omega(ID,dim,IDR)</TD></TR>
<TR><TD >Special functions</TD><TD > ramp(x,y), stagger(x,y), logfreq(x,y,z), sum(x), min(x), max(x), ave(x), trap(x)</TD></TR> <TR><TD >Special functions</TD><TD > sum(x), min(x), max(x), ave(x), trap(x)</TD></TR>
<TR><TD >Atom values</TD><TD > mass[i], type[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i]</TD></TR> <TR><TD >Atom values</TD><TD > mass[i], type[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i]</TD></TR>
<TR><TD >Atom vectors</TD><TD > mass, type, x, y, z, vx, vy, vz, fx, fy, fz</TD></TR> <TR><TD >Atom vectors</TD><TD > mass, type, x, y, z, vx, vy, vz, fx, fy, fz</TD></TR>
<TR><TD >Compute references</TD><TD > c_ID, c_ID[i], c_ID[i][j]</TD></TR> <TR><TD >Compute references</TD><TD > c_ID, c_ID[i], c_ID[i][j]</TD></TR>
@ -312,6 +315,8 @@ discussion below about "Variable Accuracy".
</P> </P>
<HR> <HR>
<H4>Math Operators
</H4>
<P>Math operators are written in the usual way, where the "x" and "y" in <P>Math operators are written in the usual way, where the "x" and "y" in
the examples can themselves be arbitrarily complex formulas, as in the the examples can themselves be arbitrarily complex formulas, as in the
examples above. In this syntax, "x" and "y" can be scalar values or examples above. In this syntax, "x" and "y" can be scalar values or
@ -344,8 +349,12 @@ whose properties satifsy one or more criteria could be calculated by
taking the returned per-atom vector of ones and zeroes and passing it taking the returned per-atom vector of ones and zeroes and passing it
to the <A HREF = "compute_reduce.html">compute reduce</A> command. to the <A HREF = "compute_reduce.html">compute reduce</A> command.
</P> </P>
<HR>
<H4>Math Functions
</H4>
<P>Math functions are specified as keywords followed by one or more <P>Math functions are specified as keywords followed by one or more
parenthesized arguments "x", "y", etc, each of which can themselves be parenthesized arguments "x", "y", "z", each of which can themselves be
arbitrarily complex formulas. In this syntax, the arguments can arbitrarily complex formulas. In this syntax, the arguments can
represent scalar values or per-atom vectors. In the latter case, the represent scalar values or per-atom vectors. In the latter case, the
math operation is performed on each element of the vector. For math operation is performed on each element of the vector. For
@ -356,31 +365,95 @@ product of one atom's y and z coordinates.
<P>Most of the math functions perform obvious operations. The ln() is <P>Most of the math functions perform obvious operations. The ln() is
the natural log; log() is the base 10 log. the natural log; log() is the base 10 log.
</P> </P>
<P>The random() function generates a uniform random number between lo and <P>The random(x,y,z) function takes 3 arguments: x = lo, y = hi, and z =
hi. The normal() function generates a Gaussian variate centered on mu seed. It generates a uniform random number between lo and hi. The
with variance sigma^2. In both cases the seed is used the first time normal(x,y,z) function also takes 3 arguments: x = mu, y = sigma, and
the internal random number generator is invoked, to initialize it. z = seed. It generates a Gaussian variate centered on mu with
For equal-style variables, every processor uses the same seed so that variance sigma^2. In both cases the seed is used the first time the
they each generate the same sequence of random numbers. For internal random number generator is invoked, to initialize it. For
atom-style variables, a unique seed is created for each processor, equal-style variables, every processor uses the same seed so that they
based on the specified seed. This effectively generates a different each generate the same sequence of random numbers. For atom-style
random number for each atom being looped over in the atom-style variables, a unique seed is created for each processor, based on the
variable. specified seed. This effectively generates a different random number
for each atom being looped over in the atom-style variable.
</P>
<P>IMPORTANT NOTE: Internally, there is just one random number generator
for all equal-style variables and one for all atom-style variables.
If you define multiple variables (of each style) which use the
random() or normal() math functions, then the internal random number
generators will only be initialized once, which means only one of the
specified seeds will determine the sequence of generated random
numbers.
</P> </P>
<P>The ceil(), floor(), and round() functions are those in the C math <P>The ceil(), floor(), and round() functions are those in the C math
library. Ceil() is the smallest integer not less than its argument. library. Ceil() is the smallest integer not less than its argument.
Floor() if the largest integer not greater than its argument. Round() Floor() if the largest integer not greater than its argument. Round()
is the nearest integer to its argument. is the nearest integer to its argument.
</P> </P>
<P>IMPORTANT NOTE: Internally, there is just one random number generator <P>The ramp(x,y) function uses the current timestep to generate a value
for equal-style variables and one for atom-style variables. If you linearly intepolated between the specified x,y values over the course
define multiple variables (of each style) which use the random() or of a run, according to this formula:
normal() math functions, then the internal random number generators </P>
will only be initialized once, which means only one of the specified <PRE>value = x + (y-x) * (timestep-startstep) / (stopstep-startstep)
seeds will determine the sequence of generated random numbers. </PRE>
<P>The run begins on startstep and ends on stopstep. Startstep and
stopstep can span multiple runs, using the <I>start</I> and <I>stop</I> keywords
of the <A HREF = "run.html">run</A> command. See the <A HREF = "run.html">run</A> command for
details of how to do this.
</P>
<P>The stagger(x,y) function uses the current timestep to generate a new
timestep. X,y > 0 and x > y is required. The generated timesteps
increase in a staggered fashion, as the sequence
x,x+y,2x,2x+y,3x,3x+y,etc. For any current timestep, the next
timestep in the sequence is returned. Thus if stagger(1000,100) is
used in a variable by the <A HREF = "dump_modify.html">dump_modify every</A>
command, it will generate the sequence of output timesteps:
</P>
<PRE>100,1000,1100,2000,2100,3000,etc
</PRE>
<P>The logfreq(x,y,z) function uses the current timestep to generate a
new timestep. X,y,z > 0 and y < z is required. The generated
timesteps increase in a logarithmic fashion, as the sequence
x,2x,3x,...y*x,z*x,2*z*x,3*z*x,...y*z*x,z*z*x,2*z*x*x,etc. For any
current timestep, the next timestep in the sequence is returned. Thus
if logfreq(100,4,10) is used in a variable by the <A HREF = "dump_modify.html">dump_modify
every</A> command, it will generate the sequence of
output timesteps:
</P>
<PRE>100,200,300,400,1000,2000,3000,4000,10000,20000,etc
</PRE>
<P>The vlinear(x,y) function takes 2 arguments: x = coord0 and y =
velocity, and uses the elapsed time to change the coordinate value by
a linear displacement due to the applied velocity over the course of a
run, according to this formula:
</P>
<PRE>value = coord0 + velocity*(timestep-startstep)*dt
</PRE>
<P>where dt = the timestep size.
</P>
<P>The run begins on startstep. Startstep can span multiple runs, using
the <I>start</I> keyword of the <A HREF = "run.html">run</A> command. See the
<A HREF = "run.html">run</A> command for details of how to do this.
</P>
<P>The swiggle(x,y,z) and cwiggle(x,y,z) functions each take 3 arguments:
x = coord0, y = amplitude, z = period. They use the elapsed time to
oscillate the coordinate value by a sin() or cos() function over the
course of a run, according to one of these formulas, where
omega = 2 PI / period:
</P>
<PRE>value = coord0 + Amplitude * sin(omega*(timestep-startstep)*dt)
value = coord0 + Amplitude * (1 - cos(omega*(timestep-startstep)*dt))
</PRE>
<P>where dt = the timestep size.
</P>
<P>The run begins on startstep. Startstep can span multiple runs, using
the <I>start</I> keyword of the <A HREF = "run.html">run</A> command. See the
<A HREF = "run.html">run</A> command for details of how to do this.
</P> </P>
<HR> <HR>
<H4>Group and Region Functions
</H4>
<P>Group functions are specified as keywords followed by one or two <P>Group functions are specified as keywords followed by one or two
parenthesized arguments. The first argument is the group-ID. The parenthesized arguments. The first argument is the group-ID. The
<I>dim</I> argument, if it exists, is <I>x</I> or <I>y</I> or <I>z</I>. The <I>dir</I> <I>dim</I> argument, if it exists, is <I>x</I> or <I>y</I> or <I>z</I>. The <I>dir</I>
@ -410,42 +483,11 @@ inclusion is that it be in the region.
</P> </P>
<HR> <HR>
<H4>Special Functions
</H4>
<P>Special functions take specific kinds of arguments, meaning their <P>Special functions take specific kinds of arguments, meaning their
arguments cannot be formulas themselves. For example ramp(10.0,100.0) arguments cannot be formulas themselves.
is valid, but ramp(2*5,sqrt(10000)) is not.
</P> </P>
<P>Ramp(x,y) takes two integer or floating point values and uses the
current timestep to generate a scalar value:
</P>
<PRE>value = x + (y-x) * (timestep-startstep) / (stopstep-startstep)
</PRE>
<P>which is a value that ramps linearly between x and y over the course of
a run. The run begins on startstep and ends on stopstep. Startstep
and stopstep can span multiple runs, using the <I>start</I> and <I>stop</I>
keywords of the <A HREF = "run.html">run</A> command. See the <A HREF = "run.html">run</A>
command for details of how to do this.
</P>
<P>Stagger(x,y) takes two integer values and uses the current timestep to
generate a new timestep. X,y > 0 and x > y is required. The
generated timesteps increase in a staggered fashion, as the sequence
x,x+y,2x,2x+y,3x,3x+y,etc. For any current timestep, the next
timestep in the sequence is returned. Thus if stagger(1000,100) is
used in a variable by the <A HREF = "dump_modify.html">dump_modify every</A>
command, it will generate the sequence of output timesteps:
</P>
<PRE>100,1000,1100,2000,2100,3000,etc
</PRE>
<P>Logfreq(x,y,z) takes 3 integer values and uses the current timestep to
generate a new timestep. X,y,z > 0 and y < z is required. The
generated timesteps increase in a logarithmic fashion, as the sequence
x,2x,3x,...y*x,z*x,2*z*x,3*z*x,...y*z*x,z*z*x,2*z*x*x,etc. For any
current timestep, the next timestep in the sequence is returned. Thus
if logfreq(100,4,10) is used in a variable by the <A HREF = "dump_modify.html">dump_modify
every</A> command, it will generate the sequence of
output timesteps:
</P>
<PRE>100,200,300,400,1000,2000,3000,4000,10000,20000,etc
</PRE>
<P>The sum(x), min(x), max(x), ave(x), and trap(x) functions each take 1 <P>The sum(x), min(x), max(x), ave(x), and trap(x) functions each take 1
argument which is of the form "c_ID" or "c_ID[N]" or "f_ID" or argument which is of the form "c_ID" or "c_ID[N]" or "f_ID" or
"f_ID[N]". The first two are computes and the second two are fixes; "f_ID[N]". The first two are computes and the second two are fixes;
@ -479,6 +521,8 @@ ave/correlate</A> command.
</P> </P>
<HR> <HR>
<H4>Atom Values and Vectors
</H4>
<P>Atom values take a single integer argument I from 1 to N, where I is <P>Atom values take a single integer argument I from 1 to N, where I is
the an atom-ID, e.g. x[243], which means use the x coordinate of the the an atom-ID, e.g. x[243], which means use the x coordinate of the
atom with ID = 243. atom with ID = 243.
@ -492,6 +536,8 @@ a quantity from that compute.
</P> </P>
<HR> <HR>
<H4>Compute References
</H4>
<P>Compute references access quantities calculated by a <P>Compute references access quantities calculated by a
<A HREF = "compute.html">compute</A>. The ID in the reference should be replaced by <A HREF = "compute.html">compute</A>. The ID in the reference should be replaced by
the ID of a compute defined elsewhere in the input script. As the ID of a compute defined elsewhere in the input script. As
@ -523,6 +569,8 @@ about "Variable Accuracy".
</P> </P>
<HR> <HR>
<H4>Fix References
</H4>
<P>Fix references access quantities calculated by a <A HREF = "compute.html">fix</A>. <P>Fix references access quantities calculated by a <A HREF = "compute.html">fix</A>.
The ID in the reference should be replaced by the ID of a fix defined The ID in the reference should be replaced by the ID of a fix defined
elsewhere in the input script. As discussed in the doc page for the elsewhere in the input script. As discussed in the doc page for the
@ -559,6 +607,8 @@ the doc pages for individual fix commands for details.
</P> </P>
<HR> <HR>
<H4>Variable References
</H4>
<P>Variable references access quantities calulated by other variables, <P>Variable references access quantities calulated by other variables,
which will cause those variables to be evaluated. The name in the which will cause those variables to be evaluated. The name in the
reference should be replaced by the name of a variable defined reference should be replaced by the name of a variable defined

View File

@ -36,12 +36,14 @@ style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {st
{string} arg = one string {string} arg = one string
{equal} or {atom} args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references {equal} or {atom} args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references
numbers = 0.0, 100, -5.4, 2.8e-4, etc numbers = 0.0, 100, -5.4, 2.8e-4, etc
constants = PI
thermo keywords = vol, ke, press, etc from "thermo_style"_thermo_style.html thermo keywords = vol, ke, press, etc from "thermo_style"_thermo_style.html
math operators = (), -x, x+y, x-y, x*y, x/y, x^y, math operators = (), -x, x+y, x-y, x*y, x/y, x^y,
x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y
math functions = sqrt(x), exp(x), ln(x), log(x), math functions = sqrt(x), exp(x), ln(x), log(x),
sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x),
random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x) random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x)
ramp(x,y), stagger(x,y), logfreq(x,y,z), vlinear(x,y), swiggle(x,y,z), cwiggle(x,y,z)
group functions = count(group), mass(group), charge(group), group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim), xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group), ke(group), bound(group,xmin), gyration(group), ke(group),
@ -50,7 +52,7 @@ style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {st
xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region), xcm(group,dim,region), vcm(group,dim,region), fcm(group,dim,region),
bound(group,xmin,region), gyration(group,region), ke(group,reigon), bound(group,xmin,region), gyration(group,region), ke(group,reigon),
angmom(group,dim,region), inertia(group,dimdim,region),omega(group,dim,region) angmom(group,dim,region), inertia(group,dimdim,region),omega(group,dim,region)
special functions = ramp(x,y), stagger(x,y), logfreq(x,y,z), sum(x), min(x), max(x), ave(x), trap(x) special functions = sum(x), min(x), max(x), ave(x), trap(x)
atom value = mass\[i\], type\[i\], x\[i\], y\[i\], z\[i\], vx\[i\], vy\[i\], vz\[i\], fx\[i\], fy\[i\], fz\[i\] atom value = mass\[i\], type\[i\], x\[i\], y\[i\], z\[i\], vx\[i\], vy\[i\], vz\[i\], fx\[i\], fy\[i\], fz\[i\]
atom vector = mass, type, x, y, z, vx, vy, vz, fx, fy, fz atom vector = mass, type, x, y, z, vx, vy, vz, fx, fy, fz
compute references = c_ID, c_ID\[i\], c_ID\[i\]\[j\] compute references = c_ID, c_ID\[i\], c_ID\[i\]\[j\]
@ -261,9 +263,10 @@ values, atom vectors, compute references, fix references, and
references to other variables. references to other variables.
Number: 0.2, 100, 1.0e20, -15.4, etc Number: 0.2, 100, 1.0e20, -15.4, etc
Constant: PI
Thermo keywords: vol, pe, ebond, etc Thermo keywords: vol, pe, ebond, etc
Math operators: (), -x, x+y, x-y, x*y, x/y, x^y, x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y Math operators: (), -x, x+y, x-y, x*y, x/y, x^y, x==y, x!=y, x<y, x<=y, x>y, x>=y, x&&y, x||y
Math functions: sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x) Math functions: sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), random(x,y,z), normal(x,y,z), ceil(x), floor(x), round(x), ramp(x,y), stagger(x,y), logfreq(x,y,z), vlinear(x,y), swiggle(x,y,z), cwiggle(x,y,z)
Group functions: count(ID), mass(ID), charge(ID), xcm(ID,dim), \ Group functions: count(ID), mass(ID), charge(ID), xcm(ID,dim), \
vcm(ID,dim), fcm(ID,dim), bound(ID,dir), \ vcm(ID,dim), fcm(ID,dim), bound(ID,dir), \
gyration(ID), ke(ID), angmom(ID,dim), \ gyration(ID), ke(ID), angmom(ID,dim), \
@ -272,8 +275,7 @@ Region functions: count(ID,IDR), mass(ID,IDR), charge(ID,IDR), \
xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), \ xcm(ID,dim,IDR), vcm(ID,dim,IDR), fcm(ID,dim,IDR), \
bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR), \ bound(ID,dir,IDR), gyration(ID,IDR), ke(ID,IDR), \
angmom(ID,dim,IDR), inertia(ID,dimdim,IDR), omega(ID,dim,IDR) angmom(ID,dim,IDR), inertia(ID,dimdim,IDR), omega(ID,dim,IDR)
Special functions: ramp(x,y), stagger(x,y), logfreq(x,y,z), \ Special functions: sum(x), min(x), max(x), ave(x), trap(x)
sum(x), min(x), max(x), ave(x), trap(x)
Atom values: mass\[i\], type\[i\], x\[i\], y\[i\], z\[i\], \ Atom values: mass\[i\], type\[i\], x\[i\], y\[i\], z\[i\], \
vx\[i\], vy\[i\], vz\[i\], fx\[i\], fy\[i\], fz\[i\] vx\[i\], vy\[i\], vz\[i\], fx\[i\], fy\[i\], fz\[i\]
Atom vectors: mass, type, x, y, z, vx, vy, vz, fx, fy, fz Atom vectors: mass, type, x, y, z, vx, vy, vz, fx, fy, fz
@ -312,6 +314,8 @@ discussion below about "Variable Accuracy".
:line :line
Math Operators :h4
Math operators are written in the usual way, where the "x" and "y" in Math operators are written in the usual way, where the "x" and "y" in
the examples can themselves be arbitrarily complex formulas, as in the the examples can themselves be arbitrarily complex formulas, as in the
examples above. In this syntax, "x" and "y" can be scalar values or examples above. In this syntax, "x" and "y" can be scalar values or
@ -344,8 +348,12 @@ whose properties satifsy one or more criteria could be calculated by
taking the returned per-atom vector of ones and zeroes and passing it taking the returned per-atom vector of ones and zeroes and passing it
to the "compute reduce"_compute_reduce.html command. to the "compute reduce"_compute_reduce.html command.
:line
Math Functions :h4
Math functions are specified as keywords followed by one or more Math functions are specified as keywords followed by one or more
parenthesized arguments "x", "y", etc, each of which can themselves be parenthesized arguments "x", "y", "z", each of which can themselves be
arbitrarily complex formulas. In this syntax, the arguments can arbitrarily complex formulas. In this syntax, the arguments can
represent scalar values or per-atom vectors. In the latter case, the represent scalar values or per-atom vectors. In the latter case, the
math operation is performed on each element of the vector. For math operation is performed on each element of the vector. For
@ -356,31 +364,95 @@ product of one atom's y and z coordinates.
Most of the math functions perform obvious operations. The ln() is Most of the math functions perform obvious operations. The ln() is
the natural log; log() is the base 10 log. the natural log; log() is the base 10 log.
The random() function generates a uniform random number between lo and The random(x,y,z) function takes 3 arguments: x = lo, y = hi, and z =
hi. The normal() function generates a Gaussian variate centered on mu seed. It generates a uniform random number between lo and hi. The
with variance sigma^2. In both cases the seed is used the first time normal(x,y,z) function also takes 3 arguments: x = mu, y = sigma, and
the internal random number generator is invoked, to initialize it. z = seed. It generates a Gaussian variate centered on mu with
For equal-style variables, every processor uses the same seed so that variance sigma^2. In both cases the seed is used the first time the
they each generate the same sequence of random numbers. For internal random number generator is invoked, to initialize it. For
atom-style variables, a unique seed is created for each processor, equal-style variables, every processor uses the same seed so that they
based on the specified seed. This effectively generates a different each generate the same sequence of random numbers. For atom-style
random number for each atom being looped over in the atom-style variables, a unique seed is created for each processor, based on the
variable. specified seed. This effectively generates a different random number
for each atom being looped over in the atom-style variable.
IMPORTANT NOTE: Internally, there is just one random number generator
for all equal-style variables and one for all atom-style variables.
If you define multiple variables (of each style) which use the
random() or normal() math functions, then the internal random number
generators will only be initialized once, which means only one of the
specified seeds will determine the sequence of generated random
numbers.
The ceil(), floor(), and round() functions are those in the C math The ceil(), floor(), and round() functions are those in the C math
library. Ceil() is the smallest integer not less than its argument. library. Ceil() is the smallest integer not less than its argument.
Floor() if the largest integer not greater than its argument. Round() Floor() if the largest integer not greater than its argument. Round()
is the nearest integer to its argument. is the nearest integer to its argument.
IMPORTANT NOTE: Internally, there is just one random number generator The ramp(x,y) function uses the current timestep to generate a value
for equal-style variables and one for atom-style variables. If you linearly intepolated between the specified x,y values over the course
define multiple variables (of each style) which use the random() or of a run, according to this formula:
normal() math functions, then the internal random number generators
will only be initialized once, which means only one of the specified value = x + (y-x) * (timestep-startstep) / (stopstep-startstep) :pre
seeds will determine the sequence of generated random numbers.
The run begins on startstep and ends on stopstep. Startstep and
stopstep can span multiple runs, using the {start} and {stop} keywords
of the "run"_run.html command. See the "run"_run.html command for
details of how to do this.
The stagger(x,y) function uses the current timestep to generate a new
timestep. X,y > 0 and x > y is required. The generated timesteps
increase in a staggered fashion, as the sequence
x,x+y,2x,2x+y,3x,3x+y,etc. For any current timestep, the next
timestep in the sequence is returned. Thus if stagger(1000,100) is
used in a variable by the "dump_modify every"_dump_modify.html
command, it will generate the sequence of output timesteps:
100,1000,1100,2000,2100,3000,etc :pre
The logfreq(x,y,z) function uses the current timestep to generate a
new timestep. X,y,z > 0 and y < z is required. The generated
timesteps increase in a logarithmic fashion, as the sequence
x,2x,3x,...y*x,z*x,2*z*x,3*z*x,...y*z*x,z*z*x,2*z*x*x,etc. For any
current timestep, the next timestep in the sequence is returned. Thus
if logfreq(100,4,10) is used in a variable by the "dump_modify
every"_dump_modify.html command, it will generate the sequence of
output timesteps:
100,200,300,400,1000,2000,3000,4000,10000,20000,etc :pre
The vlinear(x,y) function takes 2 arguments: x = coord0 and y =
velocity, and uses the elapsed time to change the coordinate value by
a linear displacement due to the applied velocity over the course of a
run, according to this formula:
value = coord0 + velocity*(timestep-startstep)*dt :pre
where dt = the timestep size.
The run begins on startstep. Startstep can span multiple runs, using
the {start} keyword of the "run"_run.html command. See the
"run"_run.html command for details of how to do this.
The swiggle(x,y,z) and cwiggle(x,y,z) functions each take 3 arguments:
x = coord0, y = amplitude, z = period. They use the elapsed time to
oscillate the coordinate value by a sin() or cos() function over the
course of a run, according to one of these formulas, where
omega = 2 PI / period:
value = coord0 + Amplitude * sin(omega*(timestep-startstep)*dt)
value = coord0 + Amplitude * (1 - cos(omega*(timestep-startstep)*dt)) :pre
where dt = the timestep size.
The run begins on startstep. Startstep can span multiple runs, using
the {start} keyword of the "run"_run.html command. See the
"run"_run.html command for details of how to do this.
:line :line
Group and Region Functions :h4
Group functions are specified as keywords followed by one or two Group functions are specified as keywords followed by one or two
parenthesized arguments. The first argument is the group-ID. The parenthesized arguments. The first argument is the group-ID. The
{dim} argument, if it exists, is {x} or {y} or {z}. The {dir} {dim} argument, if it exists, is {x} or {y} or {z}. The {dir}
@ -410,41 +482,10 @@ inclusion is that it be in the region.
:line :line
Special Functions :h4
Special functions take specific kinds of arguments, meaning their Special functions take specific kinds of arguments, meaning their
arguments cannot be formulas themselves. For example ramp(10.0,100.0) arguments cannot be formulas themselves.
is valid, but ramp(2*5,sqrt(10000)) is not.
Ramp(x,y) takes two integer or floating point values and uses the
current timestep to generate a scalar value:
value = x + (y-x) * (timestep-startstep) / (stopstep-startstep) :pre
which is a value that ramps linearly between x and y over the course of
a run. The run begins on startstep and ends on stopstep. Startstep
and stopstep can span multiple runs, using the {start} and {stop}
keywords of the "run"_run.html command. See the "run"_run.html
command for details of how to do this.
Stagger(x,y) takes two integer values and uses the current timestep to
generate a new timestep. X,y > 0 and x > y is required. The
generated timesteps increase in a staggered fashion, as the sequence
x,x+y,2x,2x+y,3x,3x+y,etc. For any current timestep, the next
timestep in the sequence is returned. Thus if stagger(1000,100) is
used in a variable by the "dump_modify every"_dump_modify.html
command, it will generate the sequence of output timesteps:
100,1000,1100,2000,2100,3000,etc :pre
Logfreq(x,y,z) takes 3 integer values and uses the current timestep to
generate a new timestep. X,y,z > 0 and y < z is required. The
generated timesteps increase in a logarithmic fashion, as the sequence
x,2x,3x,...y*x,z*x,2*z*x,3*z*x,...y*z*x,z*z*x,2*z*x*x,etc. For any
current timestep, the next timestep in the sequence is returned. Thus
if logfreq(100,4,10) is used in a variable by the "dump_modify
every"_dump_modify.html command, it will generate the sequence of
output timesteps:
100,200,300,400,1000,2000,3000,4000,10000,20000,etc :pre
The sum(x), min(x), max(x), ave(x), and trap(x) functions each take 1 The sum(x), min(x), max(x), ave(x), and trap(x) functions each take 1
argument which is of the form "c_ID" or "c_ID\[N\]" or "f_ID" or argument which is of the form "c_ID" or "c_ID\[N\]" or "f_ID" or
@ -479,6 +520,8 @@ ave/correlate"_fix_ave_correlate.html command.
:line :line
Atom Values and Vectors :h4
Atom values take a single integer argument I from 1 to N, where I is Atom values take a single integer argument I from 1 to N, where I is
the an atom-ID, e.g. x\[243\], which means use the x coordinate of the the an atom-ID, e.g. x\[243\], which means use the x coordinate of the
atom with ID = 243. atom with ID = 243.
@ -492,6 +535,8 @@ a quantity from that compute.
:line :line
Compute References :h4
Compute references access quantities calculated by a Compute references access quantities calculated by a
"compute"_compute.html. The ID in the reference should be replaced by "compute"_compute.html. The ID in the reference should be replaced by
the ID of a compute defined elsewhere in the input script. As the ID of a compute defined elsewhere in the input script. As
@ -521,6 +566,8 @@ about "Variable Accuracy".
:line :line
Fix References :h4
Fix references access quantities calculated by a "fix"_compute.html. Fix references access quantities calculated by a "fix"_compute.html.
The ID in the reference should be replaced by the ID of a fix defined The ID in the reference should be replaced by the ID of a fix defined
elsewhere in the input script. As discussed in the doc page for the elsewhere in the input script. As discussed in the doc page for the
@ -555,6 +602,8 @@ the doc pages for individual fix commands for details.
:line :line
Variable References :h4
Variable references access quantities calulated by other variables, Variable references access quantities calulated by other variables,
which will cause those variables to be evaluated. The name in the which will cause those variables to be evaluated. The name in the
reference should be replaced by the name of a variable defined reference should be replaced by the name of a variable defined