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

This commit is contained in:
sjplimp 2010-10-06 18:12:34 +00:00
parent e10badba42
commit 98f408427d
2 changed files with 52 additions and 18 deletions

View File

@ -46,7 +46,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), atan2(y,x),
ceil(x), floor(x), round(x)
random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group), ke(group),
@ -270,7 +270,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), atan2(y,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), atan2(y,x), random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x)</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 >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>
@ -316,8 +316,8 @@ discussion below about "Variable Accuracy".
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 element-by-element sum of two per-atom
vectors of y- and z-coordinates.
scalars, where "vy+vz" is the element-by-element sum of two per-atom
vectors of y and z velocities.
</P>
<P>Operators are evaluated left to right and have the usual C-style
precedence: unary minus before exponentiation ("^"); exponentiation
@ -354,11 +354,28 @@ yields a per-atom vector with each element being the sqrt() of the
product of one atom's y and z 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.
the natural log; log() is the base 10 log.
</P>
<P>The random() function generates a uniform random number between lo and
hi. The normal() function generates a Gaussian variate centered on mu
with variance sigma. In both cases the seed is used the first time
the internal random number generator is invoked, to initialize it.
For equal-style variables, every processor uses the same seed. For
atom-style variables, a new unique seed is created for each processor,
based on the specified seed. This effectively generates a different
random number for each atom being looped over.
</P>
<P>The ceil(), floor(), and round() functions 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>IMPORTANT NOTE: Internally, there is just one random number generator
for equal-style variables and one for 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>
<HR>

View File

@ -41,7 +41,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), atan2(y,x),
ceil(x), floor(x), round(x)
random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x)
group functions = count(group), mass(group), charge(group),
xcm(group,dim), vcm(group,dim), fcm(group,dim),
bound(group,xmin), gyration(group), ke(group),
@ -263,7 +263,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), atan2(y,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), atan2(y,x), random(lo,hi,seed), normal(mu,sigma,seed), ceil(x), floor(x), round(x)
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), \
@ -316,8 +316,8 @@ 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
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 element-by-element sum of two per-atom
vectors of y- and z-coordinates.
scalars, where "vy+vz" is the element-by-element sum of two per-atom
vectors of y and z velocities.
Operators are evaluated left to right and have the usual C-style
precedence: unary minus before exponentiation ("^"); exponentiation
@ -354,11 +354,28 @@ yields a per-atom vector with each element being the sqrt() of the
product of one atom's y and z 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.
the natural log; log() is the base 10 log.
The random() function generates a uniform random number between lo and
hi. The normal() function generates a Gaussian variate centered on mu
with variance sigma. In both cases the seed is used the first time
the internal random number generator is invoked, to initialize it.
For equal-style variables, every processor uses the same seed. For
atom-style variables, a new unique seed is created for each processor,
based on the specified seed. This effectively generates a different
random number for each atom being looped over.
The ceil(), floor(), and round() functions 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.
IMPORTANT NOTE: Internally, there is just one random number generator
for equal-style variables and one for 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.
:line