diff --git a/doc/dump.html b/doc/dump.html index e8c9100717..819a46ce34 100644 --- a/doc/dump.html +++ b/doc/dump.html @@ -308,12 +308,14 @@ minimization converges. Note that this means a dump will not be performed on the initial timestep after the dump command is invoked, if the current timestep is not a multiple of N. This behavior can be changed via the dump_modify first command, which -can be useful if the dump command is invoked after a minimization +can also be useful if the dump command is invoked after a minimization ended on an arbitrary timestep. N can be changed between runs by using the dump_modify every command (not allowed for dcd style). The dump_modify every command also allows a variable to be used to determine the sequence of -timesteps on which dump files are written. +timesteps on which dump files are written. In this mode a dump on the +first timestep of a run will also not be written unless the +dump_modify first command is used.

The specified filename determines how the dump file(s) is written. The default is to write one large text file, which is opened when the diff --git a/doc/dump.txt b/doc/dump.txt index 3ffdf408c1..b81277ea73 100644 --- a/doc/dump.txt +++ b/doc/dump.txt @@ -296,12 +296,14 @@ minimization converges. Note that this means a dump will not be performed on the initial timestep after the dump command is invoked, if the current timestep is not a multiple of N. This behavior can be changed via the "dump_modify first"_dump_modify.html command, which -can be useful if the dump command is invoked after a minimization +can also be useful if the dump command is invoked after a minimization ended on an arbitrary timestep. N can be changed between runs by using the "dump_modify every"_dump_modify.html command (not allowed for {dcd} style). The "dump_modify every"_dump_modify.html command also allows a variable to be used to determine the sequence of -timesteps on which dump files are written. +timesteps on which dump files are written. In this mode a dump on the +first timestep of a run will also not be written unless the +"dump_modify first"_dump_modify.html command is used. The specified filename determines how the dump file(s) is written. The default is to write one large text file, which is opened when the diff --git a/doc/dump_modify.html b/doc/dump_modify.html index 331141c8c0..726eae7fdf 100644 --- a/doc/dump_modify.html +++ b/doc/dump_modify.html @@ -365,16 +365,22 @@ which should be specified as v_name, where name is the variable name.

In this case, the variable is evaluated at the beginning of a run to determine the next timestep at which a dump snapshot will be written -out. On that timestep, the variable will be evaluated again to +out. On that timestep the variable will be evaluated again to determine the next timestep, etc. Thus the variable should return timestep values. See the stagger() and logfreq() and stride() math functions for equal-style variables, as examples of useful functions to use in this context. Other similar math functions could easily be added as options for equal-style -variables. When using the variable option with the -every keyword, you also need to use the first option if you want -an initial snapshot written to the dump file. The every keyword -cannot be used with the dump dcd style. +variables. Also see the next() function, which allows +use of a file-style variable which reads successive values from a +file, each time the variable is evaluated. Used with the every +keyword, if the file contains a list of ascending timesteps, you can +output snapshots whenever you wish. +

+

Note that when using the variable option with the every keyword, you +need to use the first option if you want an initial snapshot written +to the dump file. The every keyword cannot be used with the dump +dcd style.

For example, the following commands will write snapshots at timesteps 0,10,20,30,100,200,300,1000,2000,etc: @@ -383,6 +389,25 @@ write snapshots at timesteps 0,10,20,30,100,200,300,1000,2000,etc: dump 1 all atom 100 tmp.dump dump_modify 1 every v_s first yes +

The following commands would write snapshots at the timesteps listed +in file tmp.times: +

+
variable        f file tmp.times
+variable	s equal next(f)
+dump		1 all atom 100 tmp.dump
+dump_modify	1 every v_s 
+
+

IMPORTANT NOTE: When using a file-style variable with the every +keyword, the file of timesteps must list a first timestep that is +beyond the current timestep (e.g. it cannot be 0). And it must list +one or more timesteps beyond the length of the run you perform. This +is because the dump command will generate an error if the next +timestep it reads from the file is not a value greater than the +current timestep. Thus if you wanted output on steps 0,15,100 of a +100-timestep run, the file should contain the values 15,100,101 and +you should also use the dump_modify first command. Any final value > +100 could be used in place of 101. +


The first keyword determines whether a dump snapshot is written on diff --git a/doc/dump_modify.txt b/doc/dump_modify.txt index e1f2176465..6b820bde40 100644 --- a/doc/dump_modify.txt +++ b/doc/dump_modify.txt @@ -358,16 +358,22 @@ which should be specified as v_name, where name is the variable name. In this case, the variable is evaluated at the beginning of a run to determine the next timestep at which a dump snapshot will be written -out. On that timestep, the variable will be evaluated again to +out. On that timestep the variable will be evaluated again to determine the next timestep, etc. Thus the variable should return timestep values. See the stagger() and logfreq() and stride() math functions for "equal-style variables"_variable.html, as examples of useful functions to use in this context. Other similar math functions could easily be added as options for "equal-style -variables"_variable.html. When using the variable option with the -{every} keyword, you also need to use the {first} option if you want -an initial snapshot written to the dump file. The {every} keyword -cannot be used with the dump {dcd} style. +variables"_variable.html. Also see the next() function, which allows +use of a file-style variable which reads successive values from a +file, each time the variable is evaluated. Used with the {every} +keyword, if the file contains a list of ascending timesteps, you can +output snapshots whenever you wish. + +Note that when using the variable option with the {every} keyword, you +need to use the {first} option if you want an initial snapshot written +to the dump file. The {every} keyword cannot be used with the dump +{dcd} style. For example, the following commands will write snapshots at timesteps 0,10,20,30,100,200,300,1000,2000,etc: @@ -376,6 +382,25 @@ variable s equal logfreq(10,3,10) dump 1 all atom 100 tmp.dump dump_modify 1 every v_s first yes :pre +The following commands would write snapshots at the timesteps listed +in file tmp.times: + +variable f file tmp.times +variable s equal next(f) +dump 1 all atom 100 tmp.dump +dump_modify 1 every v_s :pre + +IMPORTANT NOTE: When using a file-style variable with the {every} +keyword, the file of timesteps must list a first timestep that is +beyond the current timestep (e.g. it cannot be 0). And it must list +one or more timesteps beyond the length of the run you perform. This +is because the dump command will generate an error if the next +timestep it reads from the file is not a value greater than the +current timestep. Thus if you wanted output on steps 0,15,100 of a +100-timestep run, the file should contain the values 15,100,101 and +you should also use the dump_modify first command. Any final value > +100 could be used in place of 101. + :line The {first} keyword determines whether a dump snapshot is written on diff --git a/doc/next.html b/doc/next.html index 31be8e0f5f..f9ad104f29 100644 --- a/doc/next.html +++ b/doc/next.html @@ -38,14 +38,15 @@ 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, +then all must be of the same variable style: index, loop, file, universe, or uloop. An exception is that universe- and uloop-style variables can be mixed in the same next command.

All the variables specified with the next command are incremented by -one value from their respective list or values. String- or atom- -or equal- or world-style variables cannot be used with the the -next command, since they only store a single value. +one value from their respective list of values. A file-style variable +reads the next line from its associated file. String- or atom- or +equal- or world-style variables cannot be used with the the next +command, since they only store a single value.

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 @@ -53,18 +54,19 @@ flag is set that causes the input script to skip the next a next command to exit. As explained in the variable command, the variable that has exhausted its values is also deleted. This allows it to be used and re-defined later in the input script. +File-style variables are exhausted when the end-of-file is reached.

-

When the next command is used with index- or loop-style variables, -the next value is assigned to the variable for all processors. When -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 -section of the manual. Universe- and -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. +

When the next command is used with index- or loop-style or +file-style variables, the next value is assigned to the variable for +all processors. When 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 section of the manual. +Universe- and 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.

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 diff --git a/doc/next.txt b/doc/next.txt index f0be628871..4e3f2b2ce2 100644 --- a/doc/next.txt +++ b/doc/next.txt @@ -35,14 +35,15 @@ 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}, +then all must be of the same variable style: {index}, {loop}, {file}, {universe}, or {uloop}. An exception is that {universe}- and {uloop}-style variables can be mixed in the same {next} command. All the variables specified with the next command are incremented by -one value from their respective list or values. {String-} or {atom}- -or {equal}- or {world}-style variables cannot be used with the the -next command, since they only store a single value. +one value from their respective list of values. A {file}-style variable +reads the next line from its associated file. {String-} or {atom}- or +{equal}- or {world}-style variables cannot be used with the the next +command, since they only store a single value. 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 @@ -50,18 +51,19 @@ flag is set that causes the input script to skip the next a next command to exit. As explained in the "variable"_variable.html command, the variable that has exhausted its values is also deleted. This allows it to be used and re-defined later in the input script. +{File}-style variables are exhausted when the end-of-file is reached. -When the next command is used with {index}- or {loop}-style variables, -the next value is assigned to the variable for all processors. When -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 -section"_Section_start.html#start_7 of the manual. {Universe}- and -{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. +When the next command is used with {index}- or {loop}-style or +{file}-style variables, the next value is assigned to the variable for +all processors. When 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 section"_Section_start.html#start_7 of the manual. +{Universe}- and {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. 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 diff --git a/doc/variable.html b/doc/variable.html index 7051914f05..af6cd728a0 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -17,7 +17,7 @@