new fix halt command, other sundry small bug fixes
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<!-- HTML_ONLY -->
|
||||
<HEAD>
|
||||
<TITLE>LAMMPS Users Manual</TITLE>
|
||||
<META NAME="docnumber" CONTENT="12 Oct 2016 version">
|
||||
<META NAME="docnumber" CONTENT="18 Oct 2016 version">
|
||||
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
|
||||
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
|
||||
</HEAD>
|
||||
@ -21,7 +21,7 @@
|
||||
<H1></H1>
|
||||
|
||||
LAMMPS Documentation :c,h3
|
||||
12 Oct 2016 version :c,h4
|
||||
18 Oct 2016 version :c,h4
|
||||
|
||||
Version info: :h4
|
||||
|
||||
|
||||
@ -573,6 +573,7 @@ USER-INTEL, k = KOKKOS, o = USER-OMP, t = OPT.
|
||||
"gcmc"_fix_gcmc.html,
|
||||
"gld"_fix_gld.html,
|
||||
"gravity (o)"_fix_gravity.html,
|
||||
"halt"_fix_halt.html,
|
||||
"heat"_fix_heat.html,
|
||||
"indent"_fix_indent.html,
|
||||
"langevin (k)"_fix_langevin.html,
|
||||
|
||||
@ -47,9 +47,9 @@ keyword = {append} or {buffer} or {element} or {every} or {fileper} or {first} o
|
||||
id = sort per-atom lines by atom ID
|
||||
N = sort per-atom lines in ascending order by the Nth column
|
||||
-N = sort per-atom lines in descending order by the Nth column
|
||||
{thresh} args = attribute operation value
|
||||
{thresh} args = attribute operator value
|
||||
attribute = same attributes (x,fy,etotal,sxx,etc) used by dump custom style
|
||||
operation = "<" or "<=" or ">" or ">=" or "==" or "!=" or "|^"
|
||||
operator = "<" or "<=" or ">" or ">=" or "==" or "!=" or "|^"
|
||||
value = numeric value to compare to, or LAST
|
||||
these 3 args can be replaced by the word "none" to turn off thresholding
|
||||
{unwrap} arg = {yes} or {no} :pre
|
||||
@ -470,7 +470,7 @@ stress of atoms whose energy is above some threshold.
|
||||
|
||||
If an atom-style variable is used as the attribute, then it can
|
||||
produce continuous numeric values or effective Boolean 0/1 values
|
||||
which may be useful for the comparision operation. Boolean values can
|
||||
which may be useful for the comparision operator. Boolean values can
|
||||
be generated by variable formulas that use comparison or Boolean math
|
||||
operators or special functions like gmask() and rmask() and grmask().
|
||||
See the "variable"_variable.html command doc page for details.
|
||||
@ -503,11 +503,11 @@ less than 1/2 to greater than 1/2 (or vice versa) since the last dump.
|
||||
E.g. due to reactions and subsequent charge equilibration in a
|
||||
reactive force field.
|
||||
|
||||
The choice of operations are the usual comparison operators. The XOR
|
||||
operation (exclusive or) is also included as "|^". In this context,
|
||||
XOR means that if either the attribute or value is 0.0 and the other
|
||||
is non-zero, then the result is "true" and the threshold criterion is
|
||||
met. Otherwise it is not met.
|
||||
The choice of operators listed above are the usual comparison
|
||||
operators. The XOR operation (exclusive or) is also included as "|^".
|
||||
In this context, XOR means that if either the attribute or value is
|
||||
0.0 and the other is non-zero, then the result is "true" and the
|
||||
threshold criterion is met. Otherwise it is not met.
|
||||
|
||||
:line
|
||||
|
||||
|
||||
121
doc/src/fix_halt.txt
Normal file
121
doc/src/fix_halt.txt
Normal file
@ -0,0 +1,121 @@
|
||||
"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
|
||||
|
||||
fix halt command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
fix ID group-ID halt N attribute operator avalue keyword value ... :pre
|
||||
|
||||
ID, group-ID are documented in "fix"_fix.html command :ulb,l
|
||||
halt = style name of this fix command :l
|
||||
N = check halt condition every N steps :l
|
||||
attribute = hstyle or v_name :l
|
||||
hstyle = {bondmax}
|
||||
v_name = name of "equal-style variable"_variable.html :pre
|
||||
operator = "<" or "<=" or ">" or ">=" or "==" or "!=" or "|^" :l
|
||||
avalue = numeric value to compare attribute to :l
|
||||
string = text string to print with optional variable names :l
|
||||
zero or more keyword/value pairs may be appended :l
|
||||
keyword = {error} :l
|
||||
{error} value = {hard} or {soft} or {continue} :pre
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
fix 10 all halt 1 bondmax > 1.5
|
||||
fix 10 all print 10 v_myCheck != 0 error soft :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Check a condition every N steps during a simulation run. N must be >=
|
||||
1. If the condition is met, exit the run immediately. In this
|
||||
context a "run" can be dynamics or minimization iterations, as
|
||||
specified by the "run"_run.html or "minimize"_minimize.html command.
|
||||
|
||||
The specified group-ID is ignored by this fix.
|
||||
|
||||
The specified {attribute} can be one of the {hstyle} options listed
|
||||
above, or an "equal-style variable"_variable.html referenced as
|
||||
{v_name}, where "name" is the name of a variable that has been defined
|
||||
previously in the input script.
|
||||
|
||||
The only {hstyle} option currently implemented is {bondmax}. This
|
||||
will loop over all bonds in the system, compute their current
|
||||
lengths, and set {attribute} to the longest bond distance.
|
||||
|
||||
Equal-style variables evaluate to a numeric value. See the
|
||||
"variable"_variable.html command for a description. They calculate
|
||||
formulas which can involve mathematical operations, atom properties,
|
||||
group properties, thermodynamic properties, global values calculated
|
||||
by a "compute"_compute.html or "fix"_fix.html, or references to other
|
||||
"variables"_variable.html. Thus they are a very general means of
|
||||
computing some attribute of the current system. For example, the
|
||||
following "bondmax" variable will calculate the same quantity as the
|
||||
hstyle = bondmax option.
|
||||
|
||||
compute bdist all bond/local dist
|
||||
compute bmax all reduce max c_bdist
|
||||
variable bondmax equal c_bmax :pre
|
||||
|
||||
Thus these two versions of a fix halt command will do the same thing:
|
||||
|
||||
fix 10 all halt 1 bondmax > 1.5
|
||||
fix 10 all halt 1 v_bondmax > 1.5 :pre
|
||||
|
||||
The version with "bondmax" will just run somewhat faster, due to less
|
||||
overhead in computing bond lengths and not storing them in a separate
|
||||
compute.
|
||||
|
||||
The choice of operators listed above are the usual comparison
|
||||
operators. The XOR operation (exclusive or) is also included as "|^".
|
||||
In this context, XOR means that if either the attribute or avalue is
|
||||
0.0 and the other is non-zero, then the result is "true". Otherwise
|
||||
it is "false".
|
||||
|
||||
The specified {avalue} must be a numeric value.
|
||||
|
||||
:line
|
||||
|
||||
The optional {error} keyword determines how the current run is halted.
|
||||
If its value is {hard}, then LAMMPS will stop with an error message.
|
||||
|
||||
If its value is {soft}, LAMMPS will exit the current run, but continue
|
||||
to execute subsequent commands in the input script. However,
|
||||
additional "run"_run.html or "minimize"_minimize.html commands will be
|
||||
skipped. For example, this allows a script to output the current
|
||||
state of the system, e.g. via a "write_dump"_write_dump.html or
|
||||
"write_restart"_write_restart.html command.
|
||||
|
||||
If its value is {continue}, the behavior is the same as for {soft},
|
||||
except subsequent subsequent "run"_run.html or
|
||||
"minimize"_minimize.html commands are executed. This allows your
|
||||
script to remedy the condition that triggered the halt, if necessary.
|
||||
Note that you may wish use the "unfix"_unfix.html command on the fix
|
||||
halt ID, so that the same condition is not immediately triggered in a
|
||||
subsequent run.
|
||||
|
||||
[Restart, fix_modify, output, run start/stop, minimize info:]
|
||||
|
||||
No information about this fix is written to "binary restart
|
||||
files"_restart.html. None of the "fix_modify"_fix_modify.html options
|
||||
are relevant to this fix. No global or per-atom quantities are stored
|
||||
by this fix for access by various "output
|
||||
commands"_Section_howto.html#howto_15. No parameter of this fix can
|
||||
be used with the {start/stop} keywords of the "run"_run.html command.
|
||||
This fix is not invoked during "energy minimization"_minimize.html.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"variable"_variable.html
|
||||
|
||||
[Default:]
|
||||
|
||||
The option defaults are error = hard.
|
||||
@ -103,6 +103,11 @@ the line search fails because the step distance backtracks to 0.0
|
||||
the number of outer iterations or timesteps exceeds {maxiter}
|
||||
the number of total force evaluations exceeds {maxeval} :ul
|
||||
|
||||
NOTE: You can also use the "fix halt"_fix_halt.html command to specify
|
||||
a general criterion for exiting a minimization, that is a calculation
|
||||
performed on the state of the current system, as defined by an
|
||||
"equal-style variable"_variable.html.
|
||||
|
||||
For the first criterion, the specified energy tolerance {etol} is
|
||||
unitless; it is met when the energy change between successive
|
||||
iterations divided by the energy magnitude is less than or equal to
|
||||
|
||||
@ -169,17 +169,17 @@ If the {pre} and {post} options are set to "no" when used with the
|
||||
run will print the full timing summary, but these operations will be
|
||||
skipped for intermediate runs.
|
||||
|
||||
NOTE: You might hope to specify a command that exits the run by
|
||||
NOTE: You might wish to specify a command that exits the run by
|
||||
jumping out of the loop, e.g.
|
||||
|
||||
variable t equal temp
|
||||
run 10000 every 100 "if '$t < 300.0' then 'jump SELF afterrun'" :pre
|
||||
|
||||
Unfortunately this will not currently work. The run command simply
|
||||
executes each command one at a time each time it pauses, then
|
||||
continues the run. You can replace the jump command with a simple
|
||||
"quit"_quit.html command and cause LAMMPS to exit during the
|
||||
middle of a run when the condition is met.
|
||||
However, this will not work. The run command simply executes each
|
||||
command one at a time each time it pauses, then continues the run.
|
||||
|
||||
Instead, you should use the "fix halt"_fix_halt.html command, which
|
||||
has additional options for how to exit the run.
|
||||
|
||||
[Restrictions:]
|
||||
|
||||
@ -198,7 +198,7 @@ successive runs to run a simulation for any number of steps (ok, up to
|
||||
[Related commands:]
|
||||
|
||||
"minimize"_minimize.html, "run_style"_run_style.html,
|
||||
"temper"_temper.html
|
||||
"temper"_temper.html, "fix halt"_fix_halt.html
|
||||
|
||||
[Default:]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user