From 3dc0d9bf44b67cb8dda7045bc82d407e911f82cf Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 21 Feb 2007 00:18:41 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@325 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/compute_variable_atom.html | 61 +++++++++++++++++ doc/compute_variable_atom.txt | 56 +++++++++++++++ doc/fix_ave_spatial.html | 120 +++++++++++++++++++++++++++++++++ doc/fix_ave_spatial.txt | 114 +++++++++++++++++++++++++++++++ doc/fix_ave_time.html | 85 +++++++++++++++++++++++ doc/fix_ave_time.txt | 80 ++++++++++++++++++++++ 6 files changed, 516 insertions(+) create mode 100644 doc/compute_variable_atom.html create mode 100644 doc/compute_variable_atom.txt create mode 100644 doc/fix_ave_spatial.html create mode 100644 doc/fix_ave_spatial.txt create mode 100644 doc/fix_ave_time.html create mode 100644 doc/fix_ave_time.txt diff --git a/doc/compute_variable_atom.html b/doc/compute_variable_atom.html new file mode 100644 index 0000000000..87fdecddad --- /dev/null +++ b/doc/compute_variable_atom.html @@ -0,0 +1,61 @@ + +
LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands +
+ + + + + + +
+ +

compute variable/atom command +

+

Syntax: +

+
compute ID group-ID variable/atom name 
+
+ +

Examples: +

+
compute 1 flow variable/atom myVar 
+
+

Description: +

+

Define a computation that calculates a formula for each atom in the +group. The per-atom quantities can be output via the dump +custom command or spatially averaged via the fix +ave/spatial command. +

+

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. +

+
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 
+
+

If the dump line were replaced by +

+
fix 1 flow ave/spatial 100 1000 z lower 2.0 ke.profile compute ke 
+
+

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 +

+ diff --git a/doc/compute_variable_atom.txt b/doc/compute_variable_atom.txt new file mode 100644 index 0000000000..abf8194a2c --- /dev/null +++ b/doc/compute_variable_atom.txt @@ -0,0 +1,56 @@ +"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 variable/atom command :h3 + +[Syntax:] + +compute ID group-ID variable/atom name :pre + +ID, group-ID are documented in "compute"_compute.html command +variable/atom = style name of this compute command +name = variable name to invoke for each atom :ul + +[Examples:] + +compute 1 flow variable/atom myVar :pre + +[Description:] + +Define a computation that calculates a formula for each atom in the +group. The per-atom quantities can be output via the "dump +custom"_dump.html command or spatially averaged via the "fix +ave/spatial"_fix_ave_spatial.html command. + +The formula is defined by the "variable atom"_variable.html 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. + +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 :pre + +If the dump line were replaced by + +fix 1 flow ave/spatial 100 1000 z lower 2.0 ke.profile compute ke :pre + +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"_dump.html, "fix ave/spatial"_fix_ave_spatial.html + +[Default:] none diff --git a/doc/fix_ave_spatial.html b/doc/fix_ave_spatial.html new file mode 100644 index 0000000000..43528809d5 --- /dev/null +++ b/doc/fix_ave_spatial.html @@ -0,0 +1,120 @@ + +
LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands +
+ + + + + + +
+ +

fix ave/spatial command +

+

Syntax: +

+
fix ID group-ID ave/spatial Nevery Nfreq dim origin delta file keyword value ... 
+
+ +
  density value = none
+  atom value = vx or vy or vz or fx or fy or fz
+  compute value = compute-ID that calculates per-atom quantities 
+
+

Examples: +

+
fix 1 all ave/time 10000 10000 z lower 2.0 centro.profile compute myCentro
+fix 1 flow ave/time 100 1000 y 0.0 1.0 vel.profile atom vx 
+
+

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, and print the results to a file. This can be used +to spatially average per-atom properties such as velocity or energy or +a quantity calculated by an equation you define; see the variable +atom command. +

+

The density keyword means to simply count the number of atoms in +each layer. The atom keyword allows an atom property such as +x-velocity to be specified. The compute keyword allows +specification of a compute which will be invoked to +calculate the desired property. The compute can be previously defined +in the input script. Note that the "compute variable/atom" style +allows you to calculate any quantity for an atom that can be specified +by a variable atom equation. Users can also write +code for their own compute styles and add them to +LAMMPS. Note that the dump custom +command can also be used to output per-atom quantities calculated by a +compute. +

+

For the compute keyword, the fix ave/spatial style uses the per-atom +scalar or vector calculated by the compute. See the fix +ave/time command if you wish to time-average a +global quantity, e.g. via a compute that temperature or pressure. +

+

In all cases, the calculated property is 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 a property is calculated +for the first time (after a previous write), 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 mapped to one of the +layers. Atoms beyond the lowermost/uppermost layer are counted in the +first/last layer. +

+

The Nevery and Nfreq arguments specify how the property calculated +for each layer is time-averaged. The property is calculated once each +Nevery timesteps. It is averaged and output every Nfreq timesteps. +Nfreq must be a multiple of Nevery. In the 2nd example above, the +property is calculated every 100 steps. After 10 calculations, the +average result is written to the file, once every 1000 steps. +

+

Each time info is written to the file, it is 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 density or atom keyword is used, or the compute keyword +with a compute that calculates a single quantity per atom, then a +single value will be printed for each layer. If the compute keyword +is used with a compute that calculates N quantities per atom, then N +values per line will be written, each of them averaged independently. +

+

Note that for the density keyword, the printed count of atoms in the +layer is actually what you should use to infer a density. The +calculated value is always 1.0, since it is normalized by the number +of atoms in the layer. +

+

For the compute keyword, the calculation performed by the compute in +on the group defined by the compute. However, only atoms in the fix +group are included in the layer averaging. LAMMPS prints a warning if +the fix group and compute group do not match. +

+

Note that some computes perform costly calculations, involving use of +or creation of neighbor lists. If the compute is invoked too often by +fix ave/spatial, it can slow down a simulation. +

+

Restrictions: none +

+

Related commands: +

+

compute, fix ave/time +

+

Default: none +

+ diff --git a/doc/fix_ave_spatial.txt b/doc/fix_ave_spatial.txt new file mode 100644 index 0000000000..ed2fea3c09 --- /dev/null +++ b/doc/fix_ave_spatial.txt @@ -0,0 +1,114 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Section_commands.html#comm) + +:line + +fix ave/spatial command :h3 + +[Syntax:] + +fix ID group-ID ave/spatial Nevery Nfreq dim origin delta file keyword value ... :pre + +ID, group-ID are documented in "fix"_fix.html command +ave/spatial = style name of this fix command +Nevery = calculate property every this many timesteps +Nfreq = write average property to file every this many steps +dim = {x} or {y} or {z} +origin = {lower} or {center} or {upper} or coordinate value +delta = thickness of spatial layers in dim +file = filename to write results to +keyword = {density} or {atom} or {compute} :ul + {density} value = none + {atom} value = {vx} or {vy} or {vz} or {fx} or {fy} or {fz} + {compute value} = compute-ID that calculates per-atom quantities :pre + +[Examples:] + +fix 1 all ave/time 10000 10000 z lower 2.0 centro.profile compute myCentro +fix 1 flow ave/time 100 1000 y 0.0 1.0 vel.profile atom vx :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, and print the results to a file. This can be used +to spatially average per-atom properties such as velocity or energy or +a quantity calculated by an equation you define; see the "variable +atom"_variable.html command. + +The {density} keyword means to simply count the number of atoms in +each layer. The {atom} keyword allows an atom property such as +x-velocity to be specified. The {compute} keyword 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. Note that the "compute variable/atom" style +allows you to calculate any quantity for an atom that can be specified +by a "variable atom"_variable.html equation. Users can also write +code for their own compute styles and "add them to +LAMMPS"_Section_modify.html. Note that the "dump custom"_dump.html +command can also be used to output per-atom quantities calculated by a +compute. + +For the {compute} keyword, the fix ave/spatial style uses the per-atom +scalar or vector calculated by the compute. See the "fix +ave/time"_fix_ave_time.html command if you wish to time-average a +global quantity, e.g. via a compute that temperature or pressure. + +In all cases, the calculated property is 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 a property is calculated +for the first time (after a previous write), 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 mapped to one of the +layers. Atoms beyond the lowermost/uppermost layer are counted in the +first/last layer. + +The {Nevery} and {Nfreq} arguments specify how the property calculated +for each layer is time-averaged. The property is calculated once each +Nevery timesteps. It is averaged and output every Nfreq timesteps. +Nfreq must be a multiple of Nevery. In the 2nd example above, the +property is calculated every 100 steps. After 10 calculations, the +average result is written to the file, once every 1000 steps. + +Each time info is written to the file, it is 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 {density} or {atom} keyword is used, or the {compute} keyword +with a compute that calculates a single quantity per atom, then a +single value will be printed for each layer. If the {compute} keyword +is used with a compute that calculates N quantities per atom, then N +values per line will be written, each of them averaged independently. + +Note that for the {density} keyword, the printed count of atoms in the +layer is actually what you should use to infer a density. The +calculated value is always 1.0, since it is normalized by the number +of atoms in the layer. + +For the {compute} keyword, the calculation performed by the compute in +on the group defined by the compute. However, only atoms in the fix +group are included in the layer averaging. LAMMPS prints a warning if +the fix group and compute group do not match. + +Note that some computes perform costly calculations, involving use of +or creation of neighbor lists. If the compute is invoked too often by +fix ave/spatial, it can slow down a simulation. + +[Restrictions:] none + +[Related commands:] + +"compute"_compute.html, "fix ave/time"_fix_ave_time.html + +[Default:] none diff --git a/doc/fix_ave_time.html b/doc/fix_ave_time.html new file mode 100644 index 0000000000..f7eef19644 --- /dev/null +++ b/doc/fix_ave_time.html @@ -0,0 +1,85 @@ + +
LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands +
+ + + + + + +
+ +

fix ave/time command +

+

Syntax: +

+
fix ID group-ID ave/time Nevery Nfreq compute-ID flag file 
+
+ +

Examples: +

+
fix 1 all ave/time 100 1000 myTemp 0 temp.stats 
+
+

Description: +

+

Calculate one or more instantaneous quantities every few timesteps, +average them over a longer timescale, and print the results to a file. +This can be used to time-average any "compute" entity in LAMMPS such +as a temperature or pressure. +

+

The compute-ID specifies a compute which calculates +the desired property. The compute can 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 also write code for their own compute styles and add them to +LAMMPS. +

+

In all these cases, the fix ave/time style uses the global scalar or +vector calculated by the compute. See the fix +ave/spatial command if you wish to average +spatially, e.g. via a compute that calculates per-atom quantities. +

+

The Nevery and Nfreq arguments specify how the property will be +averaged. The property is calculated once each Nevery timesteps. It +is averaged and output every Nfreq timesteps. Nfreq must be a +multiple of Nevery. In the example above, the property is calculated +every 100 steps. After 10 calculations, the average result is written +to the file, once every 1000 steps. +

+

The flag argument chooses whether the scalar and/or vector +calculation of the compute is invoked. The former computes a single +global value. The latter computes N global values, where N is defined +by the compute, e.g. 6 pressure tensor components. In the vector +case, each of the N values is averaged independently and N values are +written to the file at each output. +

+

Since the calculation is performed by the compute which stores its own +"group" definition, the group specified for the fix is ignored. +LAMMPS prints a warning if the fix group and compute group do not +match. +

+

If the 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/spatial +

+

Default: none +

+ diff --git a/doc/fix_ave_time.txt b/doc/fix_ave_time.txt new file mode 100644 index 0000000000..3a716ab0a8 --- /dev/null +++ b/doc/fix_ave_time.txt @@ -0,0 +1,80 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Section_commands.html#comm) + +:line + +fix ave/time command :h3 + +[Syntax:] + +fix ID group-ID ave/time Nevery Nfreq compute-ID flag file :pre + +ID, group-ID are documented in "fix"_fix.html command +ave/time = style name of this fix command +Nevery = calculate property every this many timesteps +Nfreq = write average property to file every this many steps +compute-ID = ID of compute that performs the calculation +flag = 0 for scalar quantity, 1 for vector quantity, 2 for both +file = filename to write results to :ul + +[Examples:] + +fix 1 all ave/time 100 1000 myTemp 0 temp.stats :pre + +[Description:] + +Calculate one or more instantaneous quantities every few timesteps, +average them over a longer timescale, and print the results to a file. +This can be used to time-average any "compute" entity in LAMMPS such +as a temperature or pressure. + +The {compute-ID} specifies a "compute"_compute.html which calculates +the desired property. The compute can be previously defined in the +input script. Or it can be a compute defined by "thermodynamic +output"_thermo_style.html or other fixes such as "fix +nvt"_fix_nvt.html or "fix temp/rescale"_fix_temp_rescale.html. Users +can also write code for their own compute styles and "add them to +LAMMPS"_Section_modify.html. + +In all these cases, the fix ave/time style uses the global scalar or +vector calculated by the compute. See the "fix +ave/spatial"_fix_ave_spatial.html command if you wish to average +spatially, e.g. via a compute that calculates per-atom quantities. + +The {Nevery} and {Nfreq} arguments specify how the property will be +averaged. The property is calculated once each Nevery timesteps. It +is averaged and output every Nfreq timesteps. Nfreq must be a +multiple of Nevery. In the example above, the property is calculated +every 100 steps. After 10 calculations, the average result is written +to the file, once every 1000 steps. + +The {flag} argument chooses whether the scalar and/or vector +calculation of the compute is invoked. The former computes a single +global value. The latter computes N global values, where N is defined +by the compute, e.g. 6 pressure tensor components. In the vector +case, each of the N values is averaged independently and N values are +written to the file at each output. + +Since the calculation is performed by the compute which stores its own +"group" definition, the group specified for the fix is ignored. +LAMMPS prints a warning if the fix group and compute group do not +match. + +If the 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"_fix_npt.html +or "fix nph"_fix_nph.html), LAMMPS is already calculating virial terms +for the pressure every timestep. + +[Restrictions:] none + +[Related commands:] + +"compute"_compute.html, "fix ave/spatial"_fix_ave_spatial.html + +[Default:] none