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

This commit is contained in:
sjplimp
2013-02-18 17:23:22 +00:00
parent f24bd36fe5
commit c3091aeaac
6 changed files with 97 additions and 39 deletions

View File

@ -96,13 +96,34 @@ single leading "#" will comment out the entire command.
(3) The line is searched repeatedly for $ characters, which indicate
variables that are replaced with a text string. See an exception in
(6). If the $ is followed by curly brackets, then the variable name
is the text inside the curly brackets. If no curly brackets follow
the $, then the variable name is the single character immediately
following the $. Thus $\{myTemp\} and $x refer to variable names
"myTemp" and "x". See the "variable"_variable.html command for
details of how strings are assigned to variables and how they are
substituted for in input script commands.
(6).
If the $ is followed by curly brackets, then the variable name is the
text inside the curly brackets. If no curly brackets follow the $,
then the variable name is the single character immediately following
the $. Thus $\{myTemp\} and $x refer to variable names "myTemp" and
"x".
If the $ is followed by parenthesis, then the text inside the
parenthesis is treated as an "immediate" variable and evaluated as an
"equal-style variable"_variable.html. This is a way to use numeric
formulas in an input script without having to assign them to variable
names. For example, these 3 input script lines:
variable X equal (xlo+xhi)/2+sqrt(v_area)
region 1 block $X 2 INF INF EDGE EDGE
variable X delete :pre
can be replaced by
region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE :pre
The latter produces an identical result, without having to define and
discard a temporary variable X.
See the "variable"_variable.html command for more details of how
strings are assigned to variables and evaluated, and how they can be
used in input script commands.
(4) The line is broken into "words" separated by whitespace (tabs,
spaces). Note that words can thus contain letters, digits,
@ -115,13 +136,14 @@ line are arguments.
it can be enclosed in either double or single quotes. E.g.
print "Volume = $v"
print 'Volume = $v' :pre
print 'Volume = $v'
if "${steps} > 1000" then quit :pre
The quotes are removed when the single argument is stored internally.
See the "dump modify format"_dump_modify.html or "if"_if.html commands
for examples. A "#" or "$" character that is between quotes will not
be treated as a comment indicator in (2) or substituted for as a
variable in (3).
See the "dump modify format"_dump_modify.html or "print"_print.html or
"if"_if.html commands for examples. A "#" or "$" character that is
between quotes will not be treated as a comment indicator in (2) or
substituted for as a variable in (3).
IMPORTANT NOTE: If the argument is itself a command that requires a
quoted argument (e.g. using a "print"_print.html command as part of an