diff --git a/doc/Section_commands.html b/doc/Section_commands.html index 1bf90be475..32d3a689ac 100644 --- a/doc/Section_commands.html +++ b/doc/Section_commands.html @@ -276,10 +276,10 @@ in the command's documentation.

Miscellaneous:

-

clear, echo, include, -jump, label, log, -next, print, shell, -variable +

clear, echo, if, +include, jump, label, +log, next, print, +shell, variable


@@ -299,15 +299,15 @@ in the command's documentation. boundaryclearcommunicatecomputecompute_modifycreate_atoms create_boxdelete_atomsdelete_bondsdielectricdihedral_coeffdihedral_style dimensiondipoledisplace_atomsdumpdump_modifyecho -fixfix_modifygroupimproper_coeffimproper_styleinclude -jumpkspace_modifykspace_stylelabellatticelog -massminimizemin_modifymin_styleneigh_modifyneighbor -newtonnextpair_coeffpair_modifypair_stylepair_write -printprocessorsread_dataread_restartregionreplicate -reset_timesteprestartrunrun_stylesetshell -special_bondstemperthermothermo_modifythermo_styletimestep -uncomputeundumpunfixunitsvariablevelocity -write_restart +fixfix_modifygroupifimproper_coeffimproper_style +includejumpkspace_modifykspace_stylelabellattice +logmassminimizemin_modifymin_styleneigh_modify +neighbornewtonnextpair_coeffpair_modifypair_style +pair_writeprintprocessorsread_dataread_restartregion +replicatereset_timesteprestartrunrun_styleset +shellspecial_bondstemperthermothermo_modifythermo_style +timestepuncomputeundumpunfixunitsvariable +velocitywrite_restart
@@ -318,12 +318,12 @@ description:

- - - - - - + + + + +
addforceaveforceave/spatialave/timebox/relaxcomdeformdeposit
dragefieldenforce2dfreezegran/diaggravitygyrationheat
indentlangevinlineforcemsdmomentumnphnptnve
nve/aspherenve/grannve/noforcenvtorient/fccplaneforcepoemspour
printrdfrecenterrigidsetforceshakespringspring/rg
spring/selftemp/rescaletmduniaxialviscousvolume/rescalewall/granwall/lj93
wall/lj126wall/reflectwiggle +
dragefieldellipsoidenforce2dfreezegran/diaggravitygyration
heatindentlangevinlineforcemsdmomentumnphnpt
npt/aspherenvenve/aspherenve/grannve/noforcenvtnvt/asphereorient/fcc
planeforcepoemspourprintrdfrecenterrigidsetforce
shakespringspring/rgspring/selftemp/rescaletmduniaxialviscous
volume/rescalewall/granwall/lj93wall/lj126wall/reflectwiggle

diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt index a79cd76867..434a884984 100644 --- a/doc/Section_commands.txt +++ b/doc/Section_commands.txt @@ -273,10 +273,10 @@ Actions: Miscellaneous: -"clear"_clear.html, "echo"_echo.html, "include"_include.html, -"jump"_jump.html, "label"_label.html, "log"_log.html, -"next"_next.html, "print"_print.html, "shell"_shell.html, -"variable"_variable.html +"clear"_clear.html, "echo"_echo.html, "if"_if.html, +"include"_include.html, "jump"_jump.html, "label"_label.html, +"log"_log.html, "next"_next.html, "print"_print.html, +"shell"_shell.html, "variable"_variable.html :line @@ -318,6 +318,7 @@ in the command's documentation. "fix"_fix.html, "fix_modify"_fix_modify.html, "group"_group.html, +"if"_if.html, "improper_coeff"_improper_coeff.html, "improper_style"_improper_style.html, "include"_include.html, @@ -381,6 +382,7 @@ description: "deposit"_fix_deposit.html, "drag"_fix_drag.html, "efield"_fix_efield.html, +"ellipsoid"_fix_ellipsoid.html, "enforce2d"_fix_enforce2d.html, "freeze"_fix_freeze.html, "gran/diag"_fix_gran_diag.html, @@ -394,11 +396,13 @@ description: "momentum"_fix_momentum.html, "nph"_fix_nph.html, "npt"_fix_npt.html, +"npt/asphere"_fix_npt_asphere.html, "nve"_fix_nve.html, "nve/asphere"_fix_nve_asphere.html, "nve/gran"_fix_nve_gran.html, "nve/noforce"_fix_nve_noforce.html, "nvt"_fix_nvt.html, +"nvt/asphere"_fix_nvt_asphere.html, "orient/fcc"_fix_orient_fcc.html, "planeforce"_fix_planeforce.html, "poems"_fix_poems.html, diff --git a/doc/if.html b/doc/if.html new file mode 100644 index 0000000000..76310bbc71 --- /dev/null +++ b/doc/if.html @@ -0,0 +1,63 @@ + +
LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands +
+ + + + + + +
+ +

if command +

+

Syntax: +

+
if value1 operator value2 then command1 else command2 
+
+ +

Examples: +

+
if $steps > 1000 then exit
+if $x <= $y then "print X is smaller = $x" else "print Y is smaller = $y"
+if $eng > 0.0 then "timestep 0.005"
+if $eng > $eng_previous then "jump file1" else "jump file2" 
+
+

Description: +

+

This command provides an in-then-else test capability within an input +script. Two values are numerically compared to each other and the +result is TRUE or FALSE. Note that as in the examples above, either +of the values can be variables, as defined by the +variable command, so that when they are evaluated when +substituted for in the if command, a user-defined computation will be +performed which can depend on the current state of the simulation. +

+

If the result of the if test is TRUE, then command1 is executed. This +can be any valid LAMMPS input script command. If the command is more +than 1 word, it should be enclosed in double quotes, so that it will +be treated as a single argument, as in the examples above. +

+

The if command can contain an optional "else" clause. If it does and +the result of the if test is FALSE, then command2 is executed. +

+

Note that if either command1 or command2 is a bogus LAMMPS command, +such as "exit" in the first example, then executing the command will +cause LAMMPS to halt. +

+

Restrictions: none +

+

Related commands: +

+

variable +

+

Default: none +

+ diff --git a/doc/if.txt b/doc/if.txt new file mode 100644 index 0000000000..e145463511 --- /dev/null +++ b/doc/if.txt @@ -0,0 +1,58 @@ +"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 + +if command :h3 + +[Syntax:] + +if value1 operator value2 then command1 else command2 :pre + +value1 = 1st value +operator = "==" or "!=" or "<" or "<=" or ">" or ">=" +value2 = 2nd value +then = required word +command1 = command to execute if condition is met +else = required word (optional argument) +command2 = command to execute if condition is not met (optional argument) :ul + +[Examples:] + +if ${steps} > 1000 then exit +if $x <= $y then "print X is smaller = $x" else "print Y is smaller = $y" +if ${eng} > 0.0 then "timestep 0.005" +if ${eng} > ${eng_previous} then "jump file1" else "jump file2" :pre + +[Description:] + +This command provides an in-then-else test capability within an input +script. Two values are numerically compared to each other and the +result is TRUE or FALSE. Note that as in the examples above, either +of the values can be variables, as defined by the +"variable"_variable.html command, so that when they are evaluated when +substituted for in the if command, a user-defined computation will be +performed which can depend on the current state of the simulation. + +If the result of the if test is TRUE, then command1 is executed. This +can be any valid LAMMPS input script command. If the command is more +than 1 word, it should be enclosed in double quotes, so that it will +be treated as a single argument, as in the examples above. + +The if command can contain an optional "else" clause. If it does and +the result of the if test is FALSE, then command2 is executed. + +Note that if either command1 or command2 is a bogus LAMMPS command, +such as "exit" in the first example, then executing the command will +cause LAMMPS to halt. + +[Restrictions:] none + +[Related commands:] + +"variable"_variable.html + +[Default:] none diff --git a/doc/run.html b/doc/run.html index 36faefedc4..e3147f330f 100644 --- a/doc/run.html +++ b/doc/run.html @@ -127,7 +127,7 @@ about how to couple LAMMPS to other codes. each M-length run, the command is invoked. If the command is specified as NULL, no command is invoked. Thus these lines:

-
variable q equal x100
+
variable q equal x[100]
 run 6000 every 2000 "print Coord = $q" 
 

are the equivalent of: diff --git a/doc/run.txt b/doc/run.txt index 680526e996..b186b36c69 100644 --- a/doc/run.txt +++ b/doc/run.txt @@ -120,7 +120,7 @@ N total steps are simulated, in shorter runs of M steps each. After each M-length run, the command is invoked. If the command is specified as NULL, no command is invoked. Thus these lines: -variable q equal x[100] +variable q equal x\[100\] run 6000 every 2000 "print Coord = $q" :pre are the equivalent of: