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

This commit is contained in:
sjplimp 2010-08-04 21:36:27 +00:00
parent 632eddc43a
commit c5f9d387d8
8 changed files with 110 additions and 70 deletions

View File

@ -115,11 +115,9 @@ details.
</P>
<P>For example, these commands would change the prefactor coefficient of
the <A HREF = "pair_soft.html">pair_style soft</A> potential from 10.0 to 30.0 in a
linear fashion over the course of a 1000-step simulation:
linear fashion over the course of a simulation:
</P>
<PRE>variable min equal 10.0
variable max equal 30.0
variable prefactor equal min+(max-min)*elapsed/1000
<PRE>variable prefactor equal ramp(10,30)
fix 1 all adapt 1 pair soft a * * prefactor
</PRE>
<P>The <I>atom</I> keyword enables various atom properties to be changed. The

View File

@ -103,11 +103,9 @@ details.
For example, these commands would change the prefactor coefficient of
the "pair_style soft"_pair_soft.html potential from 10.0 to 30.0 in a
linear fashion over the course of a 1000-step simulation:
linear fashion over the course of a simulation:
variable min equal 10.0
variable max equal 30.0
variable prefactor equal min+(max-min)*elapsed/1000
variable prefactor equal ramp(10,30)
fix 1 all adapt 1 pair soft a * * prefactor :pre
The {atom} keyword enables various atom properties to be changed. The

View File

@ -33,7 +33,7 @@ pair_coeff * *
</PRE>
<PRE>pair_style lubricate 1.0 1 1 1 0 2.3 2.4 1.3 5878598
pair_coeff * *
variable vmu equal 1.0+elapsed/10000
variable vmu equal ramp(1,2)
fix 1 all adapt 1 pair lubricate mu * * vmu
</PRE>
<P><B>Description:</B>

View File

@ -30,7 +30,7 @@ pair_coeff * * :pre
pair_style lubricate 1.0 1 1 1 0 2.3 2.4 1.3 5878598
pair_coeff * *
variable vmu equal 1.0+elapsed/10000
variable vmu equal ramp(1,2)
fix 1 all adapt 1 pair lubricate mu * * vmu :pre
[Description:]

View File

@ -25,7 +25,7 @@ pair_coeff 1 1 10.0 3.0
</PRE>
<PRE>pair_style soft 2.5
pair_coeff * * 0.0
variable prefactor equal 30.0*elapsed/10000
variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * prefactor
</PRE>
<P><B>Description:</B>
@ -59,9 +59,9 @@ or more pair types over the course of a simulation, in which case
pair_coeff settings for A must still be specified, but will be
overridden. For example these commands will vary the prefactor A for
all pairwise interactions from 0.0 at the beginning to 30.0 at the end
of a 10,000 step run:
of a run:
</P>
<PRE>variable prefactor equal 30.0*elapsed/10000
<PRE>variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * prefactor
</PRE>
<P>Note that a formula defined by an <A HREF = "variable.html">equal-style variable</A>

View File

@ -22,7 +22,7 @@ pair_coeff 1 1 10.0 3.0 :pre
pair_style soft 2.5
pair_coeff * * 0.0
variable prefactor equal 30.0*elapsed/10000
variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * prefactor :pre
[Description:]
@ -56,9 +56,9 @@ or more pair types over the course of a simulation, in which case
pair_coeff settings for A must still be specified, but will be
overridden. For example these commands will vary the prefactor A for
all pairwise interactions from 0.0 at the beginning to 30.0 at the end
of a 10,000 step run:
of a run:
variable prefactor equal 30.0*elapsed/10000
variable prefactor equal ramp(0,30)
fix 1 all adapt 1 pair soft a * * prefactor :pre
Note that a formula defined by an "equal-style variable"_variable.html

View File

@ -34,7 +34,7 @@
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),
ceil(x), floor(x), round(x)
ceil(x), floor(x), round(x), ramp(x,y)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group), ke(group),
@ -257,7 +257,7 @@ references to other variables.
<TR><TD >Number</TD><TD > 0.2, 100, 1.0e20, -15.4, 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 functions</TD><TD > sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), 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), ceil(x), floor(x), round(x), ramp(x,y)</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 >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>
@ -267,16 +267,18 @@ references to other variables.
<TR><TD >Other variables</TD><TD > v_name, v_name[i]
</TD></TR></TABLE></DIV>
<P>Most of the formula elements generate scalar values. The exceptions
are those that represent a per-atom vector of values. These are the
atom vectors, compute references that represent a per-atom vector, fix
references that represent a per-atom vector, and variables that are
atom-style variables.
<P>Most of the formula elements produce a scalar value. A few produce a
per-atom vector of values. These are the atom vectors, compute
references that represent a per-atom vector, fix references that
represent a per-atom vector, and variables that are atom-style
variables. Math functions that operate on scalar values produce a
scalar value; math function that operate on per-atom vectors produce a
per-atom vector.
</P>
<P>A formula for equal-style variables cannot use any formula element
that generates a per-atom vector. A formula for an atom-style
variable can use formula elements that produce either scalar values or
per-atom vectors.
that produces a per-atom vector. A formula for an atom-style variable
can use formula elements that produce either a scalar value or a
per-atom vector.
</P>
<P>The thermo keywords allowed in a formula are those defined by the
<A HREF = "thermo_style.html">thermo_style custom</A> command. Thermo keywords that
@ -293,10 +295,15 @@ values accessed by the thermo keyword must be current. See the
discussion below about "Variable Accuracy".
</P>
<P>Math operators are written in the usual way, where the "x" and "y" in
the examples above can be another section of the formula. Operators
are evaluated left to right and have the usual C-style precedence:
unary minus before exponentiation ("^"); exponentiation before
multiplication and division; multiplication and division before
the examples can themselves be arbitrarily complex formulas, as in the
examples above. In this syntax, "x" and "y" can be scalar values or
per-atom vectors. For example, "ke/natoms" is the division of two
scalars, where "y+z" is the sum of two per-atom vectors of y- and
z-coordinates.
</P>
<P>Operators are evaluated left to right and have the usual C-style
precedence: unary minus before exponentiation ("^"); exponentiation
before multiplication and division; multiplication and division before
addition and subtraction; addition and subtraction before the 4
relational operators "<", "<=", ">", and ">="; those 4 relational
operators before the remaining two relational operators "==" and "!=";
@ -319,19 +326,34 @@ whose properties satisy one or more criteria could be calculated by
taking the returned per-atom vector of ones and zeroes and passing it
to the <A HREF = "compute_reduce.html">compute reduce</A> command.
</P>
<P>Math functions can be specified as keywords followed by a
parenthesized argument, e.g. sqrt(v_ke). Note that ln() is the
natural log; log() is the base 10 log. The ceil(), floor(), and
<P>Math functions are specified as keywords followed by one or more
parenthesized arguments "x", "y", etc, each of which can themselves be
arbitrarily complex formulas. In this syntax, the arguments can
represent scalar values or per-atom vectors. For example,
"sqrt(natoms)" is the sqrt() of a scalar, where "sqrt(y*z)" is a
per-atom vector with each element being the sqrt() of the product of
two atom coordinates.
</P>
<P>Most of the math functions perform obvious operations. The ln() is
the natural log; log() is the base 10 log. The ceil(), floor(), and
round() operations are those in the C math library. Ceil() is the
smallest integer not less than its argument. Floor() if the largest
integer not greater than its argument. Round() is the nearest integer
to its argument.
</P>
<P>Group functions take one or two arguments in a specific format. 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> argument, if it exists, is <I>xmin</I>,
<I>xmax</I>, <I>ymin</I>, <I>ymax</I>, <I>zmin</I>, or <I>zmax</I>. The <I>dimdim</I> argument, if it
exists, is <I>xx</I> or <I>yy</I> or <I>zz</I> or <I>xy</I> or <I>yz</I> or <I>xz</I>.
<P>Ramp(x,y) 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 linear over the timesteps of a run between
x and y. The run began on startstep and will end on stopstep.
</P>
<P>Group functions are specified as keywords followed by one or two
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>
argument, if it exists, is <I>xmin</I>, <I>xmax</I>, <I>ymin</I>, <I>ymax</I>, <I>zmin</I>, or
<I>zmax</I>. The <I>dimdim</I> argument, if it exists, is <I>xx</I> or <I>yy</I> or <I>zz</I>
or <I>xy</I> or <I>yz</I> or <I>xz</I>.
</P>
<P>The group function count() is the number of atoms in the group. The
group functions mass() and charge() are the total mass and charge of
@ -347,11 +369,11 @@ one of 6 components of the inertia tensor of the group of atoms around
its center of mass. Omega() returns components of the angular
velocity of the group of atoms around its center of mass.
</P>
<P>Region functions are exactly the same as group functions except they
take an extra argument which is the region ID. The function is
computed for all atoms that are in both the group and the region. If
the group is "all", then the only criteria for atom inclusion is that
it be in the region.
<P>Region functions are specified exactly the same way as group functions
except they take an extra argument which is the region ID. The
function is computed for all atoms that are in both the group and the
region. If the group is "all", then the only criteria for atom
inclusion is that it be in the region.
</P>
<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

View File

@ -29,7 +29,7 @@ style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {st
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),
ceil(x), floor(x), round(x)
ceil(x), floor(x), round(x), ramp(x,y)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group), ke(group),
@ -250,7 +250,7 @@ references to other variables.
Number: 0.2, 100, 1.0e20, -15.4, 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 functions: sqrt(x), exp(x), ln(x), log(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), 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), ceil(x), floor(x), round(x), ramp(x,y)
Group functions: 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), \
@ -266,16 +266,18 @@ Compute references: c_ID, c_ID\[i\], c_ID\[i\]\[j\]
Fix references: f_ID, f_ID\[i\], f_ID\[i\]\[j\]
Other variables: v_name, v_name\[i\] :tb(s=:)
Most of the formula elements generate scalar values. The exceptions
are those that represent a per-atom vector of values. These are the
atom vectors, compute references that represent a per-atom vector, fix
references that represent a per-atom vector, and variables that are
atom-style variables.
Most of the formula elements produce a scalar value. A few produce a
per-atom vector of values. These are the atom vectors, compute
references that represent a per-atom vector, fix references that
represent a per-atom vector, and variables that are atom-style
variables. Math functions that operate on scalar values produce a
scalar value; math function that operate on per-atom vectors produce a
per-atom vector.
A formula for equal-style variables cannot use any formula element
that generates a per-atom vector. A formula for an atom-style
variable can use formula elements that produce either scalar values or
per-atom vectors.
that produces a per-atom vector. A formula for an atom-style variable
can use formula elements that produce either a scalar value or a
per-atom vector.
The thermo keywords allowed in a formula are those defined by the
"thermo_style custom"_thermo_style.html command. Thermo keywords that
@ -292,10 +294,15 @@ values accessed by the thermo keyword must be current. See the
discussion below about "Variable Accuracy".
Math operators are written in the usual way, where the "x" and "y" in
the examples above can be another section of the formula. Operators
are evaluated left to right and have the usual C-style precedence:
unary minus before exponentiation ("^"); exponentiation before
multiplication and division; multiplication and division before
the examples can themselves be arbitrarily complex formulas, as in the
examples above. In this syntax, "x" and "y" can be scalar values or
per-atom vectors. For example, "ke/natoms" is the division of two
scalars, where "y+z" is the sum of two per-atom vectors of y- and
z-coordinates.
Operators are evaluated left to right and have the usual C-style
precedence: unary minus before exponentiation ("^"); exponentiation
before multiplication and division; multiplication and division before
addition and subtraction; addition and subtraction before the 4
relational operators "<", "<=", ">", and ">="; those 4 relational
operators before the remaining two relational operators "==" and "!=";
@ -318,19 +325,34 @@ whose properties satisy one or more criteria could be calculated by
taking the returned per-atom vector of ones and zeroes and passing it
to the "compute reduce"_compute_reduce.html command.
Math functions can be specified as keywords followed by a
parenthesized argument, e.g. sqrt(v_ke). Note that ln() is the
natural log; log() is the base 10 log. The ceil(), floor(), and
Math functions are specified as keywords followed by one or more
parenthesized arguments "x", "y", etc, each of which can themselves be
arbitrarily complex formulas. In this syntax, the arguments can
represent scalar values or per-atom vectors. For example,
"sqrt(natoms)" is the sqrt() of a scalar, where "sqrt(y*z)" is a
per-atom vector with each element being the sqrt() of the product of
two atom coordinates.
Most of the math functions perform obvious operations. The ln() is
the natural log; log() is the base 10 log. The ceil(), floor(), and
round() operations are those in the C math library. Ceil() is the
smallest integer not less than its argument. Floor() if the largest
integer not greater than its argument. Round() is the nearest integer
to its argument.
Group functions take one or two arguments in a specific format. The
first argument is the group-ID. The {dim} argument, if it exists, is
{x} or {y} or {z}. The {dir} argument, if it exists, is {xmin},
{xmax}, {ymin}, {ymax}, {zmin}, or {zmax}. The {dimdim} argument, if it
exists, is {xx} or {yy} or {zz} or {xy} or {yz} or {xz}.
Ramp(x,y) uses the current timestep to generate a scalar value:
value = x + (y-x) * (timestep - startstep) / (stopstep - startstep) :pre
which is a value that ramps linear over the timesteps of a run between
x and y. The run began on startstep and will end on stopstep.
Group functions are specified as keywords followed by one or two
parenthesized arguments. The first argument is the group-ID. The
{dim} argument, if it exists, is {x} or {y} or {z}. The {dir}
argument, if it exists, is {xmin}, {xmax}, {ymin}, {ymax}, {zmin}, or
{zmax}. The {dimdim} argument, if it exists, is {xx} or {yy} or {zz}
or {xy} or {yz} or {xz}.
The group function count() is the number of atoms in the group. The
group functions mass() and charge() are the total mass and charge of
@ -346,11 +368,11 @@ one of 6 components of the inertia tensor of the group of atoms around
its center of mass. Omega() returns components of the angular
velocity of the group of atoms around its center of mass.
Region functions are exactly the same as group functions except they
take an extra argument which is the region ID. The function is
computed for all atoms that are in both the group and the region. If
the group is "all", then the only criteria for atom inclusion is that
it be in the region.
Region functions are specified exactly the same way as group functions
except they take an extra argument which is the region ID. The
function is computed for all atoms that are in both the group and the
region. If the group is "all", then the only criteria for atom
inclusion is that it be in the region.
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