2006-09-22 00:22:34 +08:00
|
|
|
<HTML>
|
|
|
|
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
|
|
|
|
</CENTER>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H3>jump command
|
|
|
|
</H3>
|
|
|
|
<P><B>Syntax:</B>
|
|
|
|
</P>
|
|
|
|
<PRE>jump file label
|
|
|
|
</PRE>
|
|
|
|
<UL><LI>file = filename of new input script to switch to
|
|
|
|
<LI>label = optional label within file to jump to
|
|
|
|
</UL>
|
|
|
|
<P><B>Examples:</B>
|
|
|
|
</P>
|
|
|
|
<PRE>jump newfile
|
|
|
|
jump in.run2 runloop
|
|
|
|
</PRE>
|
|
|
|
<P><B>Description:</B>
|
|
|
|
</P>
|
|
|
|
<P>This command closes the current input script file, opens the file with
|
|
|
|
the specified name, and begins reading LAMMPS commands from that file.
|
2008-10-07 23:02:40 +08:00
|
|
|
Unlike the <A HREF = "include.html">include</A> command, the original file is not
|
|
|
|
returned to, although by using multiple jump commands it is possible
|
|
|
|
to chain from file to file or back to the original file.
|
2006-09-22 00:22:34 +08:00
|
|
|
</P>
|
|
|
|
<P>Optionally, if a 2nd argument is used, it is treated as a label and
|
|
|
|
the new file is scanned (without executing commands) until the label
|
|
|
|
is found, and commands are executed from that point forward. This can
|
|
|
|
be used to loop over a portion of the input script, as in this
|
|
|
|
example. These commands perform 10 runs, each of 10000 steps, and
|
|
|
|
create 10 dump files named file.1, file.2, etc. The <A HREF = "next.html">next</A>
|
|
|
|
command is used to exit the loop after 10 iterations. When the "a"
|
2008-03-01 09:13:20 +08:00
|
|
|
variable has been incremented for the tenth time, it will cause the
|
2006-09-22 00:22:34 +08:00
|
|
|
next jump command to be skipped.
|
|
|
|
</P>
|
|
|
|
<PRE>variable a loop 10
|
|
|
|
label loop
|
|
|
|
dump 1 all atom 100 file.$a
|
|
|
|
run 10000
|
|
|
|
undump 1
|
|
|
|
next a
|
|
|
|
jump in.lj loop
|
|
|
|
</PRE>
|
|
|
|
<P>If the jump <I>file</I> argument is a variable, the jump command can be
|
|
|
|
used to cause different processor partitions to run different input
|
|
|
|
scripts. In this example, LAMMPS is run on 40 processors, with 4
|
2008-03-19 05:09:15 +08:00
|
|
|
partitions of 10 procs each. An in.file containing the example
|
|
|
|
variable and jump command will cause each partition to run a different
|
2006-09-22 00:22:34 +08:00
|
|
|
simulation.
|
|
|
|
</P>
|
|
|
|
<PRE>mpirun -np 40 lmp_ibm -partition 4x10 -in in.file
|
|
|
|
</PRE>
|
|
|
|
<PRE>variable f world script.1 script.2 script.3 script.4
|
|
|
|
jump $f
|
|
|
|
</PRE>
|
2008-10-07 23:02:40 +08:00
|
|
|
<P>Here is an example of a double loop which uses the <A HREF = "if.html">if</A> and
|
|
|
|
jump commands to break out of the inner loop when a condition is met,
|
|
|
|
then continues iterating thru the outer loop.
|
|
|
|
</P>
|
|
|
|
<PRE>label loopa
|
|
|
|
variable a loop 5
|
|
|
|
label loopb
|
|
|
|
variable b loop 5
|
|
|
|
print "A,B = $a,$b"
|
|
|
|
run 10000
|
|
|
|
if $b > 2 then "jump in.script break"
|
|
|
|
next b
|
|
|
|
jump in.script loopb
|
|
|
|
label break
|
|
|
|
variable b delete
|
|
|
|
</PRE>
|
|
|
|
<PRE>next a
|
|
|
|
jump in.script loopa
|
|
|
|
</PRE>
|
2006-09-22 00:22:34 +08:00
|
|
|
<P><B>Restrictions:</B>
|
|
|
|
</P>
|
|
|
|
<P>If you jump to a file and it does not contain the specified label,
|
|
|
|
LAMMPS will come to the end of the file and exit.
|
|
|
|
</P>
|
|
|
|
<P><B>Related commands:</B>
|
|
|
|
</P>
|
|
|
|
<P><A HREF = "variable.html">variable</A>, <A HREF = "include.html">include</A>, <A HREF = "label.html">label</A>,
|
|
|
|
<A HREF = "next.html">next</A>
|
|
|
|
</P>
|
|
|
|
<P><B>Default:</B> none
|
|
|
|
</P>
|
|
|
|
</HTML>
|