forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10909 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
0fa3867f34
commit
9c0fc4ba8d
|
@ -15,7 +15,7 @@
|
|||
</P>
|
||||
<PRE>shell cmd args
|
||||
</PRE>
|
||||
<UL><LI>cmd = <I>cd</I> or <I>mkdir</I> or <I>mv</I> or <I>rm</I> or <I>rmdir</I> or arbitrary command
|
||||
<UL><LI>cmd = <I>cd</I> or <I>mkdir</I> or <I>mv</I> or <I>rm</I> or <I>rmdir</I> or <I>putenv</I> or arbitrary command
|
||||
|
||||
<PRE> <I>cd</I> arg = dir
|
||||
dir = directory to change to
|
||||
|
@ -28,6 +28,8 @@
|
|||
file1,file2 = one or more filenames to delete
|
||||
<I>rmdir</I> args = dir1 dir2 ...
|
||||
dir1,dir2 = one or more directories to delete
|
||||
<I>putenv</I> args = var1=value1 var2=value2
|
||||
var=value = one of more definitions of environment variables
|
||||
anything else is passed as a command to the shell for direct execution
|
||||
</PRE>
|
||||
|
||||
|
@ -40,6 +42,7 @@ shell mkdir tmp1 tmp2 tmp3
|
|||
shell rmdir tmp1
|
||||
shell mv log.lammps hold/log.1
|
||||
shell rm TMP/file1 TMP/file2
|
||||
shell putenv LAMMPS_POTENTIALS=../../potentials
|
||||
shell my_setup file1 10 file2
|
||||
shell my_post_process 100 dump.out
|
||||
</PRE>
|
||||
|
@ -77,6 +80,12 @@ files.
|
|||
more directories. A directory must be empty to be successfully
|
||||
removed.
|
||||
</P>
|
||||
<P>The <I>putenv</I> cmd defines or updates an environment variable directly.
|
||||
Since this command does not pass through the shell, no shell variable
|
||||
expansion or globbing is performed, only the usual substitution for
|
||||
LAMMPS variables defined with the <A HREF = "variable.html">variable</A> command is
|
||||
performed. The resulting string is then used literally.
|
||||
</P>
|
||||
<P>Any other cmd is passed as-is to the shell along with its arguments as
|
||||
one string, invoked by the C-library system() call. For example,
|
||||
these lines in your input script:
|
||||
|
|
|
@ -12,7 +12,7 @@ shell command :h3
|
|||
|
||||
shell cmd args :pre
|
||||
|
||||
cmd = {cd} or {mkdir} or {mv} or {rm} or {rmdir} or arbitrary command :ulb,l
|
||||
cmd = {cd} or {mkdir} or {mv} or {rm} or {rmdir} or {putenv} or arbitrary command :ulb,l
|
||||
{cd} arg = dir
|
||||
dir = directory to change to
|
||||
{mkdir} args = dir1 dir2 ...
|
||||
|
@ -24,6 +24,8 @@ cmd = {cd} or {mkdir} or {mv} or {rm} or {rmdir} or arbitrary command :ulb,l
|
|||
file1,file2 = one or more filenames to delete
|
||||
{rmdir} args = dir1 dir2 ...
|
||||
dir1,dir2 = one or more directories to delete
|
||||
{putenv} args = var1=value1 var2=value2
|
||||
var=value = one of more definitions of environment variables
|
||||
anything else is passed as a command to the shell for direct execution :pre
|
||||
:ule
|
||||
|
||||
|
@ -35,6 +37,7 @@ shell mkdir tmp1 tmp2 tmp3
|
|||
shell rmdir tmp1
|
||||
shell mv log.lammps hold/log.1
|
||||
shell rm TMP/file1 TMP/file2
|
||||
shell putenv LAMMPS_POTENTIALS=../../potentials
|
||||
shell my_setup file1 10 file2
|
||||
shell my_post_process 100 dump.out :pre
|
||||
|
||||
|
@ -72,6 +75,12 @@ The {rmdir} cmd executes the Unix "rmdir" command to remove one or
|
|||
more directories. A directory must be empty to be successfully
|
||||
removed.
|
||||
|
||||
The {putenv} cmd defines or updates an environment variable directly.
|
||||
Since this command does not pass through the shell, no shell variable
|
||||
expansion or globbing is performed, only the usual substitution for
|
||||
LAMMPS variables defined with the "variable"_variable.html command is
|
||||
performed. The resulting string is then used literally.
|
||||
|
||||
Any other cmd is passed as-is to the shell along with its arguments as
|
||||
one string, invoked by the C-library system() call. For example,
|
||||
these lines in your input script:
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</PRE>
|
||||
<UL><LI>name = name of variable to define
|
||||
|
||||
<LI>style = <I>delete</I> or <I>index</I> or <I>loop</I> or <I>world</I> or <I>universe</I> or <I>uloop</I> or <I>string</I> or <I>file</I> or <I>atomfile</I> or <I>equal</I> or <I>atom</I>
|
||||
<LI>style = <I>delete</I> or <I>index</I> or <I>loop</I> or <I>world</I> or <I>universe</I> or <I>uloop</I> or <I>string</I> or <I>getenv</I> or <I>file</I> or <I>atomfile</I> or <I>equal</I> or <I>atom</I>
|
||||
|
||||
<PRE> <I>delete</I> = no args
|
||||
<I>index</I> args = one or more strings
|
||||
|
@ -39,6 +39,7 @@
|
|||
N = integer size of loop
|
||||
pad = all values will be same length, e.g. 001, 002, ..., 100
|
||||
<I>string</I> arg = one string
|
||||
<I>getenv</I> arg = one string
|
||||
<I>file</I> arg = filename
|
||||
<I>atomfile</I> arg = filename
|
||||
<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
|
||||
|
@ -139,11 +140,11 @@ means that using the <A HREF = "Section_start.html#start_7">command-line switch<
|
|||
script.
|
||||
</P>
|
||||
<P>There are two exceptions to this rule. First, variables of style
|
||||
<I>string</I> and <I>equal</I> and <I>atom</I> ARE redefined each time the command is
|
||||
encountered. This allows these style of variables to be redefined
|
||||
multiple times in an input script. In a loop, this means the formula
|
||||
associated with an <I>equal</I> or <I>atom</I> style variable can change if it
|
||||
contains a substitution for another variable, e.g. $x.
|
||||
<I>string</I>, <I>getenv</I>, <I>equal</I> and <I>atom</I> ARE redefined each time the
|
||||
command is encountered. This allows these style of variables to be
|
||||
redefined multiple times in an input script. In a loop, this means
|
||||
the formula associated with an <I>equal</I> or <I>atom</I> style variable can
|
||||
change if it contains a substitution for another variable, e.g. $x.
|
||||
</P>
|
||||
<P>Second, as described below, if a variable is iterated on to the end of
|
||||
its list of strings via the <A HREF = "next.html">next</A> command, it is removed
|
||||
|
@ -246,6 +247,16 @@ single string is that a variable with <I>string</I> style can be redefined.
|
|||
E.g. by another command later in the input script, or if the script is
|
||||
read again in a loop.
|
||||
</P>
|
||||
<P>For the <I>getenv</I> style, a single string is assigned to the variable
|
||||
which should be the name of an environment variable. When the
|
||||
variable is evaluated, it returns the value of the environment
|
||||
variable, or an empty string if it not defined. This style of
|
||||
variable can be used to adapt the behavior of LAMMPS input scripts via
|
||||
environment variable settings, or to retrieve information that has
|
||||
been previously stored with the <A HREF = "shell.html">shell putenv</A> command.
|
||||
Note that because environment variable settings are stored by the
|
||||
operating systems, they persist beyond a <A HREF = "clear.html">clear</A> command.
|
||||
</P>
|
||||
<P>For the <I>file</I> style, a filename is provided which contains a list of
|
||||
strings to assign to the variable, one per line. The strings can be
|
||||
numeric values if desired. See the discussion of the next() function
|
||||
|
|
|
@ -13,7 +13,7 @@ variable command :h3
|
|||
variable name style args ... :pre
|
||||
|
||||
name = name of variable to define :ulb,l
|
||||
style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {string} or {file} or {atomfile} or {equal} or {atom} :l
|
||||
style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {string} or {getenv} or {file} or {atomfile} or {equal} or {atom} :l
|
||||
{delete} = no args
|
||||
{index} args = one or more strings
|
||||
{loop} args = N
|
||||
|
@ -34,6 +34,7 @@ style = {delete} or {index} or {loop} or {world} or {universe} or {uloop} or {st
|
|||
N = integer size of loop
|
||||
pad = all values will be same length, e.g. 001, 002, ..., 100
|
||||
{string} arg = one string
|
||||
{getenv} arg = one string
|
||||
{file} arg = filename
|
||||
{atomfile} arg = filename
|
||||
{equal} or {atom} args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references
|
||||
|
@ -133,11 +134,11 @@ means that using the "command-line switch"_Section_start.html#start_7
|
|||
script.
|
||||
|
||||
There are two exceptions to this rule. First, variables of style
|
||||
{string} and {equal} and {atom} ARE redefined each time the command is
|
||||
encountered. This allows these style of variables to be redefined
|
||||
multiple times in an input script. In a loop, this means the formula
|
||||
associated with an {equal} or {atom} style variable can change if it
|
||||
contains a substitution for another variable, e.g. $x.
|
||||
{string}, {getenv}, {equal} and {atom} ARE redefined each time the
|
||||
command is encountered. This allows these style of variables to be
|
||||
redefined multiple times in an input script. In a loop, this means
|
||||
the formula associated with an {equal} or {atom} style variable can
|
||||
change if it contains a substitution for another variable, e.g. $x.
|
||||
|
||||
Second, as described below, if a variable is iterated on to the end of
|
||||
its list of strings via the "next"_next.html command, it is removed
|
||||
|
@ -240,6 +241,16 @@ single string is that a variable with {string} style can be redefined.
|
|||
E.g. by another command later in the input script, or if the script is
|
||||
read again in a loop.
|
||||
|
||||
For the {getenv} style, a single string is assigned to the variable
|
||||
which should be the name of an environment variable. When the
|
||||
variable is evaluated, it returns the value of the environment
|
||||
variable, or an empty string if it not defined. This style of
|
||||
variable can be used to adapt the behavior of LAMMPS input scripts via
|
||||
environment variable settings, or to retrieve information that has
|
||||
been previously stored with the "shell putenv"_shell.html command.
|
||||
Note that because environment variable settings are stored by the
|
||||
operating systems, they persist beyond a "clear"_clear.html command.
|
||||
|
||||
For the {file} style, a filename is provided which contains a list of
|
||||
strings to assign to the variable, one per line. The strings can be
|
||||
numeric values if desired. See the discussion of the next() function
|
||||
|
|
Loading…
Reference in New Issue