diff --git a/doc/thermo.html b/doc/thermo.html index 3255ee61b..aa36e9eb5 100644 --- a/doc/thermo.html +++ b/doc/thermo.html @@ -1,49 +1,64 @@ <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>thermo command </H3> <P><B>Syntax:</B> </P> <PRE>thermo N </PRE> -<UL><LI>N = output thermodynamics every N timesteps +<UL><LI>N = output thermodynamics every N timesteps +<LI>N can be a variable (see below) </UL> <P><B>Examples:</B> </P> <PRE>thermo 100 </PRE> <P><B>Description:</B> </P> <P>Compute and print thermodynamic info (e.g. temperature, energy, pressure) on timesteps that are a multiple of N and at the beginning and end of a simulation. A value of 0 will only print thermodynamics at the beginning and end. </P> <P>The content and format of what is printed is controlled by the <A HREF = "thermo_style.html">thermo_style</A> and <A HREF = "thermo_modify.html">thermo_modify</A> commands. </P> -<P>The timesteps on which thermo output is written can also be controlled -by a <A HREF = "variable.html">variable</A>. See the <A HREF = "thermo_modify.html">thermo_modify -every</A> command. +<P>Instead of a numeric value, N can be specifed as an <A HREF = "variable.html">equal-style +variable</A>, 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 +thermodynamic info will be written 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 <A HREF = "variable.html">equal-style +variables</A>, as examples of useful functions to use in +this context. Other similar math functions could easily be added as +options for <A HREF = "variable.html">equal-style variables</A>. </P> +<P>For example, the following commands will output thermodynamic info at +timesteps 0,10,20,30,100,200,300,1000,2000,etc: +</P> +<PRE>variable s equal logfreq(10,3,10) +thermo v_s +</PRE> <P><B>Restrictions:</B> none </P> <P><B>Related commands:</B> </P> <P><A HREF = "thermo_style.html">thermo_style</A>, <A HREF = "thermo_modify.html">thermo_modify</A> </P> <P><B>Default:</B> </P> <PRE>thermo 0 </PRE> </HTML> diff --git a/doc/thermo.txt b/doc/thermo.txt index 345637a90..5001fb3c2 100644 --- a/doc/thermo.txt +++ b/doc/thermo.txt @@ -1,44 +1,59 @@ "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 thermo command :h3 [Syntax:] thermo N :pre -N = output thermodynamics every N timesteps :ul +N = output thermodynamics every N timesteps +N can be a variable (see below) :ul [Examples:] thermo 100 :pre [Description:] Compute and print thermodynamic info (e.g. temperature, energy, pressure) on timesteps that are a multiple of N and at the beginning and end of a simulation. A value of 0 will only print thermodynamics at the beginning and end. The content and format of what is printed is controlled by the "thermo_style"_thermo_style.html and "thermo_modify"_thermo_modify.html commands. -The timesteps on which thermo output is written can also be controlled -by a "variable"_variable.html. See the "thermo_modify -every"_thermo_modify.html command. +Instead of a numeric value, N can be specifed as an "equal-style +variable"_variable.html, 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 +thermodynamic info will be written 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. + +For example, the following commands will output thermodynamic info at +timesteps 0,10,20,30,100,200,300,1000,2000,etc: + +variable s equal logfreq(10,3,10) +thermo v_s :pre [Restrictions:] none [Related commands:] "thermo_style"_thermo_style.html, "thermo_modify"_thermo_modify.html [Default:] thermo 0 :pre diff --git a/doc/thermo_modify.html b/doc/thermo_modify.html index 90842ab0f..bca7aa633 100644 --- a/doc/thermo_modify.html +++ b/doc/thermo_modify.html @@ -1,193 +1,161 @@ <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>thermo_modify command </H3> <P><B>Syntax:</B> </P> <PRE>thermo_modify keyword value ... </PRE> <UL><LI>one or more keyword/value pairs may be listed -<LI>keyword = <I>lost</I> or <I>norm</I> or <I>flush</I> or <I>line</I> or <I>format</I> or <I>temp</I> or <I>press</I> or <I>every</I> - -<PRE> <I>lost</I> value = <I>error</I> or <I>warn</I> or <I>ignore</I> +keyword = <I>lost</I> or <I>norm</I> or <I>flush</I> or <I>line</I> or <I>format</I> or <I>temp</I> or <I>press</I>:l + <I>lost</I> value = <I>error</I> or <I>warn</I> or <I>ignore</I> <I>norm</I> value = <I>yes</I> or <I>no</I> <I>flush</I> value = <I>yes</I> or <I>no</I> <I>line</I> value = <I>one</I> or <I>multi</I> <I>format</I> values = <I>int</I> string or <I>float</I> string or M string M = integer from 1 to N, where N = # of quantities being printed string = C-style format string <I>temp</I> value = compute ID that calculates a temperature <I>press</I> value = compute ID that calculates a pressure - <I>every</I> value = v_name - v_name = an equal-style variable name -</PRE> </UL> <P><B>Examples:</B> </P> <PRE>thermo_modify lost ignore flush yes thermo_modify temp myTemp format 3 %15.8g thermo_modify line multi format float %g </PRE> <P><B>Description:</B> </P> <P>Set options for how thermodynamic information is computed and printed by LAMMPS. </P> <P>IMPORTANT NOTE: These options apply to the currently defined thermo style. When you specify a <A HREF = "thermo_style.html">thermo_style</A> command, all thermodynamic settings are restored to their default values, including those previously reset by a thermo_modify command. Thus if your input script specifies a thermo_style command, you should use the thermo_modify command after it. </P> <P>The <I>lost</I> keyword determines whether LAMMPS checks for lost atoms each time it computes thermodynamics and what it does if atoms are lost. An atom can be "lost" if it moves across a non-periodic simulation box <A HREF = "boundary.html">boundary</A> or if it moves more than a box length outside the simulation domain (or more than a processor sub-domain length) before reneighboring occurs. The latter case is typically due to bad dynamics, e.g. too large a timestep or huge forces and velocities. If the value is <I>ignore</I>, LAMMPS does not check for lost atoms. If the value is <I>error</I> or <I>warn</I>, LAMMPS checks and either issues an error or warning. The code will exit with an error and continue with a warning. A warning will only be issued once, the first time an atom is lost. This can be a useful debugging option. </P> <P>The <I>norm</I> keyword determines whether various thermodynamic output values are normalized by the number of atoms or not, depending on whether it is set to <I>yes</I> or <I>no</I>. Different unit styles have different defaults for this setting (see below). Even if <I>norm</I> is set to <I>yes</I>, a value is only normalized if it is an "extensive" quantity, meaning that it scales with the number of atoms in the system. For the thermo keywords described by the doc page for the <A HREF = "thermo_style.html">thermo_style</A> command, all energy-related keywords are extensive, such as <I>pe</I> or <I>ebond</I> or <I>enthalpy</I>. Other keywords such as <I>temp</I> or <I>press</I> are "intensive" meaning their value is independent (in a statistical sense) of the number of atoms in the system and thus are never normalized. For thermodynamic output values extracted from fixes and computes in a <A HREF = "thermo_style.html">thermo_style custom</A> command, the doc page for the individual <A HREF = "fix.html">fix</A> or <A HREF = "compute.html">compute</A> lists whether the value is "extensive" or "intensive" and thus whether it is normalized. Thermodynamic output values calculated by a variable formula are assumed to be "intensive" and thus are never normalized. You can always include a divide by the number of atoms in the variable formula if this is not the case. </P> <P>The <I>flush</I> keyword invokes a flush operation after thermodynamic info is written to the log file. This insures the output in that file is current (no buffering by the OS), even if LAMMPS halts before the simulation completes. </P> <P>The <I>line</I> keyword determines whether thermodynamics will be printed as a series of numeric values on one line or in a multi-line format with 3 quantities with text strings per line and a dashed-line header containing the timestep and CPU time. This modify option overrides the <I>one</I> and <I>multi</I> thermo_style settings. </P> <P>The <I>format</I> keyword sets the numeric format of individual printed quantities. The <I>int</I> and <I>float</I> keywords set the format for all integer or floating-point quantities printed. The setting with a numeric value M (e.g. format 5 %10.4g) sets the format of the Mth value printed in each output line, e.g. the 5th column of output in this case. If the format for a specific column has been set, it will take precedent over the <I>int</I> or <I>float</I> setting. </P> <P>IMPORTANT NOTE: The thermo output values <I>step</I> and <I>atoms</I> are stored internally as 8-byte signed integers, rather than the usual 4-byte signed integers. When specifying the "format int" keyword you can use a "%d"-style format identifier in the format string and LAMMPS will convert this to the corresponding "%lu" form when it is applied to those keywords. However, when specifying the "format M string" keyword for <I>step</I> and <I>natoms</I>, you should specify a string appropriate for an 8-byte signed integer, e.g. one with "%ld". </P> <P>The <I>temp</I> keyword is used to determine how thermodynamic temperature is calculated, which is used by all thermo quantities that require a temperature ("temp", "press", "ke", "etotal", "enthalpy", "pxx", etc). The specified compute ID must have been previously defined by the user via the <A HREF = "compute.html">compute</A> command and it must be a style of compute that calculates a temperature. As described in the <A HREF = "thermo_style.html">thermo_style</A> command, thermo output uses a default compute for temperature with ID = <I>thermo_temp</I>. This option allows the user to override the default. </P> <P>The <I>press</I> keyword is used to determine how thermodynamic pressure is calculated, which is used by all thermo quantities that require a pressure ("press", "enthalpy", "pxx", etc). The specified compute ID must have been previously defined by the user via the <A HREF = "compute.html">compute</A> command and it must be a style of compute that calculates a pressure. As described in the <A HREF = "thermo_style.html">thermo_style</A> command, thermo output uses a default compute for pressure with ID = <I>thermo_press</I>. This option allows the user to override the default. </P> <P>IMPORTANT NOTE: If both the <I>temp</I> and <I>press</I> keywords are used in a single thermo_modify command (or in two separate commands), then the order in which the keywords are specified is important. Note that a <A HREF = "compute_pressure.html">pressure compute</A> defines its own temperature compute as an argument when it is specified. The <I>temp</I> keyword will override this (for the pressure compute being used by thermodynamics), but only if the <I>temp</I> keyword comes after the <I>press</I> keyword. If the <I>temp</I> keyword comes before the <I>press</I> keyword, then the new pressure compute specified by the <I>press</I> keyword will be unaffected by the <I>temp</I> setting. </P> -<P>The <I>every</I> keyword allows a variable to be specified which will -determine which timesteps thermodynamic output is generated. It must -be an <A HREF = "variable.html">equal-style variable</A>, and is specified as -v_name, where name is the variable name. 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 determine the next timestep, etc. Thus the -variable should return timestep values. See the stagger() and -logfreq() and stride() math functions for <A HREF = "variable.html">equal-style -variables</A>, as examples of useful functions to use in -this context. Other similar math functions could easily be added as -options for <A HREF = "variable.html">equal-style variables</A>. In addition, -thermodynamic output will always occur on the first and last timestep -of each run. -</P> -<P>For example, the following commands will output thermodynamic info at -timesteps 0,10,20,30,100,200,300,1000,2000,etc: -</P> -<PRE>variable s equal logfreq(10,3,10) -thermo_modify 1 every v_s -</PRE> -<P>Note that the <I>every</I> keyword overrides the output frequency setting -made by the <A HREF = "thermo.html">thermo</A> command, by setting it to 0. If the -<A HREF = "thermo.html">thermo</A> command is later used to set the output frequency -to a non-zero value, then the variable setting of the thermo_modify -every command will be overridden. -</P> <P><B>Restrictions:</B> none </P> <P><B>Related commands:</B> </P> <P><A HREF = "thermo.html">thermo</A>, <A HREF = "thermo_style.html">thermo_style</A> </P> <P><B>Default:</B> </P> <P>The option defaults are lost = error, norm = yes for unit style of <I>lj</I>, norm = no for unit style of <I>real</I> and <I>metal</I>, flush = no, -temp/press = compute IDs defined by thermo_style, every = non-variable -setting provided by the <A HREF = "thermo.html">thermo</A> command. +and temp/press = compute IDs defined by thermo_style. </P> <P>The defaults for the line and format options depend on the thermo style. For styles "one" and "custom", the line and format defaults are "one", "%8d", and "%12.8g". For style "multi", the line and format defaults are "multi", "%8d", and "%14.4f". </P> </HTML> diff --git a/doc/thermo_modify.txt b/doc/thermo_modify.txt index 5d983afdf..ce9ceea5a 100644 --- a/doc/thermo_modify.txt +++ b/doc/thermo_modify.txt @@ -1,185 +1,155 @@ "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 thermo_modify command :h3 [Syntax:] thermo_modify keyword value ... :pre one or more keyword/value pairs may be listed :ulb,l -keyword = {lost} or {norm} or {flush} or {line} or {format} or {temp} or {press} or {every} :l +keyword = {lost} or {norm} or {flush} or {line} or {format} or {temp} or {press}:l {lost} value = {error} or {warn} or {ignore} {norm} value = {yes} or {no} {flush} value = {yes} or {no} {line} value = {one} or {multi} {format} values = {int} string or {float} string or M string M = integer from 1 to N, where N = # of quantities being printed string = C-style format string {temp} value = compute ID that calculates a temperature {press} value = compute ID that calculates a pressure - {every} value = v_name - v_name = an equal-style variable name :pre :ule [Examples:] thermo_modify lost ignore flush yes thermo_modify temp myTemp format 3 %15.8g thermo_modify line multi format float %g :pre [Description:] Set options for how thermodynamic information is computed and printed by LAMMPS. IMPORTANT NOTE: These options apply to the currently defined thermo style. When you specify a "thermo_style"_thermo_style.html command, all thermodynamic settings are restored to their default values, including those previously reset by a thermo_modify command. Thus if your input script specifies a thermo_style command, you should use the thermo_modify command after it. The {lost} keyword determines whether LAMMPS checks for lost atoms each time it computes thermodynamics and what it does if atoms are lost. An atom can be "lost" if it moves across a non-periodic simulation box "boundary"_boundary.html or if it moves more than a box length outside the simulation domain (or more than a processor sub-domain length) before reneighboring occurs. The latter case is typically due to bad dynamics, e.g. too large a timestep or huge forces and velocities. If the value is {ignore}, LAMMPS does not check for lost atoms. If the value is {error} or {warn}, LAMMPS checks and either issues an error or warning. The code will exit with an error and continue with a warning. A warning will only be issued once, the first time an atom is lost. This can be a useful debugging option. The {norm} keyword determines whether various thermodynamic output values are normalized by the number of atoms or not, depending on whether it is set to {yes} or {no}. Different unit styles have different defaults for this setting (see below). Even if {norm} is set to {yes}, a value is only normalized if it is an "extensive" quantity, meaning that it scales with the number of atoms in the system. For the thermo keywords described by the doc page for the "thermo_style"_thermo_style.html command, all energy-related keywords are extensive, such as {pe} or {ebond} or {enthalpy}. Other keywords such as {temp} or {press} are "intensive" meaning their value is independent (in a statistical sense) of the number of atoms in the system and thus are never normalized. For thermodynamic output values extracted from fixes and computes in a "thermo_style custom"_thermo_style.html command, the doc page for the individual "fix"_fix.html or "compute"_compute.html lists whether the value is "extensive" or "intensive" and thus whether it is normalized. Thermodynamic output values calculated by a variable formula are assumed to be "intensive" and thus are never normalized. You can always include a divide by the number of atoms in the variable formula if this is not the case. The {flush} keyword invokes a flush operation after thermodynamic info is written to the log file. This insures the output in that file is current (no buffering by the OS), even if LAMMPS halts before the simulation completes. The {line} keyword determines whether thermodynamics will be printed as a series of numeric values on one line or in a multi-line format with 3 quantities with text strings per line and a dashed-line header containing the timestep and CPU time. This modify option overrides the {one} and {multi} thermo_style settings. The {format} keyword sets the numeric format of individual printed quantities. The {int} and {float} keywords set the format for all integer or floating-point quantities printed. The setting with a numeric value M (e.g. format 5 %10.4g) sets the format of the Mth value printed in each output line, e.g. the 5th column of output in this case. If the format for a specific column has been set, it will take precedent over the {int} or {float} setting. IMPORTANT NOTE: The thermo output values {step} and {atoms} are stored internally as 8-byte signed integers, rather than the usual 4-byte signed integers. When specifying the "format int" keyword you can use a "%d"-style format identifier in the format string and LAMMPS will convert this to the corresponding "%lu" form when it is applied to those keywords. However, when specifying the "format M string" keyword for {step} and {natoms}, you should specify a string appropriate for an 8-byte signed integer, e.g. one with "%ld". The {temp} keyword is used to determine how thermodynamic temperature is calculated, which is used by all thermo quantities that require a temperature ("temp", "press", "ke", "etotal", "enthalpy", "pxx", etc). The specified compute ID must have been previously defined by the user via the "compute"_compute.html command and it must be a style of compute that calculates a temperature. As described in the "thermo_style"_thermo_style.html command, thermo output uses a default compute for temperature with ID = {thermo_temp}. This option allows the user to override the default. The {press} keyword is used to determine how thermodynamic pressure is calculated, which is used by all thermo quantities that require a pressure ("press", "enthalpy", "pxx", etc). The specified compute ID must have been previously defined by the user via the "compute"_compute.html command and it must be a style of compute that calculates a pressure. As described in the "thermo_style"_thermo_style.html command, thermo output uses a default compute for pressure with ID = {thermo_press}. This option allows the user to override the default. IMPORTANT NOTE: If both the {temp} and {press} keywords are used in a single thermo_modify command (or in two separate commands), then the order in which the keywords are specified is important. Note that a "pressure compute"_compute_pressure.html defines its own temperature compute as an argument when it is specified. The {temp} keyword will override this (for the pressure compute being used by thermodynamics), but only if the {temp} keyword comes after the {press} keyword. If the {temp} keyword comes before the {press} keyword, then the new pressure compute specified by the {press} keyword will be unaffected by the {temp} setting. -The {every} keyword allows a variable to be specified which will -determine which timesteps thermodynamic output is generated. It must -be an "equal-style variable"_variable.html, and is specified as -v_name, where name is the variable name. 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 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. In addition, -thermodynamic output will always occur on the first and last timestep -of each run. - -For example, the following commands will output thermodynamic info at -timesteps 0,10,20,30,100,200,300,1000,2000,etc: - -variable s equal logfreq(10,3,10) -thermo_modify 1 every v_s :pre - -Note that the {every} keyword overrides the output frequency setting -made by the "thermo"_thermo.html command, by setting it to 0. If the -"thermo"_thermo.html command is later used to set the output frequency -to a non-zero value, then the variable setting of the thermo_modify -every command will be overridden. - [Restrictions:] none [Related commands:] "thermo"_thermo.html, "thermo_style"_thermo_style.html [Default:] The option defaults are lost = error, norm = yes for unit style of {lj}, norm = no for unit style of {real} and {metal}, flush = no, -temp/press = compute IDs defined by thermo_style, every = non-variable -setting provided by the "thermo"_thermo.html command. +and temp/press = compute IDs defined by thermo_style. The defaults for the line and format options depend on the thermo style. For styles "one" and "custom", the line and format defaults are "one", "%8d", and "%12.8g". For style "multi", the line and format defaults are "multi", "%8d", and "%14.4f".