2006-09-22 00:22:34 +08:00
|
|
|
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
|
|
|
|
|
|
|
:link(lws,http://lammps.sandia.gov)
|
|
|
|
:link(ld,Manual.html)
|
|
|
|
:link(lc,Section_commands.html#comm)
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
next command :h3
|
|
|
|
|
|
|
|
[Syntax:]
|
|
|
|
|
|
|
|
next variables :pre
|
|
|
|
|
2006-09-28 03:12:31 +08:00
|
|
|
variables = one or more variable names :ul
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
[Examples:]
|
|
|
|
|
|
|
|
next x
|
2006-09-28 03:12:31 +08:00
|
|
|
next a t x myTemp :pre
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
[Description:]
|
|
|
|
|
|
|
|
This command is used with variables defined by the
|
|
|
|
"variable"_variable.html command. It assigns the next value to the
|
2007-06-20 20:56:17 +08:00
|
|
|
variable from the list of values defined for that variable by the
|
|
|
|
"variable"_variable.html command. Thus when that variable is
|
2006-09-28 03:12:31 +08:00
|
|
|
subsequently substituted for in an input script command, the new value
|
2007-06-20 20:56:17 +08:00
|
|
|
is used.
|
|
|
|
|
|
|
|
See the "variable"_variable.html command for info on how to define and
|
|
|
|
use different kinds of variables in LAMMPS input scripts. If a
|
|
|
|
variable name is a single lower-case character from "a" to "z", it can
|
|
|
|
be used in an input script command as $a or $z. If it is multiple
|
|
|
|
letters, it can be used as $\{myTemp\}.
|
|
|
|
|
|
|
|
If multiple variables are used as arguments to the {next} command,
|
|
|
|
then all must be of the same variable style: {index}, {loop},
|
|
|
|
{universe}, or {uloop}. An exception is that {universe}- and
|
|
|
|
{uloop}-style variables can be mixed in the same {next} command.
|
|
|
|
{Atom}- or {equal}- or {world}-style variables cannot be incremented
|
|
|
|
by a next command. All the variables specified are incremented by one
|
|
|
|
value from their respective lists.
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
When any of the variables in the next command has no more values, a
|
|
|
|
flag is set that causes the input script to skip the next
|
|
|
|
"jump"_jump.html command encountered. This enables a loop containing
|
|
|
|
a next command to exit.
|
|
|
|
|
|
|
|
When the next command is used with {index}- or {loop}-style variables,
|
|
|
|
the next value is assigned to the variable for all processors. When
|
2006-12-20 00:44:20 +08:00
|
|
|
the next command is used with {universe}- or {uloop}-style variables,
|
|
|
|
the next value is assigned to whichever processor partition executes
|
|
|
|
the command first. All processors in the partition are assigned the
|
|
|
|
same value. Running LAMMPS on multiple partitions of processors via
|
|
|
|
the "-partition" command-line switch is described in "this
|
2007-02-10 05:37:30 +08:00
|
|
|
section"_Section_start.html#2_6 of the manual. {Universe}- and
|
2006-12-20 00:44:20 +08:00
|
|
|
{uloop}-style variables are incremented using the files
|
|
|
|
"tmp.lammps.variable" and "tmp.lammps.variable.lock" which you will
|
|
|
|
see in your directory during such a LAMMPS run.
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
Here is an example of running a series of simulations using the next
|
|
|
|
command with an {index}-style variable. If this input script is named
|
|
|
|
in.polymer, 8 simulations would be run using data files from
|
|
|
|
directories run1 thru run8.
|
|
|
|
|
|
|
|
variable d index run1 run2 run3 run4 run5 run6 run7 run8
|
|
|
|
shell cd $d
|
|
|
|
read_data data.polymer
|
|
|
|
run 10000
|
|
|
|
shell cd ..
|
|
|
|
clear
|
|
|
|
next d
|
|
|
|
jump in.polymer :pre
|
|
|
|
|
|
|
|
If the variable "d" were of style {universe}, and the same in.polymer
|
|
|
|
input script were run on 3 partitions of processors, then the first 3
|
|
|
|
simulations would begin, one on each set of processors. Whichever
|
|
|
|
partition finished first, it would assign variable "d" the 4th value
|
|
|
|
and run another simulation, and so forth until all 8 simulations were
|
|
|
|
finished.
|
|
|
|
|
|
|
|
Jump and next commands can also be nested to enable multi-level loops.
|
|
|
|
For example, this script will run 15 simulations in a double loop.
|
|
|
|
|
|
|
|
variable i loop 3
|
|
|
|
variable j loop 5
|
|
|
|
clear
|
|
|
|
...
|
|
|
|
read_data data.polymer.$i$j
|
|
|
|
print Running simulation $i.$j
|
|
|
|
run 10000
|
|
|
|
next j
|
|
|
|
jump in.script
|
|
|
|
next i
|
2007-04-20 07:25:27 +08:00
|
|
|
jump in.script :pre
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
[Restrictions:] none
|
|
|
|
|
|
|
|
[Related commands:]
|
|
|
|
|
|
|
|
"jump"_jump.html, "include"_include.html, "shell"_shell.html,
|
|
|
|
"variable"_variable.html,
|
|
|
|
|
|
|
|
[Default:] none
|