From c10f59aa181995a68bdfb211cbbdd0152d9e5f0b Mon Sep 17 00:00:00 2001
From: sjplimp
These are compute styles contributed by users, which can be used if diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt index 91b93d4ce9..aa60e9fb4a 100644 --- a/doc/Section_commands.txt +++ b/doc/Section_commands.txt @@ -437,7 +437,6 @@ Compute styles. See the "compute"_compute.html command for one-line descriptions of each style or click on the style itself for a full description: -"attribute/atom"_compute_attribute_atom.html, "centro/atom"_compute_centro_atom.html, "coord/atom"_compute_coord_atom.html, "ke/atom"_compute_ke_atom.html, @@ -448,16 +447,13 @@ description: "rotate/gran"_compute_rotate_gran.html, "stress/atom"_compute_stress_atom.html, "sum"_compute_sum.html, -"sum/atom"_compute_sum_atom.html, "temp"_compute_temp.html, "temp/asphere"_compute_temp_asphere.html, "temp/deform"_compute_temp_deform.html, "temp/dipole"_compute_temp_dipole.html, "temp/partial"_compute_temp_partial.html, "temp/ramp"_compute_temp_ramp.html, -"temp/region"_compute_temp_region.html, -"variable"_compute_variable.html, -"variable/atom"_compute_variable_atom.html :tb(c=6,ea=c) +"temp/region"_compute_temp_region.html :tb(c=6,ea=c) These are compute styles contributed by users, which can be used if "LAMMPS is built with the appropriate package"_Section_start.html#2_3. diff --git a/doc/Section_howto.html b/doc/Section_howto.html index 0e8dbfc392..5fe33645d0 100644 --- a/doc/Section_howto.html +++ b/doc/Section_howto.html @@ -805,131 +805,198 @@ which is a list of quantities printed every few timesteps to the screen and logfile. The second is dump files, which contain snapshots of atoms and various per-atom values and are written at a specified frequency. A simulation prints one set of -thermodynamic output; it may generate zero, or one, or multiple dump -files. LAMMPS gives you a variety of ways to determine what +thermodynamic output; it may generate any number of dump files. As +discussed below, LAMMPS gives you a variety of ways to determine what quantities are computed and printed when thermodynamic info or dump files are output. There are also three fixes which can do their own -output of user-defined quantities: fix ave/time -for time averaging, fix ave/spatial for spatial -averaging, and fix print. These are described below. +output of user-chosen quantities: fix ave/time for +time averaging, fix ave/spatial for spatial +averaging, and fix print. These are also described +below. Throughout this discussion, note that users can add their own +computes and fixes to LAMMPS which can then +generate values that can be output with these commands.
+The frequency and format of thermodynamic output is set by the thermo, thermo_style, and thermo_modify commands. The thermo_style command also specifies what values are calculated and written out. Pre-defined keywords can be specified -(e.g. press, etotal, etc) which include time-averaged versions of -temperature, pressure, and a few other variables (tave, pave, etc). -Three addtional kinds of keywords can also be specified (c_ID, f_ID, -v_name), where a compute or fix or -variable provides the value(s) to be output. Each of -these are described in turn. +(e.g. press, etotal, etc). Three addtional kinds of keywords can also +be specified (c_ID, f_ID, v_name), where a compute or +fix or variable provides the value to be +output. Each of these are described in turn.
In LAMMPS, a compute comes in two flavors: ones that -compute one or more global values (e.g. temperature, kinetic energy -tensor) and ones that compute one or more per-atom values. There is a -compute sum command which sums per-atom quantities -into a global scalar or vector. +compute global values (e.g. temperature, pressure tensor) and ones +that compute per-atom values. Only global quantities from a compute +can be used for thermodynamic output. The user-defined ID of the +compute is used along with an optional subscript as part of the +thermo_style command. E.g. c_myTemp outputs the +single scalar value generated by the compute; c_myTemp[2] outputs +the 2nd vector value. Note that there is a compute +sum command which sums per-atom quantities into a +global scalar or vector.
-Only global quantities from a compute can be used for thermodynamic -output. The user-defined ID of the compute is used along with an -optional subscript as part of the thermo_style -command. E.g. c_myTemp outputs the single scalar value generated by -the compute; c_myTemp[2] would output the 2nd vector value. +
Fixes can generate global scalar or vector values which can +be output with thermodynamic output, e.g. the energy of an indenter's +interaction with the simulation atoms. These values are accessed via +the same format as a compute's values, as f_ID or f_ID[N]. See the +doc pages for individual fix commands to see which ones generate +global values that can be output with thermodynamic info. The fix +ave/time command generates time-averaged global +quantities which can be accessed for thermodynamic output, e.g. a +time-averaged pressure.
-Fixes can also generate global scalar or vector values -which can be output with thermodynamic output, e.g. the energy of an -indenter's interaction with the simulation atoms. These values are -accessed via the same format as a compute's values, as f_ID or -f_ID[N]. See the doc pages for individual fix commands to see which -ones generate global values that can be output with thermodynamic -info. The fix ave/time command generates -time-averaged global quantities which can be accessed for -thermodynamic output. -
-Input script variables of various kinds are defined by the -variable command. All kinds except the atom-style -variable can be used for thermodynamic output. A variable with name +
Variables can be defined in the input script. All +styles except the atom-style variable can be used for thermodynamic +output, since it generates per-atom values. A variable with the name "abc" is referenced in a thermo_style command as v_abc.
-The variable formula defined in the input script can contain math -functions (add, exp, etc), atom values (x[N], fx[N]), groups -quantities (mass(), vcm(), etc), references to thermodynamic -quantities (e.g. temp, volume, etc), or references to other variables -or computes or fixes. Thus a variable is -the most general way to define some quantity you want calculated and -output with thermodynamic info. +
The formula associated with equal-style variables can contain math +operations and functions (x+y,x*y,(),sqrt,exp,etc), atom values +(x[N],fx[N],etc), group functions (mass(),vcm(),etc), references +to thermodynamic quantities (temp,press,vol,etc), references to +computes that generate global values, references to +fixes that generate global values, or references to other +variables. Thus an equal-style variable is the most +general way to define some quantity to calculate and include with +thermodynamic output.
+Dump file output is specified by the dump and dump_modify commands. There are several pre-defined formats (dump atom, dump xtc, etc). There is also a dump -custom format where you specify what values are output with -each atom. Pre-defined keywords can be specified (e.g. tag, type, x, -etc). Two additional kinds of keywords can also be specified (c_ID, -f_ID), where a compute or fix provides the -values to be output. +custom format where the user specifies what values are +output with each atom. Pre-defined keywords can be specified (tag, x, +fx, etc). Three additional kinds of keywords can also be specified +(c_ID, f_ID, v_name), where a compute or fix +or variable provides the value to be output. Each of +these are described in turn.
-Computes that generate per-atom values can be accessed -by the dump custom command. These are computes that have the word -"atom" in their style name, e.g. ke/atom, stress/atom, etc. The -values are accessed as c_myKE for a scalar per-atom quantity or as -c_myStress[2] for a component of a vector per-atom quantity. The -compute variable/atom command takes a -user-defined atom-style variable as input and -calculates its value for each atom. Since this compute can be -accessed by the dump custom command, this is a general way to define -some quantity you want calculated and output in a dump file. +
Computes that generate one or more per-atom values can +be accessed by the dump custom command. These are computes that have +the word "atom" in their style name, e.g. ke/atom, stress/atom, etc. +The values are accessed as c_myKE for a scalar per-atom quantity or as +c_myStress[2] for a component of a vector per-atom quantity.
-Fixes can also generate per-atom values to output to dump -files. For example, the fix ave/atom command -calculates time-averages of compute quantities. As indicated in the -preceeding paragraph, a compute quantity can be a -calculated value such as energy or -stress or it can be a value calculated by -an atom-style variable, or it can be an atom -attribute such as velocity or force. +
Fixes can generate per-atom values to output to dump files. +For example, the fix ave/atom command calculates +time-averages of per-atom quantities, such as per-atom +computes and atom-style variables. These per-atom fix values are accessed by the dump custom -command as f_myKE for a scalar per-atom quantity or as f_myStress[2] -for a component of a vector per-atom quantity. +command via the same format as a compute's values, as f_myKE or +f_myStress[2].
+Variables can be defined in the input script. Only +atom-style variables can be used for dump custom output, since only +they produce per-atom values. A variable with the name "abc" is +referenced in a dump custom command as v_abc. +
+Just like equal-style variables, the formula associated with +atom-style variables can contain math operations and functions +(x+y,x*y,(),sqrt,exp,etc), atom values (x[N],fx[N],etc), group +functions (mass(),vcm(),etc), references to thermodynamic quantities +(temp,press,vol,etc), references to computes that +generate global values, references to fixes that generate +global values, or references to non atom-style variables that generate +global values. In addition, an atom-style variable can reference +vectors of atom values (x[],fx[],etc), computes +that generate per-atom values, fixes that generate per-atom +values, or other atom-style variables. Thus an atom-style variable is +the most general way to define some quantity to calculate and output +to a dump file. +
+Three other fixes are of particular note for output: fix ave/time, fix ave/spatial, and fix print.
The fix ave/time command enables time-averaging of -global quantities like temperature or pressure. The global quantities -are calculated by a compute or a fix. The -compute or fix must generate global scalar or vector quantities. Note -that this includes the "compute sum" command which computes global -values by summing per-atom quantities. The time-averaged values -generated by fix ave/time can be written directly -to a file and/or accessed by any output command that uses fixes as a -source of input, e.g. the thermo_style custom -command. Fix ave/time options allow for running cummulative averages -or moving time-windowed averages to be output. +any global quantity, like those output with thermodynamic info. The +user specifies one or more quantities to time average. These can be +global compute values, global fix values, or +variables of any style except the atom style which +produces per-atom values. Since a variable can refer to keywords used +by the thermo_style custom command (like temp or +press), any thermodynamic quantity can be time averaged in this way. +
+The fix ave/time command offers several options +for how it performs time averaging. The results it produces can be +used in two ways. First, they can be written directly to a file, one +line per timestamp. Note that the averaging parameters can be +specified in such a way that averaging is not done at all, in which +case this is simply a convenient means of outputting desired +quantities directly to a separate file. Like other fixes that produce +global quantities, the results of this fix can also be used as input +to any command that accesses global quantities, e.g. by the +thermo_style custom command, by a variable, etc.
The fix ave/spatial command enables -spatial-averaging of per-atom quantities like per-atom energy or -stress. The per-atom quantities can be atom density (mass or number) -or be calculated by a compute or a fix. The -compute or fix must generate per-atom scalar or vector quantities. -Note that if you use the fix ave/atom command with -fix ave/spatial, it means you are effectively calculating a time -average of a spatial average of a time-averaged per-atom quantity. -The time-averaged values generated by fix -ave/spatial can be written directly to a file -and/or accessed by any output command that uses fixes as a source of -input, e.g. the thermo_style custom command. Fix -ave/spatial options allow for running cummulative averages or moving -time-windowed averages to be output. +spatial-averaging of per-atom quantities like those output in dump +files, within 1d layers of the simulation box. The per-atom +quantities can be atom density (mass or number) or atom attributes +such as position, velocity, force. They can also be per-atom +quantities calculated by a compute, by a +fix, or by an atom-style variable. +
+The fix ave/spatial command offers several +options for how it performs time averaging. The per-layer values it +produces can be used in two ways. First, they can be written directly +to a file. Note that the averaging parameters can be specified in +such a way that time averaging is not done, in which case this is a +convenient means of simply outputting desired quanitities (summed over +atoms within a 1d layer) directly to a separate file. Like other +fixes that produce global quantities, the results of this fix can also +be used as input by any command that accesses global quantities, +e.g. by the thermo_style custom command, by a +variable, etc. See the doc page for fix +ave/spatial for a description of how these +values are indexed.
The fix print command can generate a line of output -written to the screen and log file periodically during a running -simulation. Since the line can contain one or more -variable quantities, this command is a means to output -desired calculated quantities that are not part of thermodynamic or -dump file output. +written to the screen and log file or to a separate file, periodically +during a running simulation. The line can contain one or more +variable values (for any style variable except the +atom style), and as explained above, variables themselves can contain +references to global values generated by thermodynamic +keywords, computes, +fixes, or other variables. Thus the fix +print command is a means to output any desired +calculated quantity separate from normal thermodynamic or dump file +output.
+This table summarizes the various output options, specifying what +their inputs and outputs are. The frequency with which they are +invoked and produce output is also listed. Basically, any two +commands can be hooked together so long as one produces output that +matches the input needs of the other. A "match" means that the +frequencies and global vs per-atom attributes are the same. +
+| Command | Input | Input Freq | Output | Output Freq |
| thermo_style custom | thermo keyword, global scalar/vector compute, global scalar/vector fix, equal variable | nthermo | screen, log | nthermo |
| dump custom | keyword, peratom scalar/vector compute, peratom scalar/vector fix, atom variable | dump freq | file | dump freq |
| global fixes | N/A | N/A | global scalar/vector | 1 or nevery |
| peratom fixes | N/A | N/A | peratom scalar/vector | 1 or nevery |
| fix ave/time | global scalar/vector fix, global scalar/vector compute, equal variable | nevery | global scalar/vector, file | nfreq |
| fix ave/spatial | peratom scalar/vector fix, peratom scalar/vector compute, atom vector, atom variable, density mass/number | nevery | global vector | nfreq, file |
| fix ave/atom | peratom scalar/vector compute, peratom scalar/vector fix, atom variable, atom vector | nevery | peratom scalar/vector | nfreq |
| fix print | any variable | nevery | screen, file | nevery |
| global computes | N/A | N/A | global scalar/vector | N/A |
| peratom computes | N/A | N/A | peratom scalar/vector | N/A |
| compute sum | peratom scalar/vector compute, peratom scalar/vector fix, atom variable | N/A | global scalar/vector | N/A |
| variable equal | thermo keywords, atom value vx[123], global scalar/vector compute, global scalar/vector fix, non-atom variable | N/A | global scalar | N/A |
| variable atom | thermo keywords, atom value vx[123], atom vector vx[], global scalar/vector compute, peratom scalar/vector compute, global scalar/vector fix, peratom scalar/vector fix, any variable | N/A | peratom scalar | N/A |
| any variable | N/A | screen, log | between runs | |
| run every | any variable | nevery | screen, log | nevery + |
Description:
Create a computation that will be performed on a group of atoms. +Quantities calculated by a compute are instantaneous values, meaning +they are calculated from information about atoms on the current +timestep or iteration. There are two kinds of computes, "global" +computes that calculate one or more values for the entire group of +atoms, and "per-atom" computes that calculate one or more values for +each atom in the group. The latter has the word "atom" in its style +name.
-In LAMMPS, a "compute" is used in several ways. There are two kinds -of computes, "global" computes that calculate one or more values for -the entire group of atoms, and "per-atom" computes that calculate one -or more values for each atom in the group. The latter has the word -"atom" in its style name. -
-The results of global computes can be output via the thermo_style
+ In LAMMPS, a "compute" can be used in several ways. The results of
+global computes can be output via the thermo_style
custom or fix ave/time command.
-Or the values can be referenced in a variable equal
-command. The results of computes that calculate a global temperature
-or pressure can be used by fixes that do thermostatting or
-barostatting and when atom velocities are created.
+Or the values can be referenced in a variable equal or
+variable atom command. The results of computes that
+calculate a global temperature or pressure can be used by fixes that
+do thermostatting or barostatting and when atom velocities are
+created.
The results of per-atom computes can be output via the dump
custom command or the fix
ave/spatial command. Or the per-atom values can
be time-averaged via the fix ave/atom command and
then output via the dump custom or fix
-ave/spatial commands. Note that the value of
-per-atom computes will be 0.0 for atoms not in the specified compute
-group.
+ave/spatial
See this howto section for a summary of -various LAMMPS output options. +various LAMMPS output options, many of which involve computes. +
+The ID of a compute can only contain alphanumeric characters and +underscores. +
+The results of computes that calculate global quantities can be either +"intensive" or "extensive" values. Intensive means the value is +independent of the number of atoms in the simulation, +e.g. temperature. Extensive means the value scales with the number of +atoms in the simulation, e.g. total rotational kinetic energy. +Thermodynamic output will normalize extensive +values depending on the "thermo_modify norm" setting. But if a +compute value is accessed in another way, e.g. by a +variable, you may need to know whether it is an +intensive or extensive value. See the doc page for individual +computes for further info.
LAMMPS creates its own global computes for thermodynamic output. Three computes are always created, named "thermo_temp", @@ -64,20 +83,20 @@ invoked in the input script: compute thermo_pressure all pressure thermo_temp compute thermo_pe all pe -
Additional computes are created if the thermo style requires it. See -the documentation for the thermo_style command. +
Additional computes for other quantities are created if the thermo +style requires it. See the documentation for the +thermo_style command.
-The dumping of atom snapshots and fixes that compute temperature or -pressure also create computes as required. These are discussed in the -documentation for the dump custom and specific -fix commands. +
Fixes that calculate temperature or pressure, i.e. for thermostatting +or barostatting, may also create computes. These are discussed in the +documentation for specific fix commands.
In all these cases, the default computes can be replaced by computes defined by the user in the input script, as described by the -thermo_modify, fix modify, and -dump commands. +thermo_modify and fix modify +commands.
-Properties of either a default of user-defined compute can be modified +
Properties of either a default or user-defined compute can be modified via the compute_modify command.
Computes can be deleted with the uncompute command. @@ -88,29 +107,25 @@ calculations accessed in the various ways described above.
Each compute style has its own doc page which describes its arguments and what it does. Here is an alphabetic list of compute styles -defined in LAMMPS: +available in LAMMPS:
-There are also additional compute styles submitted by users which are included in the LAMMPS distribution. The list of these with links to diff --git a/doc/compute.txt b/doc/compute.txt index e8dafd9d80..3d5694eef5 100644 --- a/doc/compute.txt +++ b/doc/compute.txt @@ -26,31 +26,50 @@ compute 3 all ke/atom :pre [Description:] Create a computation that will be performed on a group of atoms. +Quantities calculated by a compute are instantaneous values, meaning +they are calculated from information about atoms on the current +timestep or iteration. There are two kinds of computes, "global" +computes that calculate one or more values for the entire group of +atoms, and "per-atom" computes that calculate one or more values for +each atom in the group. The latter has the word "atom" in its style +name. -In LAMMPS, a "compute" is used in several ways. There are two kinds -of computes, "global" computes that calculate one or more values for -the entire group of atoms, and "per-atom" computes that calculate one -or more values for each atom in the group. The latter has the word -"atom" in its style name. - -The results of global computes can be output via the "thermo_style +In LAMMPS, a "compute" can be used in several ways. The results of +global computes can be output via the "thermo_style custom"_thermo_style.html or "fix ave/time"_fix_ave_time.html command. -Or the values can be referenced in a "variable equal"_variable.html -command. The results of computes that calculate a global temperature -or pressure can be used by fixes that do thermostatting or -barostatting and when atom velocities are created. +Or the values can be referenced in a "variable equal"_variable.html or +"variable atom"_variable.html command. The results of computes that +calculate a global temperature or pressure can be used by fixes that +do thermostatting or barostatting and when atom velocities are +created. The results of per-atom computes can be output via the "dump custom"_dump.html command or the "fix ave/spatial"_fix_ave_spatial.html command. Or the per-atom values can be time-averaged via the "fix ave/atom"_fix_ave_atom.html command and then output via the "dump custom"_dump.html or "fix -ave/spatial"_fix_ave_spatial.html commands. Note that the value of -per-atom computes will be 0.0 for atoms not in the specified compute -group. +ave/spatial"_fix_ave_spatial.html commands. Or the per-atom values +can be referenced in a "variable atom"_variable.html command. Note +that the value of per-atom computes will be 0.0 for atoms not in the +specified compute group. See this "howto section"_Section_howto.html#4_15 for a summary of -various LAMMPS output options. +various LAMMPS output options, many of which involve computes. + +The ID of a compute can only contain alphanumeric characters and +underscores. + +The results of computes that calculate global quantities can be either +"intensive" or "extensive" values. Intensive means the value is +independent of the number of atoms in the simulation, +e.g. temperature. Extensive means the value scales with the number of +atoms in the simulation, e.g. total rotational kinetic energy. +"Thermodynamic output"_thermo_style.html will normalize extensive +values depending on the "thermo_modify norm" setting. But if a +compute value is accessed in another way, e.g. by a +"variable"_variable.html, you may need to know whether it is an +intensive or extensive value. See the doc page for individual +computes for further info. LAMMPS creates its own global computes for thermodynamic output. Three computes are always created, named "thermo_temp", @@ -61,20 +80,20 @@ compute thermo_temp all temp compute thermo_pressure all pressure thermo_temp compute thermo_pe all pe :pre -Additional computes are created if the thermo style requires it. See -the documentation for the "thermo_style"_thermo_style.html command. +Additional computes for other quantities are created if the thermo +style requires it. See the documentation for the +"thermo_style"_thermo_style.html command. -The dumping of atom snapshots and fixes that compute temperature or -pressure also create computes as required. These are discussed in the -documentation for the "dump custom"_dump.html and specific -"fix"_fix.html commands. +Fixes that calculate temperature or pressure, i.e. for thermostatting +or barostatting, may also create computes. These are discussed in the +documentation for specific "fix"_fix.html commands. In all these cases, the default computes can be replaced by computes defined by the user in the input script, as described by the -"thermo_modify"_thermo_modify.html, "fix modify"_fix_modify.html, and -"dump"_dump.html commands. +"thermo_modify"_thermo_modify.html and "fix modify"_fix_modify.html +commands. -Properties of either a default of user-defined compute can be modified +Properties of either a default or user-defined compute can be modified via the "compute_modify"_compute_modify.html command. Computes can be deleted with the "uncompute"_uncompute.html command. @@ -85,29 +104,25 @@ calculations accessed in the various ways described above. Each compute style has its own doc page which describes its arguments and what it does. Here is an alphabetic list of compute styles -defined in LAMMPS: +available in LAMMPS: -"attribute/atom"_compute_attribute_atom.html - attribute (x,v,f,etc) of each atom "centro/atom"_compute_centro_atom.html - centro-symmetry parameter for each atom "coord/atom"_compute_coord_atom.html - coordination number for each atom "ke/atom"_compute_ke_atom.html - kinetic energy for each atom "pe"_compute_pe.html - potential energy -"pe"_compute_pe.html - potential energy for each atom +"pe/atom"_compute_pe_atom.html - potential energy for each atom "pressure"_compute_pressure.html - total pressure and pressure tensor "rotate/dipole"_compute_rotate_dipole.html - rotational energy of dipolar atoms "rotate/gran"_compute_rotate_gran.html - rotational energy of granular atoms "stress/atom"_compute_stress_atom.html - stress tensor for each atom "sum"_compute_sum.html - sum per-atom quantities to a global value -"sum/atom"_compute_sum_atom.html - sum per-atom quantities to per-atom values "temp"_compute_temp.html - temperature of group of atoms "temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles "temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity "temp/dipole"_compute_temp_dipole.html - temperature of point dipolar particles "temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity "temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component -"temp/region"_compute_temp_region.html - temperature of a region of atoms -"variable"_compute_variable.html - calculate a scalar value from a variable -"variable/atom"_compute_variable_atom.html - calculate a formula for each atom :ul +"temp/region"_compute_temp_region.html - temperature of a region of atoms :ul There are also additional compute styles submitted by users which are included in the LAMMPS distribution. The list of these with links to diff --git a/doc/compute_attribute_atom.html b/doc/compute_attribute_atom.html deleted file mode 100644 index 696df81070..0000000000 --- a/doc/compute_attribute_atom.html +++ /dev/null @@ -1,75 +0,0 @@ - -
Syntax: -
-compute ID group-ID attribute/atom style --
Examples: -
-compute 1 all attribute/atom vy -compute mine all attribute/atom xyz --
Description: -
-Define a computation that calculates (or simply stores) one or more -attributes for each atom in a group. This is useful for input to the -fix ave/spatial command to do spatial averaging -by layers or to the fix ave/atom command to -perform time-averaging of per-atom quantities. The attribute values -can also be output directly by the dump custom command, -but it has keywords that output these quantities without the need to -define an additional compute. -
-The value of the attribute will be 0.0 for atoms not in the specified -compute group. -
-The styles x, y, z, xu, yu, zu, vx, vy, vz, fx, -fy, and fz each store a single scalar value per atom. -
-The x, y, z keywords store atom coordinate in the appropriate -distance units (Angstroms, sigma, etc) and will always be -inside (or slightly outside) the simulation box. Use xu, yu, zu -if you want the coordinates "unwrapped" by the image flags for each -atom. Unwrapped means that if the atom has passed thru a periodic -boundary one or more times, the value is printed for what the -coordinate would be if it had not been wrapped back into the periodic -box. Note that using xu, yu, zu means that the coordinate -values may be far outside the simulation box. -
-Note that if you want to compute the time-averaged position of an atom -coordinate that could pass thru a periodic boundary (e.g. via the fix -ave/atom command), you probably want to use xu -instead of x. -
-The styles xyz, v, and f each store a vector of 3 quantities per -atom. -
-Note that the various commands that reference this compute use a -different syntax for accessing scalar versus vector values, e.g. c_ID -versus c_ID[2]. -
-Restrictions: none -
-Related commands: -
-fix ave/atom, fix -ave/spatial, dump custom -
-Default: none -
- diff --git a/doc/compute_attribute_atom.txt b/doc/compute_attribute_atom.txt deleted file mode 100644 index 63dfb68c31..0000000000 --- a/doc/compute_attribute_atom.txt +++ /dev/null @@ -1,70 +0,0 @@ -"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 - -compute attribute/atom command :h3 - -[Syntax:] - -compute ID group-ID attribute/atom style :pre - -ID, group-ID are documented in "compute"_compute.html command -attribute/atom = style name of this compute command -style = {x} or {y} or {z} or {xu} or {yu} or {zu} or {vx} or {vy} or {vz} or {fx} or {fy} or {fz} or {xyz} or {v} or {f} :ul - -[Examples:] - -compute 1 all attribute/atom vy -compute mine all attribute/atom xyz :pre - -[Description:] - -Define a computation that calculates (or simply stores) one or more -attributes for each atom in a group. This is useful for input to the -"fix ave/spatial"_fix_ave_spatial.html command to do spatial averaging -by layers or to the "fix ave/atom"_fix_ave_atom.html command to -perform time-averaging of per-atom quantities. The attribute values -can also be output directly by the "dump custom"_dump.html command, -but it has keywords that output these quantities without the need to -define an additional compute. - -The value of the attribute will be 0.0 for atoms not in the specified -compute group. - -The styles {x}, {y}, {z}, {xu}, {yu}, {zu}, {vx}, {vy}, {vz}, {fx}, -{fy}, and {fz} each store a single scalar value per atom. - -The {x}, {y}, {z} keywords store atom coordinate in the appropriate -distance "units"_units.html (Angstroms, sigma, etc) and will always be -inside (or slightly outside) the simulation box. Use {xu}, {yu}, {zu} -if you want the coordinates "unwrapped" by the image flags for each -atom. Unwrapped means that if the atom has passed thru a periodic -boundary one or more times, the value is printed for what the -coordinate would be if it had not been wrapped back into the periodic -box. Note that using {xu}, {yu}, {zu} means that the coordinate -values may be far outside the simulation box. - -Note that if you want to compute the time-averaged position of an atom -coordinate that could pass thru a periodic boundary (e.g. via the "fix -ave/atom"_fix_ave_atom.html command), you probably want to use {xu} -instead of {x}. - -The styles {xyz}, {v}, and {f} each store a vector of 3 quantities per -atom. - -Note that the various commands that reference this compute use a -different syntax for accessing scalar versus vector values, e.g. c_ID -versus c_ID\[2\]. - -[Restrictions:] none - -[Related commands:] - -"fix ave/atom"_fix_ave_atom.html, "fix -ave/spatial"_fix_ave_spatial.html, "dump custom"_dump.html - -[Default:] none diff --git a/doc/compute_pe.html b/doc/compute_pe.html index aa2e633bd9..e376558284 100644 --- a/doc/compute_pe.html +++ b/doc/compute_pe.html @@ -54,6 +54,11 @@ LAMMPS starts up, as if this command were in the input script:See the "thermo_style" command for more details.
+Output info: +
+The scalar value calculated by this compute is "extensive", meaning it +it scales with the number of atoms in the simulation. +
Restrictions: none
Related commands: diff --git a/doc/compute_pe.txt b/doc/compute_pe.txt index a696e67f25..7171e3a24c 100644 --- a/doc/compute_pe.txt +++ b/doc/compute_pe.txt @@ -51,6 +51,11 @@ compute thermo_pe all pe :pre See the "thermo_style" command for more details. +[Output info:] + +The scalar value calculated by this compute is "extensive", meaning it +it scales with the number of atoms in the simulation. + [Restrictions:] none [Related commands:] diff --git a/doc/compute_pressure.html b/doc/compute_pressure.html index 7676a41c6d..7db520ed72 100644 --- a/doc/compute_pressure.html +++ b/doc/compute_pressure.html @@ -82,6 +82,13 @@ when LAMMPS starts up, as if this command were in the input script:
where "thermo_temp" is the ID of a similarly defined compute of style "temp". See the "thermo_style" command for more details.
+Output info: +
+The scalar value calculated by this compute is "intensive", meaning it +is independent of the number of atoms in the simulation. The vector +values are "extensive", meaning they scale with the number of atoms in +the simulation. +
Restrictions: none
Related commands: diff --git a/doc/compute_pressure.txt b/doc/compute_pressure.txt index 0a777d9675..2f7c4f2977 100644 --- a/doc/compute_pressure.txt +++ b/doc/compute_pressure.txt @@ -79,6 +79,13 @@ compute thermo_pressure all pressure thermo_temp :pre where "thermo_temp" is the ID of a similarly defined compute of style "temp". See the "thermo_style" command for more details. +[Output info:] + +The scalar value calculated by this compute is "intensive", meaning it +is independent of the number of atoms in the simulation. The vector +values are "extensive", meaning they scale with the number of atoms in +the simulation. + [Restrictions:] none [Related commands:] diff --git a/doc/compute_rotate_dipole.html b/doc/compute_rotate_dipole.html index 77790d6b4f..b26349bfc0 100644 --- a/doc/compute_rotate_dipole.html +++ b/doc/compute_rotate_dipole.html @@ -31,6 +31,11 @@ group of atoms with point dipole moments. the atoms in the group, where I is the moment of inertia of a disk/spherical (2d/3d) particle, and w is its angular velocity.
+Output info: +
+The scalar value calculated by this compute is "extensive", meaning it +it scales with the number of atoms in the simulation. +
Restrictions: none
Related commands: none diff --git a/doc/compute_rotate_dipole.txt b/doc/compute_rotate_dipole.txt index 49fb8d9a63..3f07cec8c3 100644 --- a/doc/compute_rotate_dipole.txt +++ b/doc/compute_rotate_dipole.txt @@ -28,6 +28,11 @@ The rotational energy is calculated as the sum of 1/2 I w^2 over all the atoms in the group, where I is the moment of inertia of a disk/spherical (2d/3d) particle, and w is its angular velocity. +[Output info:] + +The scalar value calculated by this compute is "extensive", meaning it +it scales with the number of atoms in the simulation. + [Restrictions:] none [Related commands:] none diff --git a/doc/compute_rotate_gran.html b/doc/compute_rotate_gran.html index 15c0c3e2cf..6cf36c523c 100644 --- a/doc/compute_rotate_gran.html +++ b/doc/compute_rotate_gran.html @@ -31,6 +31,11 @@ group of granular atoms. the atoms in the group, where I is the moment of inertia of a disk/spherical (2d/3d) particle, and w is its angular velocity.
+Output info: +
+The scalar value calculated by this compute is "extensive", meaning it +it scales with the number of atoms in the simulation. +
Restrictions: none
Related commands: none diff --git a/doc/compute_rotate_gran.txt b/doc/compute_rotate_gran.txt index 7c20ecda89..ddb7e7408b 100644 --- a/doc/compute_rotate_gran.txt +++ b/doc/compute_rotate_gran.txt @@ -28,6 +28,11 @@ The rotational energy is calculated as the sum of 1/2 I w^2 over all the atoms in the group, where I is the moment of inertia of a disk/spherical (2d/3d) particle, and w is its angular velocity. +[Output info:] + +The scalar value calculated by this compute is "extensive", meaning it +it scales with the number of atoms in the simulation. + [Restrictions:] none [Related commands:] none diff --git a/doc/compute_sum.html b/doc/compute_sum.html index a9f3b8fd31..cb0d2c572f 100644 --- a/doc/compute_sum.html +++ b/doc/compute_sum.html @@ -13,45 +13,85 @@
Syntax:
-compute ID group-ID sum compute-ID1 compute-ID2 ... +compute ID group-ID sum value1 value2 ...-
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component) + c_ID = per-atom scalar value calculated by a compute with ID + c_ID[N] = Nth component of per-atom vector calculated by a compute with ID + f_ID = per-atom scalar value calculated by a fix with ID + f_ID[N] = Nth component of per-atom vector calculated by a fix with ID + v_name = per-atom value calculated by an atom-style variable with name ++
Examples:
compute 1 all sum c_force -compute 1 all sum atomKE atomEpair atomEbond +compute 2 all sum c_press2 f_ave v_myKE
Description:
-Define a computation that sums the results of one or more per-atom
-computes across all atoms in the group to yield a global scalar or
-vector quantity. For example, the forces on a group of atoms could be
-summed to yield a net force on the group. The resulting value(s) can
-be accessed by any command that uses global computes, e.g. the thermo
+ Define a calculation that sums the results of one or more per-atom
+quantities across all atoms in the group to yield a global scalar or
+vector quantity. The resulting value(s) can be accessed by any
+command that uses global computes, e.g. the thermo
custom command or fix ave/time
-command or by a variable command.
+command or by a variable command. See this
+section of the documentation for an overview
+of output options.
Unlike the compute sum/atom command, the
-result of this is not a per-atom quantity, but a global scalar or
-vector. If the other computes each generate a scalar value per atom,
-this compute will generate a single scalar value. If the other
-computes each generate a vector of values per atom, this compute will
-generate a vector of values where each value is the sum across atoms
-of the corresponding value produced by the other computes. In the
-latter case, all the other computes must generate per-atom vectors of
-the same size.
+ Each listed value is summed independently. The group specified with
+the command means only atoms within the group contribute to the sum.
+Note that the value that produces the per-atom quantities may define
+its own group which affects the values it returns. For example, if a
+per-atom compute is used as a value, it will generate values of 0.0
+for atoms that are not in the group specified for that compute.
Note that all per-atom computes generate values of 0.0 for atoms that
-are not in the group specified for that compute.
+ Each listed value can be an atom attribute (position, velocity, force
+component) or can be the result of a compute or
+fix or the evaluation of an atom-style
+variable. In the latter cases, the compute, fix, or
+variable must produce a per-atom quantity, not a global quantity.
+ Computes that produce per-atom quantities are those
+which have the word atom in their style name. Currently the only
+fix that produces per-atom quantities is the fix
+ave/atom command. Variables of
+style atom are the only ones that can be used with this compute
+since all other variable stylse produce global quantities.
+ If a single value is specified this compute produces a global scalar
+value. If multiple values are specified, this compute produces a
+vector of global values, the length of which is equal to the
+number of values specified.
+ The value(s) produced by this compute are all "extensive", meaning
+their value scales linearly with the number of atoms involved. If
+normalized values are desired, this compute can be accessed by the
+thermo_style custom command with thermo_modify
+norm yes set as an option. Or it can be accessed
+by a variable that divides by the appropriate atom
+count.
+ Output info:
+ The scalar and vector values calculated by this compute are
+"extensive", meaning they scale with the number of atoms in the
+simulation.
Restrictions: none
Related commands:
Default: none
Syntax:
- Examples:
- Description:
- Define a computation that sums the results of two or more other
-computes for each atom in a group. This is useful for summing atom
-properties such as pairwise energy, bond energy, kinetic energy, etc.
-The resulting values can be accessed by any command that uses per-atom
-computes, e.g. the dump custom command or fix
-ave/spatial command or fix
-ave/atom command.
- The value of the sum will be 0.0 for atoms not in the specified
-compute group.
- The result of this compute depends on the results generated by the
-other computes that it invokes. E.g. if the other computes each
-generate a scalar value per atom, so will this compute. If the other
-computes each generate a vector of values per atom, so will this
-compute. In the latter case, all the other computes must generate
-per-atom vectors of the same size.
- Restrictions: none
- Related commands:
- Default: none
- See the "thermo_style" command for more details.
Output info:
+ The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+ Restrictions: none
Related commands:
diff --git a/doc/compute_temp.txt b/doc/compute_temp.txt
index a21c85cc4f..6696bcf5c8 100644
--- a/doc/compute_temp.txt
+++ b/doc/compute_temp.txt
@@ -55,6 +55,13 @@ compute thermo_temp all temp :pre
See the "thermo_style" command for more details.
+[Output info:]
+
+The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+
[Restrictions:] none
[Related commands:]
diff --git a/doc/compute_temp_asphere.html b/doc/compute_temp_asphere.html
index d9bb8b230e..53d1a79004 100644
--- a/doc/compute_temp_asphere.html
+++ b/doc/compute_temp_asphere.html
@@ -33,6 +33,13 @@ moments of inertia are unequal. The associated kinetic energy thus
includes a rotational term KE_rotational = 1/2 I w^2, where I is the
moment of inertia and w is the angular velocity.
Output info:
+ The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+ Restrictions:
Can only be used if LAMMPS was built with the "asphere" package.
diff --git a/doc/compute_temp_asphere.txt b/doc/compute_temp_asphere.txt
index 9f71fcf426..bb4b4569ad 100755
--- a/doc/compute_temp_asphere.txt
+++ b/doc/compute_temp_asphere.txt
@@ -30,6 +30,13 @@ moments of inertia are unequal. The associated kinetic energy thus
includes a rotational term KE_rotational = 1/2 I w^2, where I is the
moment of inertia and w is the angular velocity.
+[Output info:]
+
+The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+
[Restrictions:]
Can only be used if LAMMPS was built with the "asphere" package.
diff --git a/doc/compute_temp_deform.html b/doc/compute_temp_deform.html
index 8a4db7b8de..ea3cb06f17 100644
--- a/doc/compute_temp_deform.html
+++ b/doc/compute_temp_deform.html
@@ -76,6 +76,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
extra option of the compute_modify command.
Output info:
+ The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+ Restrictions: none
Related commands:
diff --git a/doc/compute_temp_deform.txt b/doc/compute_temp_deform.txt
index ce302bb602..0d427964d3 100644
--- a/doc/compute_temp_deform.txt
+++ b/doc/compute_temp_deform.txt
@@ -73,6 +73,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command.
+[Output info:]
+
+The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+
[Restrictions:] none
[Related commands:]
diff --git a/doc/compute_temp_dipole.html b/doc/compute_temp_dipole.html
index bbdc93dba6..5579838c60 100644
--- a/doc/compute_temp_dipole.html
+++ b/doc/compute_temp_dipole.html
@@ -33,6 +33,13 @@ particles. The associated kinetic energy includes a rotational term
KE_rotational = 1/2 I w^2, where I is the moment of inertia and w is
the angular velocity.
Output info:
+ The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+ Restrictions:
Can only be used if LAMMPS was built with the "dipole" package.
diff --git a/doc/compute_temp_dipole.txt b/doc/compute_temp_dipole.txt
index 28d23d6968..dd7305b4ac 100755
--- a/doc/compute_temp_dipole.txt
+++ b/doc/compute_temp_dipole.txt
@@ -30,6 +30,13 @@ particles. The associated kinetic energy includes a rotational term
KE_rotational = 1/2 I w^2, where I is the moment of inertia and w is
the angular velocity.
+[Output info:]
+
+The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+
[Restrictions:]
Can only be used if LAMMPS was built with the "dipole" package.
diff --git a/doc/compute_temp_partial.html b/doc/compute_temp_partial.html
index 12b5c0aaaf..c646e9a122 100644
--- a/doc/compute_temp_partial.html
+++ b/doc/compute_temp_partial.html
@@ -55,6 +55,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
extra option of the compute_modify command.
Output info:
+ The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+ Restrictions: none
Related commands:
diff --git a/doc/compute_temp_partial.txt b/doc/compute_temp_partial.txt
index 273acad20e..a6918e250d 100644
--- a/doc/compute_temp_partial.txt
+++ b/doc/compute_temp_partial.txt
@@ -52,6 +52,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command.
+[Output info:]
+
+The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+
[Restrictions:] none
[Related commands:]
diff --git a/doc/compute_temp_ramp.html b/doc/compute_temp_ramp.html
index d684bb5249..0e821c0808 100644
--- a/doc/compute_temp_ramp.html
+++ b/doc/compute_temp_ramp.html
@@ -67,6 +67,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
extra option of the compute_modify command.
Output info:
+ The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+ Restrictions: none
Related commands:
diff --git a/doc/compute_temp_ramp.txt b/doc/compute_temp_ramp.txt
index 2ba575201e..d4d371c418 100644
--- a/doc/compute_temp_ramp.txt
+++ b/doc/compute_temp_ramp.txt
@@ -63,6 +63,13 @@ atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the
{extra} option of the "compute_modify"_compute_modify.html command.
+[Output info:]
+
+The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+
[Restrictions:] none
[Related commands:]
diff --git a/doc/compute_temp_region.html b/doc/compute_temp_region.html
index 88bcd60d9b..14633cbbee 100644
--- a/doc/compute_temp_region.html
+++ b/doc/compute_temp_region.html
@@ -64,6 +64,13 @@ constrain molecular motion, such as fix shake and
degrees-of-freedom can be altered using the extra option of the
compute_modify command.
Output info:
+ The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+ Restrictions: none
Related commands:
diff --git a/doc/compute_temp_region.txt b/doc/compute_temp_region.txt
index 738fc98fba..b61c70f6cf 100644
--- a/doc/compute_temp_region.txt
+++ b/doc/compute_temp_region.txt
@@ -61,6 +61,13 @@ constrain molecular motion, such as "fix shake"_fix_shake.html and
degrees-of-freedom can be altered using the {extra} option of the
"compute_modify"_compute_modify.html command.
+[Output info:]
+
+The scalar value calculated by this compute is "intensive", meaning it
+is independent of the number of atoms in the simulation. The vector
+values are "extensive", meaning they scale with the number of atoms in
+the simulation.
+
[Restrictions:] none
[Related commands:]
diff --git a/doc/compute_variable.html b/doc/compute_variable.html
deleted file mode 100644
index 56b9ec01b2..0000000000
--- a/doc/compute_variable.html
+++ /dev/null
@@ -1,55 +0,0 @@
-
- Syntax:
- Examples:
- Description:
- Define a computation that calculates a formula that returns a scalar
-quantity. This quantity can be time averaged and output via the fix
-ave/time command. It could also be output via the
-thermo_style custom command, although it makes
-more sense to access the variable directly in this case.
- The formula is defined by the variable equal command.
-A variable of style equal can access properties of the system, such
-as volume or temperature, and also reference individual atom
-attributes, such as its coordinates or velocity.
- For example, these 3 commands would time average the system density
-(assuming the volume fluctuates) temperature and output the average
-value periodically to the file den.profile:
- Restrictions: none
- Related commands:
- Default: none
- Syntax:
- Examples:
- Description:
- Define a computation that calculates a formula for each atom in the
-group. The resulting values can be accessed by any command that uses
-per-atom computes, e.g. the dump custom command or fix
-ave/spatial command or fix
-ave/atom command.
- The value of the variable evaluation will be 0.0 for atoms not in the
-specified compute group.
- The formula is defined by the variable atom command.
-A variable of style atom can access properties of the system, such
-as volume or temperature, and also reference individual atom
-attributes, such as its coordinates or velocity.
- For example, these 3 commands would compute the xy kinectic energy of
-atoms in the flow group and include the values in dumped snapshots of
-the system.
- If the dump line were replaced by
- then the xy kinetic energy values would be averaged by z layer and the
-layer averages written periodically to the file ke.profile.
- Restrictions: none
- Related commands:
- dump custom, fix ave/spatial
- Default: none
-
-
-compute sum/atom command
-
-compute ID group-ID sum/atom compute-ID1 compute-ID2 ...
-
-
-compute 1 all sum/atom atomKE atomEpair atomEbond
-
-
-
-compute variable command
-
-compute ID group-ID variable name
-
-
-compute 1 all variable myTemp
-
-variable den equal div(atoms,vol)
-compute density all variable den
-fix 1 all ave/time 1 1000 density 0 den.profile
-
-
-
-compute variable/atom command
-
-compute ID group-ID variable/atom name
-
-
-compute 1 flow variable/atom myVar
-
-variable xy atom mult(0.5,add(mult(vx[],vx[]),mult(vy[],vy[])))
-compute ke flow variable/atom xy
-dump 1 flow custom 1000 dump.flow tag type x y z c_ke
-
-fix 1 flow ave/spatial 100 1000 z lower 2.0 ke.profile compute ke
-
-
Note that because periodic boundary conditions are enforced only on -timesteps when neighbor lists are rebuilt, the coordinates of an atom -written to a dump file may be slightly outside the simulation box. +
IMPORTANT NOTE: Vecause periodic boundary conditions are enforced only +on timesteps when neighbor lists are rebuilt, the coordinates of an +atom written to a dump file may be slightly outside the simulation +box.
-Also note that when LAMMPS is running in parallel, the atom -information written to dump files (typically one line per atom) may be -written in an indeterminate order. This is because data for a single -snapshot is collected from multiple processors. This is always the -case for the atom, bond, and custom styles. It is also the case -for the xyz style if the dump group is not all. It is not the -case for the dcd and xtc styles which always write atoms in sorted -order. So does the xyz style if the dump group is all. +
When LAMMPS is running in parallel, the atom information written to +dump files (typically one line per atom) may be written in an +indeterminate order. This is because data for a single snapshot is +collected from multiple processors. This is always the case for the +atom, bond, and custom styles. It is also the case for the +xyz style if the dump group is not all. It is not the case for +the dcd and xtc styles which always write atoms in sorted order. +So does the xyz style if the dump group is all.
Note that computes which calculate global scalar and vector quantities, as opposed to per-atom quantities, cannot be output in a @@ -251,8 +252,8 @@ custom command.
If c_ID is used as a keyword, then the scalar per-atom quantity calculated by the compute is printed. If c_ID[N] is used, then N -in the range from 1-M will print the Nth component of the M-length -per-atom vector calculated by the compute. +must be in the range from 1-M, which will print the Nth component of +the M-length per-atom vector calculated by the compute.
The f_ID and f_ID[N] keywords allow scalar or vector per-atom quantities calculated by a fix to be output. The ID in the @@ -265,22 +266,22 @@ produced by any compute, fix be written to a dump file.
If f_ID is used as a keyword, then the scalar per-atom quantity -calculated by the fix is printed. If f_ID[N] is used, then N -in the range from 1-M will print the Nth component of the M-length -per-atom vector calculated by the fix. +calculated by the fix is printed. If f_ID[N] is used, then N must +be in the range from 1-M, which will print the Nth component of the +M-length per-atom vector calculated by the fix.
The v_name keyword allows per-atom quantities calculated by a variable to be output. The name in the keyword should be replaced by the actual name of the variable that has been defined previously in the input script. Only an atom-style variable can be -referenced, since it is the only one that generates per-atom values. +referenced, since it is the only style that generates per-atom values. Variables of style atom can reference individual atom attributes, per-atom atom attributes, thermodynamic keywords, or invoke other computes, fixes, or variables when they are evaluated, so this is a -very general means of generating quantities to output to a dump file. +very general means of creating quantities to output to a dump file.
See this section of the manual for information -on how to add new compute and fix styles to LAMMPS that calculate +on how to add new compute and fix styles to LAMMPS to calculate per-atom quantities which could then be output into dump files.
Each fix style has its own documentation page which describes its -arguments and what it does, as listed below. -
Fixes perform their operations at different stages of the timestep. -If 2 or more fixes both operate at the same stage of the timestep, -they are invoked in the order they were specified in the input script. +If 2 or more fixes operate at the same stage of the timestep, they are +invoked in the order they were specified in the input script.
-Fixes can be deleted with the unfix command. Note that -this is the only way to turn off a fix; simply specifying a new fix -with a similar style will not turn off the first one. For example, -using a fix nve command for a second run after using a -fix nvt command for the first run, will not cancel out -the NVT time integration invoked by the "fix nvt" command. Thus two -time integrators would be in place! +
The ID of a fix can only contain alphanumeric characters and +underscores. +
+Fixes can be deleted with the unfix command. +
+IMPORTANT NOTE: The unfix command is the only way to turn +off a fix; simply specifying a new fix with a similar style will not +turn off the first one. This is especially important to realize for +integration fixes. For example, using a fix nve +command for a second run after using a fix nvt command +for the first run, will not cancel out the NVT time integration +invoked by the "fix nvt" command. Thus two time integrators would be +in place!
If you specify a new fix with the same ID and style as an existing fix, the old fix is deleted and the new one is created (presumably @@ -64,12 +67,29 @@ made to the old fix via the fix_modify command. fixes to be reset. See the doc page for individual fixes for details.
Some fixes calculate a global scalar or vector quantity which can be -accessed by various output commands, including -variables, thermo_style custom, -and fix ave/time. See this howto -section for a summary of various LAMMPS -output options. See the doc pages for individual fixes for info on -which ones calculate these quantities. +accessed by various commands for output, including equal- and +atom-style variables, thermo_style +custom, and fix ave/time. +
+Some fixes calculate a per-atom scalar or vector quantity which can be +accessed by various commands for output, including atom-style +variables, dump_style custom, and fix +ave/spatial. +
+The results of fixes that calculate global quantities can be either +"intensive" or "extensive" values. Intensive means the value is +independent of the number of atoms in the simulation, e.g. timestep +size. Extensive means the value scales with the number of atoms in +the simulation, e.g. total force applied by the fix. Thermodynamic +output will normalize extensive values depending on +the "thermo_modify norm" setting. But if a fix value is accessed in +another way, e.g. by a variable, you may need to know +whether it is an intensive or extensive value. See the doc page for +individual fixes for further info. +
+See this howto section for a summary of +various LAMMPS output options. See the doc pages for individual fixes +for info on which ones calculate these quantities.
Some fixes store an internal "state" which is written to binary restart files via the restart or @@ -79,7 +99,9 @@ continue on with its calculations in a restarted simulation. See the a fix in an input script that reads a restart file. See the doc pages for individual fixes for info on which ones can be restarted.
-Here is an alphabetic list of fix styles available in LAMMPS: +
Each fix style has its own documentation page which describes its +arguments and what it does, as listed below. Here is an alphabetic +list of fix styles available in LAMMPS:
Syntax:
-fix ID group-ID ave/atom Nevery Nrepeat Nfreq compute-ID +fix ID group-ID ave/atom Nevery Nrepeat Nfreq value1 value2 ...-
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component) + c_ID = per-atom scalar value calculated by a compute with ID + c_ID[N] = Nth component of per-atom vector calculated by a compute with ID + f_ID = per-atom scalar value calculated by a fix with ID + f_ID[N] = Nth component of per-atom vector calculated by a fix with ID + v_name = per-atom value calculated by an atom-style variable with name ++
Examples:
-fix 1 all ave/atom 1 100 100 myVx -fix 1 all ave/atom 10 20 1000 my_epair +fix 1 all ave/atom 1 100 100 vx vy vz +fix 1 all ave/atom 10 20 1000 c_my_stress1Description:
-Calculate one or more time-averaged per-atom quantities every few -timesteps. The results of this calculation can be spatially averaged -via the fix ave/spatial command or output -to a file via the dump custom command. +
Calculate one or more instantaneous per-atom quantities every few +timesteps, and average them over longer timescales. The resulting +per-atom averages can be used by other output +commands such as the fix +ave/spatial or dump custom commands.
-The compute-ID specifies a compute which calculates -the desired property. It must be a per-atom compute (one with the -word "atom" in its style name) that calculates one or more values for -each atom, as opposed to a global compute. The compute must be -previously defined in the input script. Users can also write code for -their own compute styles and add them to LAMMPS. +
Each listed value is averaged independently. The group specified with +the command means only atoms within the group have their averages +computed. Atoms not in the group have their result set to 0.0.
-The Nevery, Nrepeat, and Nfreq arguments specify how the -property will be time-averaged. The final averaged value(s) are -computed every Nfreq timesteps. The average is over Nrepeat -values, computed in the preceeding portion of the simulation every -Nevery timesteps. Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then -values on timesteps 90,92,94,96,98,100 will be used to compute the -final average at timestep 100. Similary for timesteps -190,192,194,196,198,200 at timestep 200, etc. +
Each listed value can be an atom attribute (position, velocity, force +component) or can be the result of a compute or +fix or the evaluation of an atom-style +variable. In the latter cases, the compute, fix, or +variable must produce a per-atom quantity, not a global quantity. If +you wish to time-average global quantities from a compute, fix, or +variable, then see the fix ave/time command.
-If this fix is referenced by a dump custom or fix -ave/spatial command, the time-averaged values -can only be accessed every Nfreq timesteps. +
Computes that produce per-atom quantities are those +which have the word atom in their style name. Currently the only +fix that produces per-atom quantities is this fix itself, namely fix +ave/atom. Thus this fix could be used to produce output that would be +the input for another fix ave/atom command, though that would be a +strange mode of use. Variables of style atom are +the only ones that can be used with this fix since all other styles of +variable produce global quantities.
-If the compute calculates a single or multiple values per atom, then -fix ave/atom will also calculate one or multiple time-averaged -quantities per atom. This makes a difference in how the quantities -are referenced in a dump custom command, e.g. c_ID versus -c_ID[2]. +
+ +The Nevery, Nrepeat, and Nfreq arguments specify on what +timesteps the values will be generated in order to contribute to the +average. The final averaged quantities are generated every Nfreq +timesteps. The average is over Nrepeat quantities, computed in the +preceeding portion of the simulation every Nevery timesteps. +Nfreq must be a multiple of Nevery and Nevery must be non-zero +even if Nrepeat is 1. +
+For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on +timesteps 90,92,94,96,98,100 will be used to compute the final average +on timestep 100. Similary for timesteps 190,192,194,196,198,200 on +timestep 200, etc. +
+
+ +The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are +self-explanatory. +
+If a value begins with "c_", a compute ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the compute is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the compute is used. Users can also write code for their own +compute styles and add them to LAMMPS. +
+If a value begins with "f_", a fix ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the fix is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the fix is used. Note that some fixes only produce their values on +certain timesteps, which must be compatible with Nevery, else an +error will results. Users can also write code for their own fix +styles and add them to LAMMPS. +
+If a value begins with "v_", a variable name must follow which has +been previously defined in the input script. Variables of style +atom can reference thermodynamic keywords, or invoke other computes, +fixes, or variables when they are evaluated, so this is a very general +means of generating per-atom quantities to time average.
Restart, fix_modify, output, run start/stop, minimize info:
@@ -68,10 +122,12 @@ are relevant to this fix. No global scalar or vector quantities are stored by this fix for access by various output commands. -This fix computes a scalar per-atom quantity or a vector of per-atom -quantities which can be accessed by the dump custom or -fix ave/spatial commands, as discussed in this -section. +
This fix produces a per-atom scalar or vector which can be accessed by +various output commands. A scalar is +produced if only a single quantity is averaged by this fix. If two or +more quantities are averaged, then a vector of values is produced. +The per-atom values can only be accessed on timesteps that are +multiples of Nfreq since that is when averaging is performed.
No parameter of this fix can be used with the start/stop keywords of the run command. This fix is not invoked during energy diff --git a/doc/fix_ave_atom.txt b/doc/fix_ave_atom.txt index 7aa48ed190..4fe0f939aa 100644 --- a/doc/fix_ave_atom.txt +++ b/doc/fix_ave_atom.txt @@ -10,52 +10,98 @@ fix ave/atom command :h3 [Syntax:] -fix ID group-ID ave/atom Nevery Nrepeat Nfreq compute-ID :pre +fix ID group-ID ave/atom Nevery Nrepeat Nfreq value1 value2 ... :pre -ID, group-ID are documented in "fix"_fix.html command -ave/atom = style name of this fix command -Nevery = calculate property every this many timesteps -Nrepeat = # of times to repeat the Nevery calculation before averaging -Nfreq = timestep frequency at which the average value is calculated -compute-ID = ID of per-atom compute that performs the calculation :ul +ID, group-ID are documented in "fix"_fix.html command :ulb,l +ave/atom = style name of this fix command :l +Nevery = calculate property every this many timesteps :l +Nrepeat = # of times to repeat the Nevery calculation before averaging :l +Nfreq = timestep frequency at which the average value is calculated :l +one or more values can be listed :l +value = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l + x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component) + c_ID = per-atom scalar value calculated by a compute with ID + c_ID\[N\] = Nth component of per-atom vector calculated by a compute with ID + f_ID = per-atom scalar value calculated by a fix with ID + f_ID\[N\] = Nth component of per-atom vector calculated by a fix with ID + v_name = per-atom value calculated by an atom-style variable with name :pre +:ule [Examples:] -fix 1 all ave/atom 1 100 100 myVx -fix 1 all ave/atom 10 20 1000 my_epair :pre +fix 1 all ave/atom 1 100 100 vx vy vz +fix 1 all ave/atom 10 20 1000 c_my_stress[1] :pre [Description:] -Calculate one or more time-averaged per-atom quantities every few -timesteps. The results of this calculation can be spatially averaged -via the "fix ave/spatial"_fix_ave_spatial.html command or output -to a file via the "dump custom"_dump.html command. +Calculate one or more instantaneous per-atom quantities every few +timesteps, and average them over longer timescales. The resulting +per-atom averages can be used by other "output +commands"_Section_howto.html#4_15 such as the "fix +ave/spatial"_fix_ave_spatial.html or "dump custom"_dump.html commands. -The {compute-ID} specifies a "compute"_compute.html which calculates -the desired property. It must be a per-atom compute (one with the -word "atom" in its style name) that calculates one or more values for -each atom, as opposed to a global compute. The compute must be -previously defined in the input script. Users can also write code for -their own compute styles and "add them to LAMMPS"_Section_modify.html. +Each listed value is averaged independently. The group specified with +the command means only atoms within the group have their averages +computed. Atoms not in the group have their result set to 0.0. -The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify how the -property will be time-averaged. The final averaged value(s) are -computed every {Nfreq} timesteps. The average is over {Nrepeat} -values, computed in the preceeding portion of the simulation every -{Nevery} timesteps. Thus if Nevery=2, Nrepeat=6, and Nfreq=100, then -values on timesteps 90,92,94,96,98,100 will be used to compute the -final average at timestep 100. Similary for timesteps -190,192,194,196,198,200 at timestep 200, etc. +Each listed value can be an atom attribute (position, velocity, force +component) or can be the result of a "compute"_compute.html or +"fix"_fix.html or the evaluation of an atom-style +"variable"_variable.html. In the latter cases, the compute, fix, or +variable must produce a per-atom quantity, not a global quantity. If +you wish to time-average global quantities from a compute, fix, or +variable, then see the "fix ave/time"_fix_ave_time.html command. -If this fix is referenced by a "dump custom"_dump.html or "fix -ave/spatial"_fix_ave_spatial.html command, the time-averaged values -can only be accessed every {Nfreq} timesteps. +"Computes"_compute.html that produce per-atom quantities are those +which have the word {atom} in their style name. Currently the only +fix that produces per-atom quantities is this fix itself, namely fix +ave/atom. Thus this fix could be used to produce output that would be +the input for another fix ave/atom command, though that would be a +strange mode of use. "Variables"_variable.html of style {atom} are +the only ones that can be used with this fix since all other styles of +variable produce global quantities. -If the compute calculates a single or multiple values per atom, then -fix ave/atom will also calculate one or multiple time-averaged -quantities per atom. This makes a difference in how the quantities -are referenced in a "dump custom"_dump.html command, e.g. c_ID versus -c_ID\[2\]. +:line + +The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what +timesteps the values will be generated in order to contribute to the +average. The final averaged quantities are generated every {Nfreq} +timesteps. The average is over {Nrepeat} quantities, computed in the +preceeding portion of the simulation every {Nevery} timesteps. +{Nfreq} must be a multiple of {Nevery} and {Nevery} must be non-zero +even if {Nrepeat} is 1. + +For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on +timesteps 90,92,94,96,98,100 will be used to compute the final average +on timestep 100. Similary for timesteps 190,192,194,196,198,200 on +timestep 200, etc. + +:line + +The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are +self-explanatory. + +If a value begins with "c_", a compute ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the compute is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the compute is used. Users can also write code for their own +compute styles and "add them to LAMMPS"_Section_modify.html. + +If a value begins with "f_", a fix ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the fix is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the fix is used. Note that some fixes only produce their values on +certain timesteps, which must be compatible with {Nevery}, else an +error will results. Users can also write code for their own fix +styles and "add them to LAMMPS"_Section_modify.html. + +If a value begins with "v_", a variable name must follow which has +been previously defined in the input script. Variables of style +{atom} can reference thermodynamic keywords, or invoke other computes, +fixes, or variables when they are evaluated, so this is a very general +means of generating per-atom quantities to time average. [Restart, fix_modify, output, run start/stop, minimize info:] @@ -65,10 +111,12 @@ are relevant to this fix. No global scalar or vector quantities are stored by this fix for access by various "output commands"_Section_howto.html#4_15. -This fix computes a scalar per-atom quantity or a vector of per-atom -quantities which can be accessed by the "dump custom"_dump.html or -"fix ave/spatial"_fix_ave_spatial.html commands, as discussed in "this -section"_Section_howto.html#4_15. +This fix produces a per-atom scalar or vector which can be accessed by +various "output commands"_Section_howto.html#4_15. A scalar is +produced if only a single quantity is averaged by this fix. If two or +more quantities are averaged, then a vector of values is produced. +The per-atom values can only be accessed on timesteps that are +multiples of {Nfreq} since that is when averaging is performed. 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 diff --git a/doc/fix_ave_spatial.html b/doc/fix_ave_spatial.html index 8848315c53..fd9587cda3 100644 --- a/doc/fix_ave_spatial.html +++ b/doc/fix_ave_spatial.html @@ -13,7 +13,7 @@
-Syntax:
-fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta style arg keyword args ... +fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta value1 value2 ... keyword args ...
- ID, group-ID are documented in fix command @@ -31,13 +31,17 @@
- delta = thickness of spatial layers in dim (distance units) -
- style = density or compute or fix +
- one or more values can be listed -
density arg = mass or number - mass = calculate mass density - number = calculate number density - compute arg = compute-ID that stores or calculates per-atom quantities - fix arg = fix-ID that stores or calculates per-atom quantities +- value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID[N], f_ID, f_ID[N], v_name + +
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) + density/number, density/mass = number or mass density + c_ID = per-atom scalar value calculated by a compute with ID + c_ID[N] = Nth component of per-atom vector calculated by a compute with ID + f_ID = per-atom scalar value calculated by a fix with ID + f_ID[N] = Nth component of per-atom vector calculated by a fix with ID + v_name = per-atom value calculated by an atom-style variable with name- zero or more keyword/arg pairs may be appended @@ -56,76 +60,66 @@
Examples:
-fix 1 all ave/spatial 10000 1 10000 z lower 0.02 compute myCentro units reduced -fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 compute Vx norm sample file vel.profile -fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density mass ave running +fix 1 all ave/spatial 10000 1 10000 z lower 0.02 myCentro units reduced +fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile +fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density/mass ave runningDescription:
Calculate one or more instantaneous per-atom quantities every few -timesteps, average them by layer in a chosen dimension and over a -longer timescale. The resulting averages can be used by other output -commands such as thermo_style -custom, and also written to a file. +timesteps, average them by layer in a chosen dimension, and average +the layer values over a longer timescale. The resulting averages can +be used by other output commands such as +thermo_style custom, and can also be written to a +file.
-This fix can be used to spatially average per-atom properties -(velocity, force) or per-atom quantities calculated by a -compute (energy, stress) or by another fix (see the -fix ave/atom command) or by a variable via an -equation you define (see the compute -variable/atom command). +
Each listed value is averaged independently. The group specified with +the command means only atoms within the group contribute to the layer +averages.
-For style density, the number of atoms in each layer is counted, -either by mass or by number. The compute style allows specification -of a compute which will be invoked to calculate the -desired property. The compute can be previously defined in the input -script or it can be a compute defined by a dump custom -command. +
Each listed value can be an atom attribute (position, velocity, force +component), a mass or number density, or the result of a +compute or fix or the evaluation of an +atom-style variable. In the latter cases, the +compute, fix, or variable must produce a per-atom quantity, not a +global quantity. If you wish to time-average global quantities from a +compute, fix, or variable, then see the fix +ave/time command.
-For style compute, the fix ave/spatial command accesses the -per-atom scalar or vector values stored by the compute. Thus it must -be a "per-atom" compute with the word "atom" in its style name, rather -than a "global" compute. See the fix ave/time -command if you wish to time-average a global quantity calculated by a -compute without the word atom in its style name, e.g. a compute that -calculates a temperature or pressure. -
-See the compute command for a list of pre-defined -per-atom computes. Two special computes of note are as follows. The -compute attribute/atom command selects -one or more atom attributes like vx or fz. The "compute -variable/atom" style can calculate a value for an atom that can be -specified by a variable atom equation. Users can also -write code for their own per-atom compute styles and add them to -LAMMPS. Note that the dump custom -command can also be used to directly output quantities calculated by a -per-atom compute in a per-atom fashion. -
-For style fix, the fix ave/spatial command accesses the per-atom -scalar or vector values stored by another fix. The fix -ave/atom command is an example of such a fix. +
Computes that produce per-atom quantities are those +which have the word atom in their style name. Currently the only +fix that produces per-atom quantities is fix +ave/atom. Variables of style +atom are the only ones that can be used with this fix since all +other styles of variable produce global quantities.
+
+The Nevery, Nrepeat, and Nfreq arguments specify on what -timesteps the per-atom property will be evaluated in order to -contribute to the average. The final averaged values are computed -every Nfreq timesteps. The average is over Nrepeat values, -computed in the preceeding portion of the simulation every Nevery -timesteps. Nfreq must be a multiple of Nevery and Nevery must -be non-zero even if Nrepeat is 1. +timesteps the layer values will be generated in order to contribute to +the average. The final averaged quantities are generated every +Nfreq timesteps. The average is over Nrepeat quantities, computed +in the preceeding portion of the simulation every Nevery timesteps. +Nfreq must be a multiple of Nevery and Nevery must be non-zero +even if Nrepeat is 1.
For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on timesteps 90,92,94,96,98,100 will be used to compute the final average on timestep 100. Similary for timesteps 190,192,194,196,198,200 on -timestep 200, etc. +timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time +averaging is done; values are simply generated on timesteps +100,200,etc.
-The per-atom property is also averaged over atoms in each layer, where -the layers are in a particular dim and have a thickness given by -delta. Every Nfreq steps, when an averaging is being performed and -the per-atom property is calculated for the first time, the number of -layers and the layer boundaries are computed. Thus if the simlation -box changes size during a simulation, the number of layers and their -boundaries may also change. Layers are defined relative to a -specified origin, which may be the lower/upper edge of the box (in +
+ +Each per-atom property is also averaged over atoms in each layer, +where the layers are in a particular dim and have a thickness given +by delta. Every Nfreq steps, when an averaging is being performed +and the per-atom property is calculated for the first time, the number +of layers and the layer boundaries are computed. Thus if the +simlation box changes size during a simulation, the number of layers +and their boundaries may also change. Layers are defined relative to +a specified origin, which may be the lower/upper edge of the box (in dim) or its center point, or a specified coordinate value. Starting at the origin, sufficient layers are created in both directions to completely cover the box. On subsequent timesteps every atom is @@ -146,14 +140,39 @@ position of these tilted layers in an unambiguous fashion, the units option must be set to reduced when using a non-orthogonal simulation box, as discussed below.
-For the compute and fix keywords, the per-atom calculation -performed by the compute or fix is on the group defined by that -command. However, only atoms in the fix group are included in the -layer averaging. +
+ +The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are +self-explanatory.
-Note that some computes perform costly calculations, involving the -creation or use of neighbor lists. If the compute is invoked too -often by fix ave/spatial, it can slow down a simulation. +
The density/number value means the number density is computed in +each layer, i.e. a weighting of 1 for each atom. The density/mass +value means the mass density is computed in each layer, i.e. each atom +is weighted by its mass. The resulting density is normalized by the +volume of the layer so that units of number/volume or mass/volume are +output. +
+If a value begins with "c_", a compute ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the compute is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the compute is used. Users can also write code for their own +compute styles and add them to LAMMPS. +
+If a value begins with "f_", a fix ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the fix is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the fix is used. Note that some fixes only produce their values on +certain timesteps, which must be compatible with Nevery, else an +error results. Users can also write code for their own fix styles and +add them to LAMMPS. +
+If a value begins with "v_", a variable name must follow which has +been previously defined in the input script. Variables of style +atom can reference thermodynamic keywords, or invoke other computes, +fixes, or variables when they are evaluated, so this is a very general +means of generating per-atom quantities to spatially average.
@@ -182,15 +201,15 @@ the lower "b" cross "c" plane of the simulation box and an origin of A delta value of 0.1 means there will be 10 layers from 0.0 to 1.0, regardless of the current size or shape of the simulation box.The norm keyword affects how time-averaging is done within for the -output produced every Nfreq timesteps. For an all setting, a -layer quantity is summed over all atoms in all Nrepeat samples, as -is the count of atoms in the layer. The printed value for the layer -is Total-quantity / Total-count. In other words it is an average over +
The norm keyword affects how averaging is done for the output +produced every Nfreq timesteps. For an all setting, a layer +quantity is summed over all atoms in all Nrepeat samples, as is the +count of atoms in the layer. The printed value for the layer is +Total-quantity / Total-count. In other words it is an average over the entire Nfreq timescale.
-For a sample setting, the quantity is summed over atoms for only a -single sample, as is the count, and a "average sample value" is +
For a sample setting, the layer quantity is summed over atoms for +only a single sample, as is the count, and a "average sample value" is computed, i.e. Sample-quantity / Sample-count. The printed value for the layer is the average of the Nrepeat "average sample values", In other words it is an average of an average. @@ -200,17 +219,13 @@ timesteps, layer info will be written to a text file in the following format. A line with the timestep and number of layers is written. Then one line per layer is written, containing the layer ID (1-N), the coordinate of the center of the layer, the number of atoms in the -layer, and one or more calculated values. The number of atoms and the -value(s) are average quantities. If the value of the units keyword -is box or lattice, the "coord" is printed in box units. If the -value of the units keyword is reduced, the "coord" is printed in -reduced units (0-1). -
-If the style is density, or the style is compute or fix with a -compute/fix that calculates a single quantity per atom, then a single -value will be printed for each layer. If the style is compute or -fix with a compute/fix that calculates N quantities per atom, then N -values per line will be written, each of them averaged independently. +layer, and one or more calculated values. The number of values in +each line corresponds to the number of values specified in the fix +ave/spatial command. The number of atoms and the value(s) are average +quantities. If the value of the units keyword is box or +lattice, the "coord" is printed in box units. If the value of the +units keyword is reduced, the "coord" is printed in reduced units +(0-1).
The ave keyword determines how the layer values produced every Nfreq steps are averaged with layer values produced on previous @@ -246,16 +261,21 @@ average over less than M values if they are not available. files. None of the fix_modify options are relevant to this fix.
-This fix computes a vector of quantities which can be accessed by -various output commands. The values should +
This fix computes a global vector of quantities which can be accessed +by various output commands. The values can only be accessed on timesteps that are multiples of Nfreq since that -is when averaging is complete. The vector is of length N = -nlayers*nvalues where nvalues is the number of per-atom quantities -produced by the compute or fix that fix ave/spatial accesses. Nvalues -= 1 if the style is density. If nvalues > 1 and vector value N is -accessed by another output command, then the average quantity for the -Ith layer and Jth value in that layer is accessed, where I = N / -nvalues + 1 and J = N % nvalues + 1. +is when averaging is performed. The global vector is of length N = +nlayers*nvalues where nlayers is the number of layers and nvalues is +the number of values per layer that the fix is averaging. When +accessed by another output command, a single index M is specified +which is mapped into a layer I as I = M / nvalues + 1 and into value J +as J = M % nvalues + 1. If I exceeds the current number of layers +than a 0.0 is returned by the fix instead of an error, since the +number of layers can vary as a simulation runs, depending on the +simulation box size. The vector values calculated by this fix are +"intensive", meaning they are independent of the number of atoms in +the simulation, since they are already normalized by the count of +atoms in each layer.
No parameter of this fix can be used with the start/stop keywords of the run command. This fix is not invoked during energy diff --git a/doc/fix_ave_spatial.txt b/doc/fix_ave_spatial.txt index 924c1ffe7e..7b31cc4db9 100644 --- a/doc/fix_ave_spatial.txt +++ b/doc/fix_ave_spatial.txt @@ -10,7 +10,7 @@ fix ave/spatial command :h3 [Syntax:] -fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta style arg keyword args ... :pre +fix ID group-ID ave/spatial Nevery Nrepeat Nfreq dim origin delta value1 value2 ... keyword args ... :pre ID, group-ID are documented in "fix"_fix.html command :ulb,l ave/spatial = style name of this fix command :l @@ -20,12 +20,16 @@ Nfreq = timestep frequency at which the average value is computed :l dim = {x} or {y} or {z} :l origin = {lower} or {center} or {upper} or coordinate value (distance units) :l delta = thickness of spatial layers in dim (distance units) :l -style = {density} or {compute} or {fix} :l - {density} arg = {mass} or {number} - {mass} = calculate mass density - {number} = calculate number density - {compute} arg = compute-ID that stores or calculates per-atom quantities - {fix} arg = fix-ID that stores or calculates per-atom quantities :pre +one or more values can be listed :l +value = x, y, z, vx, vy, vz, fx, fy, fz, density/mass, density/number, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l + x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component) + density/number, density/mass = number or mass density + c_ID = per-atom scalar value calculated by a compute with ID + c_ID\[N\] = Nth component of per-atom vector calculated by a compute with ID + f_ID = per-atom scalar value calculated by a fix with ID + f_ID\[N\] = Nth component of per-atom vector calculated by a fix with ID + v_name = per-atom value calculated by an atom-style variable with name :pre + zero or more keyword/arg pairs may be appended :l keyword = {norm} or {units} or {file} or {ave} :l {units} arg = {box} or {lattice} or {reduced} @@ -40,76 +44,66 @@ keyword = {norm} or {units} or {file} or {ave} :l [Examples:] -fix 1 all ave/spatial 10000 1 10000 z lower 0.02 compute myCentro units reduced -fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 compute Vx norm sample file vel.profile -fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density mass ave running :pre +fix 1 all ave/spatial 10000 1 10000 z lower 0.02 myCentro units reduced +fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile +fix 1 flow ave/spatial 100 5 1000 y 0.0 2.5 density/mass ave running :pre [Description:] Calculate one or more instantaneous per-atom quantities every few -timesteps, average them by layer in a chosen dimension and over a -longer timescale. The resulting averages can be used by other "output -commands"_Section_howto.html#4_15 such as "thermo_style -custom"_thermo_style.html, and also written to a file. +timesteps, average them by layer in a chosen dimension, and average +the layer values over a longer timescale. The resulting averages can +be used by other "output commands"_Section_howto.html#4_15 such as +"thermo_style custom"_thermo_style.html, and can also be written to a +file. -This fix can be used to spatially average per-atom properties -(velocity, force) or per-atom quantities calculated by a -"compute"_compute.html (energy, stress) or by another fix (see the -"fix ave/atom"_fix_ave_atom.html command) or by a variable via an -equation you define (see the "compute -variable/atom"_compute_variable_atom.html command). +Each listed value is averaged independently. The group specified with +the command means only atoms within the group contribute to the layer +averages. -For style {density}, the number of atoms in each layer is counted, -either by mass or by number. The {compute} style allows specification -of a "compute"_compute.html which will be invoked to calculate the -desired property. The compute can be previously defined in the input -script or it can be a compute defined by a "dump custom"_dump.html -command. +Each listed value can be an atom attribute (position, velocity, force +component), a mass or number density, or the result of a +"compute"_compute.html or "fix"_fix.html or the evaluation of an +atom-style "variable"_variable.html. In the latter cases, the +compute, fix, or variable must produce a per-atom quantity, not a +global quantity. If you wish to time-average global quantities from a +compute, fix, or variable, then see the "fix +ave/time"_fix_ave_time.html command. -For style {compute}, the fix ave/spatial command accesses the -per-atom scalar or vector values stored by the compute. Thus it must -be a "per-atom" compute with the word "atom" in its style name, rather -than a "global" compute. See the "fix ave/time"_fix_ave_time.html -command if you wish to time-average a global quantity calculated by a -compute without the word atom in its style name, e.g. a compute that -calculates a temperature or pressure. +"Computes"_compute.html that produce per-atom quantities are those +which have the word {atom} in their style name. Currently the only +fix that produces per-atom quantities is "fix +ave/atom"_fix_ave_atom.html. "Variables"_variable.html of style +{atom} are the only ones that can be used with this fix since all +other styles of variable produce global quantities. -See the "compute"_compute.html command for a list of pre-defined -per-atom computes. Two special computes of note are as follows. The -"compute attribute/atom"_compute_attribute_atom.html command selects -one or more atom attributes like vx or fz. The "compute -variable/atom" style can calculate a value for an atom that can be -specified by a "variable atom"_variable.html equation. Users can also -write code for their own per-atom compute styles and "add them to -LAMMPS"_Section_modify.html. Note that the "dump custom"_dump.html -command can also be used to directly output quantities calculated by a -per-atom compute in a per-atom fashion. - -For style {fix}, the fix ave/spatial command accesses the per-atom -scalar or vector values stored by another fix. The "fix -ave/atom"_fix_ave_atom.html command is an example of such a fix. +:line The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what -timesteps the per-atom property will be evaluated in order to -contribute to the average. The final averaged values are computed -every {Nfreq} timesteps. The average is over {Nrepeat} values, -computed in the preceeding portion of the simulation every {Nevery} -timesteps. {Nfreq} must be a multiple of {Nevery} and {Nevery} must -be non-zero even if {Nrepeat} is 1. +timesteps the layer values will be generated in order to contribute to +the average. The final averaged quantities are generated every +{Nfreq} timesteps. The average is over {Nrepeat} quantities, computed +in the preceeding portion of the simulation every {Nevery} timesteps. +{Nfreq} must be a multiple of {Nevery} and {Nevery} must be non-zero +even if {Nrepeat} is 1. For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on timesteps 90,92,94,96,98,100 will be used to compute the final average on timestep 100. Similary for timesteps 190,192,194,196,198,200 on -timestep 200, etc. +timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time +averaging is done; values are simply generated on timesteps +100,200,etc. -The per-atom property is also averaged over atoms in each layer, where -the layers are in a particular {dim} and have a thickness given by -{delta}. Every Nfreq steps, when an averaging is being performed and -the per-atom property is calculated for the first time, the number of -layers and the layer boundaries are computed. Thus if the simlation -box changes size during a simulation, the number of layers and their -boundaries may also change. Layers are defined relative to a -specified {origin}, which may be the lower/upper edge of the box (in +:line + +Each per-atom property is also averaged over atoms in each layer, +where the layers are in a particular {dim} and have a thickness given +by {delta}. Every Nfreq steps, when an averaging is being performed +and the per-atom property is calculated for the first time, the number +of layers and the layer boundaries are computed. Thus if the +simlation box changes size during a simulation, the number of layers +and their boundaries may also change. Layers are defined relative to +a specified {origin}, which may be the lower/upper edge of the box (in {dim}) or its center point, or a specified coordinate value. Starting at the origin, sufficient layers are created in both directions to completely cover the box. On subsequent timesteps every atom is @@ -130,14 +124,39 @@ position of these tilted layers in an unambiguous fashion, the {units} option must be set to {reduced} when using a non-orthogonal simulation box, as discussed below. -For the {compute} and {fix} keywords, the per-atom calculation -performed by the compute or fix is on the group defined by that -command. However, only atoms in the fix group are included in the -layer averaging. +:line -Note that some computes perform costly calculations, involving the -creation or use of neighbor lists. If the compute is invoked too -often by fix ave/spatial, it can slow down a simulation. +The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are +self-explanatory. + +The {density/number} value means the number density is computed in +each layer, i.e. a weighting of 1 for each atom. The {density/mass} +value means the mass density is computed in each layer, i.e. each atom +is weighted by its mass. The resulting density is normalized by the +volume of the layer so that units of number/volume or mass/volume are +output. + +If a value begins with "c_", a compute ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the compute is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the compute is used. Users can also write code for their own +compute styles and "add them to LAMMPS"_Section_modify.html. + +If a value begins with "f_", a fix ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the per-atom scalar calculated by the fix is used. If a +bracketed term is appended, the Nth vector per-atom value calculated +by the fix is used. Note that some fixes only produce their values on +certain timesteps, which must be compatible with {Nevery}, else an +error results. Users can also write code for their own fix styles and +"add them to LAMMPS"_Section_modify.html. + +If a value begins with "v_", a variable name must follow which has +been previously defined in the input script. Variables of style +{atom} can reference thermodynamic keywords, or invoke other computes, +fixes, or variables when they are evaluated, so this is a very general +means of generating per-atom quantities to spatially average. :line @@ -166,15 +185,15 @@ the lower "b" cross "c" plane of the simulation box and an {origin} of A {delta} value of 0.1 means there will be 10 layers from 0.0 to 1.0, regardless of the current size or shape of the simulation box. -The {norm} keyword affects how time-averaging is done within for the -output produced every {Nfreq} timesteps. For an {all} setting, a -layer quantity is summed over all atoms in all {Nrepeat} samples, as -is the count of atoms in the layer. The printed value for the layer -is Total-quantity / Total-count. In other words it is an average over +The {norm} keyword affects how averaging is done for the output +produced every {Nfreq} timesteps. For an {all} setting, a layer +quantity is summed over all atoms in all {Nrepeat} samples, as is the +count of atoms in the layer. The printed value for the layer is +Total-quantity / Total-count. In other words it is an average over the entire {Nfreq} timescale. -For a {sample} setting, the quantity is summed over atoms for only a -single sample, as is the count, and a "average sample value" is +For a {sample} setting, the layer quantity is summed over atoms for +only a single sample, as is the count, and a "average sample value" is computed, i.e. Sample-quantity / Sample-count. The printed value for the layer is the average of the {Nrepeat} "average sample values", In other words it is an average of an average. @@ -184,17 +203,13 @@ timesteps, layer info will be written to a text file in the following format. A line with the timestep and number of layers is written. Then one line per layer is written, containing the layer ID (1-N), the coordinate of the center of the layer, the number of atoms in the -layer, and one or more calculated values. The number of atoms and the -value(s) are average quantities. If the value of the {units} keyword -is {box} or {lattice}, the "coord" is printed in box units. If the -value of the {units} keyword is {reduced}, the "coord" is printed in -reduced units (0-1). - -If the style is {density}, or the style is {compute} or {fix} with a -compute/fix that calculates a single quantity per atom, then a single -value will be printed for each layer. If the style is {compute} or -{fix} with a compute/fix that calculates N quantities per atom, then N -values per line will be written, each of them averaged independently. +layer, and one or more calculated values. The number of values in +each line corresponds to the number of values specified in the fix +ave/spatial command. The number of atoms and the value(s) are average +quantities. If the value of the {units} keyword is {box} or +{lattice}, the "coord" is printed in box units. If the value of the +{units} keyword is {reduced}, the "coord" is printed in reduced units +(0-1). The {ave} keyword determines how the layer values produced every {Nfreq} steps are averaged with layer values produced on previous @@ -230,16 +245,21 @@ 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. -This fix computes a vector of quantities which can be accessed by -various "output commands"_Section_howto.html#4_15. The values should +This fix computes a global vector of quantities which can be accessed +by various "output commands"_Section_howto.html#4_15. The values can only be accessed on timesteps that are multiples of {Nfreq} since that -is when averaging is complete. The vector is of length N = -nlayers*nvalues where nvalues is the number of per-atom quantities -produced by the compute or fix that fix ave/spatial accesses. Nvalues -= 1 if the style is {density}. If nvalues > 1 and vector value N is -accessed by another output command, then the average quantity for the -Ith layer and Jth value in that layer is accessed, where I = N / -nvalues + 1 and J = N % nvalues + 1. +is when averaging is performed. The global vector is of length N = +nlayers*nvalues where nlayers is the number of layers and nvalues is +the number of values per layer that the fix is averaging. When +accessed by another output command, a single index M is specified +which is mapped into a layer I as I = M / nvalues + 1 and into value J +as J = M % nvalues + 1. If I exceeds the current number of layers +than a 0.0 is returned by the fix instead of an error, since the +number of layers can vary as a simulation runs, depending on the +simulation box size. The vector values calculated by this fix are +"intensive", meaning they are independent of the number of atoms in +the simulation, since they are already normalized by the count of +atoms in each layer. 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 diff --git a/doc/fix_ave_time.html b/doc/fix_ave_time.html index 4354c0d7cd..7f34c8ed22 100644 --- a/doc/fix_ave_time.html +++ b/doc/fix_ave_time.html @@ -13,34 +13,36 @@
-Syntax:
-fix ID group-ID ave/time Nevery Nrepeat Nfreq style ID keyword args ... +fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...
- ID, group-ID are documented in fix command
- ave/time = style name of this fix command -
- Nevery = calculate property every this many timesteps +
- Nevery = calculate properties every this many timesteps
- Nrepeat = # of times to repeat the Nevery calculation before averaging -
- Nfreq = timestep frequency at which the average value is computed +
- Nfreq = timestep frequency at which averages are computed -
- style = compute or fix +
- one or more values can be listed -
- ID = ID of compute or fix that performs the calculation +
- value = c_ID, c_ID[N], f_ID, f_ID[N], v_name +
c_ID = global scalar value calculated by a compute with ID + c_ID[N] = Nth component of global vector calculated by a compute with ID + f_ID = global scalar value calculated by a fix with ID + f_ID[N] = Nth component of global vector calculated by a fix with ID + v_name = global value calculated by an equal-style variable with name +- zero or more keyword/arg pairs may be appended -
- keyword = type or file or ave +
- keyword = file or ave -
type arg = scalar or vector or both - scalar = single scalar value from fix or compute - vector = vector of values from fix or compute - both = both a single value and vector of values from fix or compute - file arg = filename +file arg = filename filename = name of file to output time averages to ave args = one or running or window M - one = output new average value every Nfreq steps + one = output a new average value every Nfreq steps running = output cummulative average of all previous Nfreq steps window M = output average of M most recent Nfreq steps@@ -48,52 +50,50 @@Examples:
-fix 1 all ave/time 100 5 1000 compute myTemp -fix 1 all ave/time 100 5 1000 compute myTemp ave window 20 -fix 1 all ave/time 1 100 1000 fix indenter value both file temp.indent +. None of the fix_modify options are relevant to this fix.fix 1 all ave/time 100 5 1000 myTemp thermo_temp file temp.profile +fix 1 all ave/time 100 5 1000 thermo_pressure2 ave window 20 +fix 1 all ave/time 1 100 1000 f_indent f_indent1 file temp.indentDescription:
-Calculate one or more instantaneous quantities every few timesteps, -and average them over a longer timescale. The resulting averages can -be used by other output commands such as -thermo_style custom, and also written to a file. +
Calculate one or more instantaneous global quantities every few +timesteps, and average them over longer timescales. The resulting +averages can be used by other output +commands such as thermo_style +custom, and can also be written to a file. If no +averaging is done, this command is a convenient way to simply write +one or more desired quantities to a separate file.
-This fix can be used to time-average a compute which -calculates a global quantity such as a temperature or pressure or a -fix which calculates a global quantity. Note that per-atom -quantities cannot be averaged with this fix; their values can be -averaged by the fix ave/spatial or fix -ave/atom commands. +
Each listed value is averaged independently. If written to a file, +then over time, one column of numbers is produced for each value. The +group specified with the command is ignored, since calculations are +performed by computes and fixes which store their own "group" +definition,
-Since the calculation is performed by the compute or fix which stores -its own "group" definition, the group specified as part of the fix -ave/time command is ignored. +
Each listed value can be the result of a compute or +fix or the evaluation of an equal-style +variable. In each case, the compute, fix, or variable +must produce a global quantity, not a per-atom quantity. If you wish +to spatial- or time-average per-atom quantities from a compute, fix, +or variable, then see the fix ave/spatial or +fix ave/atom commands. If you wish to sum a +per-atom quantity into a single global quantity, see the compute +sum command.
-For style compute the ID specifies a compute which -calculates the desired property. The compute must be a "global" -compute that calculates one or more global properties rather than a -"per-atom" compute. However, there is a compute -sum command which sums per-atom quantities into a -global scalar or vector which can be accessed by fix ave/time. -
-The compute must be previously defined in the input script. Or it can -be a compute defined by thermodynamic output or -other fixes such as fix nvt or fix -temp/rescale. Users can write code for their -own compute styles and add them to LAMMPS. -
-For style fix the ID specifies a fix which calculates -the desired property. The fix must calculate a global scalar or -vector quantity, which only a few fixes do. See the doc page for -individual fix commands for details. The fix must be previously -defined in the input script. Users can write code for their own fix -styles and add them to LAMMPS. +
Computes that produce global quantities are those which +do not have the word atom in their style name. Only a few +fixes produce global quantities. See the doc pages for +individual fixes for info on which ones produce such values. +Variables of style equal are the only ones that can +be used with this fix. Variables of style atom cannot be used, +since they produce per-atom values.
+
+The Nevery, Nrepeat, and Nfreq arguments specify on what -timesteps the property will be evaluated in order to contribute to the -average. The final averaged value(s) are computed every Nfreq -timesteps. The average is over Nrepeat values, computed in the +timesteps the values will be generated in order to contribute to the +average. The final averaged quantities are generated every Nfreq +timesteps. The average is over Nrepeat quantities, computed in the preceeding portion of the simulation every Nevery timesteps. Nfreq must be a multiple of Nevery and Nevery must be non-zero even if Nrepeat is 1. @@ -101,23 +101,51 @@ even if Nrepeat is 1.
For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on timesteps 90,92,94,96,98,100 will be used to compute the final average on timestep 100. Similary for timesteps 190,192,194,196,198,200 on -timestep 200, etc. +timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time +averaging is done; values are simply generated on timesteps +100,200,etc. +
+
+ +If a value begins with "c_", a compute ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the global scalar calculated by the compute is used. If a +bracketed term is appended, the Nth vector value calculated by the +compute is used. Note that there is a compute sum +command which sums per-atom quantities into a global scalar or vector +which can thus be accessed by fix ave/time. Or it can be a compute +defined not in your input script, but by thermodynamic +output or other fixes such as fix +nvt or fix temp/rescale. See +the doc pages for these commands which give the IDs of these computes. +Users can also write code for their own compute styles and add them +to LAMMPS. +
+If a value begins with "f_", a fix ID must follow which has been +previously defined in the input script. If no bracketed term is +appended, the global scalar calculated by the fix is used. If a +bracketed term is appended, the Nth vector value calculated by the fix +is used. Note that some fixes only produce their values on certain +timesteps, which must be compatible with Nevery, else an error will +result. Users can also write code for their own fix styles and add +them to LAMMPS. +
+If a value begins with "v_", a variable name must follow which has +been previously defined in the input script. Only equal-style +variables can be referenced. See the variable command +for details. Variables of style equal define a formula which can +reference individual atom properties or thermodynamic keywords, or +they can invoke other computes, fixes, or variables when they are +evaluated, so this is a very general means of generating quantities to +time average.
Additional optional keywords also affect the operation of this fix.
-The type keyword chooses whether the scalar and/or vector quantities -produced by the compute or fix are used. For a setting of scalar a -single global value is used. For a setting of vector N global -values are used, where N is defined by the compute or fix, e.g. 6 -pressure tensor components. For a setting of both, both a scalar -the vector values are used. When vectors are used, each of the N -values is averaged independently. -
-The file keyword allows a filename to be specified. The scalar -and/or N vector quantities are written to the file in a -self-explanatory text format. +
The file keyword allows a filename to be specified. Each timestamp, +one quantity is written to the file for each value specified in the +fix ave/time command. The file is in a self-explanatory text format.
The ave keyword determines how the scalar and/or vector values produced every Nfreq steps are averaged with values produced on @@ -134,7 +162,7 @@ cummulative sense before being output. Each output value is thus the average of the value produced on that timestep with all preceeding values. This running average begins when the fix is defined; it can only be restarted by deleting the fix via the unfix -command, or re-defining the fix by re-specifying it. +command, or by re-defining the fix by re-specifying it.
If the ave setting is window, then the values produced on timesteps that are multiples of Nfreq are summed and averaged within @@ -152,34 +180,35 @@ values if they are not available. files
Depending on the setting of the type parameter, this fix computes a -scalar and/or a vector of quantities which can be accessed by various -output commands. The values should only be -accessed on timesteps that are multiples of Nfreq since that is when -averaging is performed. +
This fix produces a global scalar or vector which can be accessed by +various output commands. A scalar is +produced if only a single quantity is averaged by this fix. If two or +more quantities are averaged, then a vector of values is produced. +The global values can only be accessed on timesteps that are multiples +of Nfreq since that is when averaging is performed. Each value +(scalar or vector component) calculated by this fix may be either +"intensive" or "extensive". Intensive means the value is independent +of the number of atoms in the simulation. Extensive means the value +scales with the number of atoms in the simulation. If a compute or +fix provides the value being time averaged, then the compute or fix +determines whether the value is intensive or extensive; see the doc +page for that compute or fix for further info. Values produced by a +variable are whatever the variable calculates.
No parameter of this fix can be used with the start/stop keywords of the run command. This fix is not invoked during energy minimization.
-Restrictions: -
-If the style is compute and the specified compute calculates -pressure, it will cause the force computations performed by LAMMPS -(pair, bond, angle, etc) to calculate virial terms each Nevery -timesteps. If this is more frequent than thermodynamic output, this -adds extra cost to a simulation. However, if a constant pressure -simulation is being run (fix npt or fix -nph), LAMMPS is already calculating virial terms for the -pressure every timestep. +
Restrictions: none
Related commands:
-compute, fix ave/atom, fix -ave/spatial +
compute, fix ave/atom, +variable, fix ave/spatial, fix +ave/atom
Default: none
-The option defaults are type = scalar, no file output, and ave = one. +
The option defaults no file output and ave = one.