diff -Naur lammps-4Jan08/doc/Section_commands.html lammps-5Jan08/doc/Section_commands.html --- lammps-4Jan08/doc/Section_commands.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/Section_commands.html 2008-01-03 17:27:56.000000000 -0700 @@ -317,13 +317,13 @@ of each style or click on the style itself for a full description:
These are compute styles contributed by users, which can be used if diff -Naur lammps-4Jan08/doc/Section_commands.txt lammps-5Jan08/doc/Section_commands.txt --- lammps-4Jan08/doc/Section_commands.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/Section_commands.txt 2008-01-03 17:27:56.000000000 -0700 @@ -381,6 +381,7 @@ "ave/spatial"_fix_ave_spatial.html, "ave/time"_fix_ave_time.html, "com"_fix_com.html, +"coord/original"_fix_coord_original.html, "deform"_fix_deform.html, "deposit"_fix_deposit.html, "drag"_fix_drag.html, @@ -439,6 +440,7 @@ "centro/atom"_compute_centro_atom.html, "coord/atom"_compute_coord_atom.html, +"displace/atom"_compute_displace_atom.html, "ke/atom"_compute_ke_atom.html, "pe"_compute_pe.html, "pe/atom"_compute_pe_atom.html, diff -Naur lammps-4Jan08/doc/compute.html lammps-5Jan08/doc/compute.html --- lammps-4Jan08/doc/compute.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/compute.html 2008-01-03 17:27:56.000000000 -0700 @@ -111,6 +111,7 @@
Description:
Defines a computation that calculates the local lattice structure -according to (Ackland). +according to the formulation given in (Ackland).
In contrast to the centro-symmetry parameter this method is stable against temperature boost, because it is based not on the distance between particles but the angles. Therefore statistical fluctuations are averaged out a little more. A comparison with the Common Neighbor -Analysis metric is made in the paper.. +Analysis metric is made in the paper.
The result is a number which is mapped to the following different lattice structures: @@ -49,6 +49,13 @@ too frequently or to have multiple compute/dump commands, each of which computes this quantity.-
+Output info: +
+This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +this section for an overview of LAMMPS +output options. +
Restrictions: none
Related commands: diff -Naur lammps-4Jan08/doc/compute_ackland_atom.txt lammps-5Jan08/doc/compute_ackland_atom.txt --- lammps-4Jan08/doc/compute_ackland_atom.txt 2007-10-04 09:05:42.000000000 -0600 +++ lammps-5Jan08/doc/compute_ackland_atom.txt 2008-01-03 17:56:10.000000000 -0700 @@ -22,14 +22,14 @@ [Description:] Defines a computation that calculates the local lattice structure -according to "(Ackland)"_#Ackland. +according to the formulation given in "(Ackland)"_#Ackland. In contrast to the "centro-symmetry parameter"_compute_centro_atom.html this method is stable against temperature boost, because it is based not on the distance between particles but the angles. Therefore statistical fluctuations are averaged out a little more. A comparison with the Common Neighbor -Analysis metric is made in the paper.. +Analysis metric is made in the paper. The result is a number which is mapped to the following different lattice structures: @@ -46,6 +46,13 @@ too frequently or to have multiple compute/dump commands, each of which computes this quantity.- +[Output info:] + +This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +"this section"_Section_howto.html#4_15 for an overview of LAMMPS +output options. + [Restrictions:] none [Related commands:] diff -Naur lammps-4Jan08/doc/compute_centro_atom.html lammps-5Jan08/doc/compute_centro_atom.html --- lammps-4Jan08/doc/compute_centro_atom.html 2007-11-20 08:37:16.000000000 -0700 +++ lammps-5Jan08/doc/compute_centro_atom.html 2008-01-03 17:56:10.000000000 -0700 @@ -50,6 +50,13 @@ too frequently or to have multiple compute/dump commands, each of a centro/atom style.
+Output info: +
+This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +this section for an overview of LAMMPS +output options. +
Restrictions: none
Related commands: none diff -Naur lammps-4Jan08/doc/compute_centro_atom.txt lammps-5Jan08/doc/compute_centro_atom.txt --- lammps-4Jan08/doc/compute_centro_atom.txt 2007-11-20 08:37:16.000000000 -0700 +++ lammps-5Jan08/doc/compute_centro_atom.txt 2008-01-03 17:56:10.000000000 -0700 @@ -47,6 +47,13 @@ too frequently or to have multiple compute/dump commands, each of a {centro/atom} style. +[Output info:] + +This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +"this section"_Section_howto.html#4_15 for an overview of LAMMPS +output options. + [Restrictions:] none [Related commands:] none diff -Naur lammps-4Jan08/doc/compute_coord_atom.html lammps-5Jan08/doc/compute_coord_atom.html --- lammps-4Jan08/doc/compute_coord_atom.html 2007-11-20 08:37:16.000000000 -0700 +++ lammps-5Jan08/doc/compute_coord_atom.html 2008-01-03 17:56:10.000000000 -0700 @@ -42,6 +42,13 @@ too frequently or to have multiple compute/dump commands, each of a coord/atom style.
+Output info: +
+This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +this section for an overview of LAMMPS +output options. +
Restrictions: none
Related commands: none diff -Naur lammps-4Jan08/doc/compute_coord_atom.txt lammps-5Jan08/doc/compute_coord_atom.txt --- lammps-4Jan08/doc/compute_coord_atom.txt 2007-11-20 08:37:16.000000000 -0700 +++ lammps-5Jan08/doc/compute_coord_atom.txt 2008-01-03 17:56:10.000000000 -0700 @@ -39,6 +39,13 @@ too frequently or to have multiple compute/dump commands, each of a {coord/atom} style. +[Output info:] + +This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +"this section"_Section_howto.html#4_15 for an overview of LAMMPS +output options. + [Restrictions:] none [Related commands:] none diff -Naur lammps-4Jan08/doc/compute_displace_atom.html lammps-5Jan08/doc/compute_displace_atom.html --- lammps-4Jan08/doc/compute_displace_atom.html 1969-12-31 17:00:00.000000000 -0700 +++ lammps-5Jan08/doc/compute_displace_atom.html 2008-01-03 17:56:10.000000000 -0700 @@ -0,0 +1,61 @@ + +
Syntax: +
+compute ID group-ID displace/atom fix-ID ++
Examples: +
+compute 1 all displace/atom myCoords ++
Description: +
+Define a computation that calculates the current displacement of each +atom in the group from its original coordinates, including all effects +due to atoms passing thru periodic boundaries. The original +coordinates are stored by a fix +coord/original command, whose ID must be +specified with this compute. They are the coordinates at the time the +fix command was issued. The displacement can be output directly via +the dump custom command. It could also be used to +calculate a diffusion coefficient for a group of atoms, as is done by +the fix msd command. +
+The value of the displacement will be 0.0 for atoms not in the +specified compute group. Note that the fix defines its own group and +stores (0.0,0.0,0.0) for the original coordinates of any atom not in +the fix group. +
+Output info: +
+This compute calculates a vector of length 4 for each atom, which can +be accessed by indices 1-4 by any command that uses per-atom computes +as input. See this section for an overview +of LAMMPS output options. The first 3 components of the vector are +the x,y,z displacements. The 4th component is the total displacement, +i.e. sqrt(dx*dx + dy*dy + dz*dz). +
+Restrictions: none +
+Related commands: +
+ +Default: none +
+ diff -Naur lammps-4Jan08/doc/compute_displace_atom.txt lammps-5Jan08/doc/compute_displace_atom.txt --- lammps-4Jan08/doc/compute_displace_atom.txt 1969-12-31 17:00:00.000000000 -0700 +++ lammps-5Jan08/doc/compute_displace_atom.txt 2008-01-03 17:56:10.000000000 -0700 @@ -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 displace/atom command :h3 + +[Syntax:] + +compute ID group-ID displace/atom fix-ID :pre + +ID, group-ID are documented in "compute"_compute.html command +displace/atom = style name of this compute command +fix-ID = ID of a fix of style "coord/original"_fix_coord_original.html :ul + +[Examples:] + +compute 1 all displace/atom myCoords :pre + +[Description:] + +Define a computation that calculates the current displacement of each +atom in the group from its original coordinates, including all effects +due to atoms passing thru periodic boundaries. The original +coordinates are stored by a "fix +coord/original"_fix_coord_original.html command, whose ID must be +specified with this compute. They are the coordinates at the time the +fix command was issued. The displacement can be output directly via +the "dump custom"_dump.html command. It could also be used to +calculate a diffusion coefficient for a group of atoms, as is done by +the "fix msd"_fix_msd.html command. + +The value of the displacement will be 0.0 for atoms not in the +specified compute group. Note that the fix defines its own group and +stores (0.0,0.0,0.0) for the original coordinates of any atom not in +the fix group. + +[Output info:] + +This compute calculates a vector of length 4 for each atom, which can +be accessed by indices 1-4 by any command that uses per-atom computes +as input. See "this section"_Section_howto.html#4_15 for an overview +of LAMMPS output options. The first 3 components of the vector are +the x,y,z displacements. The 4th component is the total displacement, +i.e. sqrt(dx*dx + dy*dy + dz*dz). + +[Restrictions:] none + +[Related commands:] + +"dump custom"_dump.html, "fix msd"_fix_msd.html + +[Default:] none diff -Naur lammps-4Jan08/doc/compute_ke_atom.html lammps-5Jan08/doc/compute_ke_atom.html --- lammps-4Jan08/doc/compute_ke_atom.html 2007-11-20 08:37:16.000000000 -0700 +++ lammps-5Jan08/doc/compute_ke_atom.html 2008-01-03 17:56:10.000000000 -0700 @@ -33,6 +33,13 @@The kinetic energy is simply 1/2 m v^2, where m is the mass and v is the velocity of each atom.
+Output info: +
+This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +this section for an overview of LAMMPS +output options. +
Restrictions: none
Related commands: diff -Naur lammps-4Jan08/doc/compute_ke_atom.txt lammps-5Jan08/doc/compute_ke_atom.txt --- lammps-4Jan08/doc/compute_ke_atom.txt 2007-11-20 08:37:16.000000000 -0700 +++ lammps-5Jan08/doc/compute_ke_atom.txt 2008-01-03 17:56:10.000000000 -0700 @@ -30,6 +30,13 @@ The kinetic energy is simply 1/2 m v^2, where m is the mass and v is the velocity of each atom. +[Output info:] + +This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +"this section"_Section_howto.html#4_15 for an overview of LAMMPS +output options. + [Restrictions:] none [Related commands:] diff -Naur lammps-4Jan08/doc/compute_pe_atom.html lammps-5Jan08/doc/compute_pe_atom.html --- lammps-4Jan08/doc/compute_pe_atom.html 2007-11-30 17:08:43.000000000 -0700 +++ lammps-5Jan08/doc/compute_pe_atom.html 2008-01-03 17:56:10.000000000 -0700 @@ -55,6 +55,13 @@ pairwise interactions between 1-4 atoms. The energy contribution of these terms is included in the pair energy, not the dihedral energy.
+Output info: +
+This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +this section for an overview of LAMMPS +output options. +
Restrictions: none
Related commands: diff -Naur lammps-4Jan08/doc/compute_pe_atom.txt lammps-5Jan08/doc/compute_pe_atom.txt --- lammps-4Jan08/doc/compute_pe_atom.txt 2007-11-30 16:59:23.000000000 -0700 +++ lammps-5Jan08/doc/compute_pe_atom.txt 2008-01-03 17:56:10.000000000 -0700 @@ -52,6 +52,13 @@ pairwise interactions between 1-4 atoms. The energy contribution of these terms is included in the pair energy, not the dihedral energy. +[Output info:] + +This compute calculates a scalar quantity for each atom, which can be +accessed by any command that uses per-atom computes as input. See +"this section"_Section_howto.html#4_15 for an overview of LAMMPS +output options. + [Restrictions:] none [Related commands:] diff -Naur lammps-4Jan08/doc/compute_stress_atom.html lammps-5Jan08/doc/compute_stress_atom.html --- lammps-4Jan08/doc/compute_stress_atom.html 2008-01-03 12:03:15.000000000 -0700 +++ lammps-5Jan08/doc/compute_stress_atom.html 2008-01-03 17:56:10.000000000 -0700 @@ -33,9 +33,10 @@ components: xx, yy, zz, xy, xz, yz. See the compute pressure command if you want the stress tensor (pressure) of the entire system. The 6 components can be accessed by -indices 1-6 by any command that uses per-atom computes, e.g. the dump -custom command or fix ave/spatial -command or fix ave/atom command. See this +indices 1-6 by any command that uses per-atom computes as input, +e.g. the dump custom command or fix +ave/spatial command or fix +ave/atom command. See this section for an overview.
The stress tensor for atom I is given by the following formula, @@ -97,6 +98,14 @@ potentials that are not yet instrumented to yield per-atom stress. See the Restrictions below.
+Output info: +
+This compute calculates a vector of length 6 for each atom, which can +be accessed by indices 1-6 by any command that uses per-atom computes +as input. See this section for an overview +of LAMMPS output options. The 6 components of the vector are ordered +xx, yy, zz, xy, xz, yz. +
Restrictions:
These pair styles do not yet tabulate per-atom virial information to diff -Naur lammps-4Jan08/doc/compute_stress_atom.txt lammps-5Jan08/doc/compute_stress_atom.txt --- lammps-4Jan08/doc/compute_stress_atom.txt 2008-01-03 12:03:15.000000000 -0700 +++ lammps-5Jan08/doc/compute_stress_atom.txt 2008-01-03 17:56:10.000000000 -0700 @@ -29,9 +29,10 @@ components: xx, yy, zz, xy, xz, yz. See the "compute pressure"_compute_pressure.html command if you want the stress tensor (pressure) of the entire system. The 6 components can be accessed by -indices 1-6 by any command that uses per-atom computes, e.g. the "dump -custom"_dump.html command or "fix ave/spatial"_fix_ave_spatial.html -command or "fix ave/atom"_fix_ave_atom.html command. See "this +indices 1-6 by any command that uses per-atom computes as input, +e.g. the "dump custom"_dump.html command or "fix +ave/spatial"_fix_ave_spatial.html command or "fix +ave/atom"_fix_ave_atom.html command. See "this section"_Section_howto.html#4_15 for an overview. The stress tensor for atom {I} is given by the following formula, @@ -93,6 +94,14 @@ potentials that are not yet instrumented to yield per-atom stress. See the Restrictions below. +[Output info:] + +This compute calculates a vector of length 6 for each atom, which can +be accessed by indices 1-6 by any command that uses per-atom computes +as input. See "this section"_Section_howto.html#4_15 for an overview +of LAMMPS output options. The 6 components of the vector are ordered +xx, yy, zz, xy, xz, yz. + [Restrictions:] These pair styles do not yet tabulate per-atom virial information to diff -Naur lammps-4Jan08/doc/compute_sum.html lammps-5Jan08/doc/compute_sum.html --- lammps-4Jan08/doc/compute_sum.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/compute_sum.html 2008-01-03 16:28:08.000000000 -0700 @@ -62,11 +62,11 @@ 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. +which have the word atom in their style name. See the doc pages for +individual fixes to determine which ones produce per-atom +quantities. Variables of style atom are the only +ones that can be used with this compute since all other variable +styles 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 diff -Naur lammps-4Jan08/doc/compute_sum.txt lammps-5Jan08/doc/compute_sum.txt --- lammps-4Jan08/doc/compute_sum.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/compute_sum.txt 2008-01-03 16:28:08.000000000 -0700 @@ -54,11 +54,11 @@ variable must produce a per-atom quantity, not a global quantity. "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 the "fix -ave/atom"_fix_ave_atom.html command. "Variables"_variable.html of -style {atom} are the only ones that can be used with this compute -since all other variable stylse produce global quantities. +which have the word {atom} in their style name. See the doc pages for +individual "fixes"_fix.html to determine which ones produce per-atom +quantities. "Variables"_variable.html of style {atom} are the only +ones that can be used with this compute since all other variable +styles 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 diff -Naur lammps-4Jan08/doc/dump.html lammps-5Jan08/doc/dump.html --- lammps-4Jan08/doc/dump.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/dump.html 2008-01-03 16:28:08.000000000 -0700 @@ -258,10 +258,10 @@
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 keyword should be replaced by the actual ID of the fix that has been -defined previously in the input script. Currently the fix -ave/atom command is the only fix that calculates -per-atom quantities. Since it can time-average per-atom quantities -produced by any compute, fix, or atom-style +defined previously in the input script. The fix +ave/atom command is one that calculates per-atom +quantities. Since it can time-average per-atom quantities produced by +any compute, fix, or atom-style variable, this allows those time-averaged results to be written to a dump file.
diff -Naur lammps-4Jan08/doc/dump.txt lammps-5Jan08/doc/dump.txt --- lammps-4Jan08/doc/dump.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/dump.txt 2008-01-03 16:28:08.000000000 -0700 @@ -248,10 +248,10 @@ The {f_ID} and {f_ID\[N\]} keywords allow scalar or vector per-atom quantities calculated by a "fix"_fix.html to be output. The ID in the keyword should be replaced by the actual ID of the fix that has been -defined previously in the input script. Currently the "fix -ave/atom"_fix_ave_atom.html command is the only fix that calculates -per-atom quantities. Since it can time-average per-atom quantities -produced by any "compute"_compute.html, "fix"_fix.html, or atom-style +defined previously in the input script. The "fix +ave/atom"_fix_ave_atom.html command is one that calculates per-atom +quantities. Since it can time-average per-atom quantities produced by +any "compute"_compute.html, "fix"_fix.html, or atom-style "variable"_variable.html, this allows those time-averaged results to be written to a dump file. diff -Naur lammps-4Jan08/doc/fix.html lammps-5Jan08/doc/fix.html --- lammps-4Jan08/doc/fix.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix.html 2008-01-03 17:27:56.000000000 -0700 @@ -109,6 +109,7 @@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. +computed. Atoms not in the group have their result(s) set to 0.0.
Each listed value can be an atom attribute (position, velocity, force component) or can be the result of a compute or @@ -64,13 +64,11 @@ variable, then see the fix ave/time command.
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. +which have the word atom in their style name. See the doc pages for +inidividual fixes to determine which ones produce per-atom +quantities. Variables of style atom are the only +ones that can be used with this fix since all other styles of variable +produce global quantities.
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. +which have the word atom in their style name. See the doc pages for +individual fixes to determine which ones produce per-atom +quantities. Variables of style atom are the only +ones that can be used with this fix since all other styles of variable +produce global quantities.
Syntax: +
+fix ID group-ID coord/original ++
Examples: +
+fix 1 all coord/original ++
Description: +
+Store the original coordinates of atoms in the group at the time the +fix command is issued. This is useful for computing a displacement of +the atoms at later times, via the compute +displace/atom command. Or the original +coordinates can be accessed by other output +commands that use per-atom quantities such as +the dump custom command. +
+IMPORTANT NOTE: To enable displacements to be calculated which include +the effects of atoms passing through periodic boundaries, the original +coordinates are stored in "unwrapped" form, by using the image flags +associated with each atom. See the dump custom command +for a discussion of "unwrapped" coordinates. See the Atoms section of +the read_data command for a discussion of image flags +and how they are set for each atom. +
+IMPORTANT NOTE: If an atom is part of a rigid body (see the fix +rigid command), it's periodic image flags are altered, +and its original coordinates may not be what you expect. See the +fix rigid command for details. +
+Restart, fix_modify, output, run start/stop, minimize info: +
+This fix writes the original coordinates of the atoms to binary +restart files, so that the values can be restored when a +simulation is restarted. See the read_restart +command for info on how to re-specify a fix in an input script that +reads a restart file, so that the operation of the fix continues in an +uninterrupted fashion. +
+None of the fix_modify options are relevant to this +fix. +
+This fix produces a per-atom vector which can be accessed by various +output commands. The length of the vector +for each atom is 3, and the components store the x,y,z coords of each +atom. The per-atom values be accessed on any timestep. +
+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: none +
+Related commands: +
+fix msd +
+Default: none +
+ diff -Naur lammps-4Jan08/doc/fix_coord_original.txt lammps-5Jan08/doc/fix_coord_original.txt --- lammps-4Jan08/doc/fix_coord_original.txt 1969-12-31 17:00:00.000000000 -0700 +++ lammps-5Jan08/doc/fix_coord_original.txt 2008-01-03 17:27:56.000000000 -0700 @@ -0,0 +1,72 @@ +"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 coord/original command :h3 + +[Syntax:] + +fix ID group-ID coord/original :pre + +ID, group-ID are documented in "fix"_fix.html command +coord/original = style name of this fix command :ul + +[Examples:] + +fix 1 all coord/original :pre + +[Description:] + +Store the original coordinates of atoms in the group at the time the +fix command is issued. This is useful for computing a displacement of +the atoms at later times, via the "compute +displace/atom"_compute_displace_atom.html command. Or the original +coordinates can be accessed by other "output +commands"_Section_howto.html#4_15 that use per-atom quantities such as +the "dump custom"_dump.html command. + +IMPORTANT NOTE: To enable displacements to be calculated which include +the effects of atoms passing through periodic boundaries, the original +coordinates are stored in "unwrapped" form, by using the image flags +associated with each atom. See the "dump custom"_dump.html command +for a discussion of "unwrapped" coordinates. See the Atoms section of +the "read_data"_read_data.html command for a discussion of image flags +and how they are set for each atom. + +IMPORTANT NOTE: If an atom is part of a rigid body (see the "fix +rigid"_fix_rigid.html command), it's periodic image flags are altered, +and its original coordinates may not be what you expect. See the +"fix rigid"_fix_rigid.html command for details. + +[Restart, fix_modify, output, run start/stop, minimize info:] + +This fix writes the original coordinates of the atoms to "binary +restart files"_restart.html, so that the values can be restored when a +simulation is restarted. See the "read_restart"_read_restart.html +command for info on how to re-specify a fix in an input script that +reads a restart file, so that the operation of the fix continues in an +uninterrupted fashion. + +None of the "fix_modify"_fix_modify.html options are relevant to this +fix. + +This fix produces a per-atom vector which can be accessed by various +"output commands"_Section_howto.html#4_15. The length of the vector +for each atom is 3, and the components store the x,y,z coords of each +atom. The per-atom values be accessed on any timestep. + +No parameter of this fix can be used with the {start/stop} keywords of +the "run"_run.html command. This fix is not invoked during "energy +minimization"_minimize.html. + +[Restrictions:] none + +[Related commands:] + +"fix msd"_fix_msd.html + +[Default:] none diff -Naur lammps-4Jan08/doc/fix_modify.html lammps-5Jan08/doc/fix_modify.html --- lammps-4Jan08/doc/fix_modify.html 2007-06-25 18:03:39.000000000 -0600 +++ lammps-5Jan08/doc/fix_modify.html 2008-01-03 17:37:21.000000000 -0700 @@ -67,8 +67,8 @@Related commands:
-fix, temperature, -thermo_style +
fix, compute temp, compute +pressure, thermo_style
Default:
diff -Naur lammps-4Jan08/doc/fix_modify.txt lammps-5Jan08/doc/fix_modify.txt --- lammps-4Jan08/doc/fix_modify.txt 2007-06-25 18:03:39.000000000 -0600 +++ lammps-5Jan08/doc/fix_modify.txt 2008-01-03 17:37:21.000000000 -0700 @@ -60,8 +60,8 @@ [Related commands:] -"fix"_fix.html, "temperature"_temperature.html, -"thermo_style"_thermo_style.html +"fix"_fix.html, "compute temp"_compute_temp.html, "compute +pressure"_compute_pressure.html, "thermo_style"_thermo_style.html [Default:] diff -Naur lammps-4Jan08/doc/fix_msd.html lammps-5Jan08/doc/fix_msd.html --- lammps-4Jan08/doc/fix_msd.html 2007-10-10 16:28:11.000000000 -0600 +++ lammps-5Jan08/doc/fix_msd.html 2008-01-03 17:27:56.000000000 -0700 @@ -60,7 +60,9 @@Restrictions: none
-Related commands: none +
Related commands: +
+Default: none
diff -Naur lammps-4Jan08/doc/fix_msd.txt lammps-5Jan08/doc/fix_msd.txt --- lammps-4Jan08/doc/fix_msd.txt 2007-10-10 16:28:11.000000000 -0600 +++ lammps-5Jan08/doc/fix_msd.txt 2008-01-03 17:27:56.000000000 -0700 @@ -57,12 +57,8 @@ [Restrictions:] none -[Related commands:] none - -[Default:] none - - - - +[Related commands:] +"fix coord/original"_fix_coord_original.html +[Default:] none diff -Naur lammps-4Jan08/doc/fix_nph.html lammps-5Jan08/doc/fix_nph.html --- lammps-4Jan08/doc/fix_nph.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nph.html 2008-01-03 17:37:21.000000000 -0700 @@ -131,11 +131,11 @@compute fix-ID_press group-ID pressure fix-ID_temp-
See the compute temp and >>compute
+ See the compute temp and compute
pressure commands for details. Note that the
-IDs of the new computes are the fix-ID with
Note that these are NOT the computes used by thermodynamic output (see the thermo_style command) with ID = thermo_temp diff -Naur lammps-4Jan08/doc/fix_nph.txt lammps-5Jan08/doc/fix_nph.txt --- lammps-4Jan08/doc/fix_nph.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nph.txt 2008-01-03 17:37:21.000000000 -0700 @@ -123,9 +123,9 @@ See the "compute temp"_compute_temp.html and "compute pressure"_compute_pressure.html commands for details. Note that the -IDs of the new computes are the fix-ID with "_temp" or "_press" -appended and the group for the new computes is the same as the fix -group. +IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID ++ underscore + "press", and the group for the new computes is the same +as the fix group. Note that these are NOT the computes used by thermodynamic output (see the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} diff -Naur lammps-4Jan08/doc/fix_npt.html lammps-5Jan08/doc/fix_npt.html --- lammps-4Jan08/doc/fix_npt.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_npt.html 2008-01-03 17:37:21.000000000 -0700 @@ -135,11 +135,11 @@
compute fix-ID_temp group-ID temp compute fix-ID_press group-ID pressure fix-ID_temp-
See the compute temp and >>compute
+ See the compute temp and compute
pressure commands for details. Note that the
-IDs of the new computes are the fix-ID with
Note that these are NOT the computes used by thermodynamic output (see the thermo_style command) with ID = thermo_temp diff -Naur lammps-4Jan08/doc/fix_npt.txt lammps-5Jan08/doc/fix_npt.txt --- lammps-4Jan08/doc/fix_npt.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_npt.txt 2008-01-03 17:37:21.000000000 -0700 @@ -126,9 +126,9 @@ See the "compute temp"_compute_temp.html and "compute pressure"_compute_pressure.html commands for details. Note that the -IDs of the new computes are the fix-ID with "_temp" or "_press" -appended and the group for the new computes is the same as the fix -group. +IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID ++ underscore + "press", and the group for the new computes is the same +as the fix group. Note that these are NOT the computes used by thermodynamic output (see the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} diff -Naur lammps-4Jan08/doc/fix_npt_asphere.html lammps-5Jan08/doc/fix_npt_asphere.html --- lammps-4Jan08/doc/fix_npt_asphere.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_npt_asphere.html 2008-01-03 17:37:21.000000000 -0700 @@ -134,11 +134,11 @@
compute fix-ID_temp group-ID temp/asphere compute fix-ID_press group-ID pressure fix-ID_temp-
See the compute temp/asphere and >>compute
+ See the compute temp/asphere and compute
pressure commands for details. Note that the
-IDs of the new computes are the fix-ID with
Note that these are NOT the computes used by thermodynamic output (see the thermo_style command) with ID = thermo_temp diff -Naur lammps-4Jan08/doc/fix_npt_asphere.txt lammps-5Jan08/doc/fix_npt_asphere.txt --- lammps-4Jan08/doc/fix_npt_asphere.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_npt_asphere.txt 2008-01-03 17:37:21.000000000 -0700 @@ -125,9 +125,9 @@ See the "compute temp/asphere"_compute_temp_asphere.html and "compute pressure"_compute_pressure.html commands for details. Note that the -IDs of the new computes are the fix-ID with "_temp" or "_press" -appended and the group for the new computes is the same as the fix -group. +IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID ++ underscore + "press", and the group for the new computes is the same +as the fix group. Note that these are NOT the computes used by thermodynamic output (see the "thermo_style"_thermo_style.html command) with ID = {thermo_temp} diff -Naur lammps-4Jan08/doc/fix_nvt.html lammps-5Jan08/doc/fix_nvt.html --- lammps-4Jan08/doc/fix_nvt.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nvt.html 2008-01-03 17:37:21.000000000 -0700 @@ -66,9 +66,9 @@
compute fix-ID_temp group-ID temp-
See the >compute temp command for details. Note -that the ID of the new compute is the fix-ID with appended and -the group for the new compute is the same as the fix group. +
See the compute temp command for details. Note +that the ID of the new compute is the fix-ID + underscore + "temp", +and the group for the new compute is the same as the fix group.
Note that this is NOT the compute used by thermodynamic output (see the thermo_style command) with ID = thermo_temp. @@ -120,7 +120,7 @@
fix nve, fix npt, fix temp/rescale, fix langevin, -fix_modify, temperature +fix_modify, compute temp
Default:
diff -Naur lammps-4Jan08/doc/fix_nvt.txt lammps-5Jan08/doc/fix_nvt.txt --- lammps-4Jan08/doc/fix_nvt.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nvt.txt 2008-01-03 17:37:21.000000000 -0700 @@ -58,8 +58,8 @@ compute fix-ID_temp group-ID temp :pre See the "compute temp"_compute_temp.html command for details. Note -that the ID of the new compute is the fix-ID with "_temp" appended and -the group for the new compute is the same as the fix group. +that the ID of the new compute is the fix-ID + underscore + "temp", +and the group for the new compute is the same as the fix group. Note that this is NOT the compute used by thermodynamic output (see the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. @@ -111,7 +111,7 @@ "fix nve"_fix_nve.html, "fix npt"_fix_npt.html, "fix temp/rescale"_fix_temp_rescale.html, "fix langevin"_fix_langevin.html, -"fix_modify"_fix_modify.html, "temperature"_temperature.html +"fix_modify"_fix_modify.html, "compute temp"_compute_temp.html [Default:] diff -Naur lammps-4Jan08/doc/fix_nvt_asphere.html lammps-5Jan08/doc/fix_nvt_asphere.html --- lammps-4Jan08/doc/fix_nvt_asphere.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nvt_asphere.html 2008-01-03 17:37:21.000000000 -0700 @@ -67,10 +67,10 @@compute fix-ID_temp group-ID temp/asphere-
See the >compute temp/asphere command for -details. Note that the ID of the new compute is the fix-ID with - appended and the group for the new compute is the same as the -fix group. +
See the compute temp/asphere command for +details. Note that the ID of the new compute is the fix-ID + +underscore + "temp", and the group for the new compute is the same as +the fix group.
Note that this is NOT the compute used by thermodynamic output (see the thermo_style command) with ID = thermo_temp. diff -Naur lammps-4Jan08/doc/fix_nvt_asphere.txt lammps-5Jan08/doc/fix_nvt_asphere.txt --- lammps-4Jan08/doc/fix_nvt_asphere.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nvt_asphere.txt 2008-01-03 17:37:21.000000000 -0700 @@ -59,9 +59,9 @@ compute fix-ID_temp group-ID temp/asphere :pre See the "compute temp/asphere"_compute_temp_asphere.html command for -details. Note that the ID of the new compute is the fix-ID with -"_temp" appended and the group for the new compute is the same as the -fix group. +details. Note that the ID of the new compute is the fix-ID + +underscore + "temp", and the group for the new compute is the same as +the fix group. Note that this is NOT the compute used by thermodynamic output (see the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. diff -Naur lammps-4Jan08/doc/fix_nvt_sllod.html lammps-5Jan08/doc/fix_nvt_sllod.html --- lammps-4Jan08/doc/fix_nvt_sllod.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nvt_sllod.html 2008-01-03 17:37:21.000000000 -0700 @@ -93,10 +93,10 @@
compute fix-ID_temp group-ID temp/deform-
See the >compute temp/deform command for -details. Note that the ID of the new compute is the fix-ID with - appended and the group for the new compute is the same as the -fix group. +
See the compute temp/deform command for +details. Note that the ID of the new compute is the fix-ID + +underscore + "temp", and the group for the new compute is the same as +the fix group.
Note that this is NOT the compute used by thermodynamic output (see the thermo_style command) with ID = thermo_temp. @@ -147,7 +147,7 @@
fix nve, fix npt, fix npt, fix temp/rescale, fix langevin, fix_modify, -temperature +compute temp
Default:
diff -Naur lammps-4Jan08/doc/fix_nvt_sllod.txt lammps-5Jan08/doc/fix_nvt_sllod.txt --- lammps-4Jan08/doc/fix_nvt_sllod.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_nvt_sllod.txt 2008-01-03 17:37:21.000000000 -0700 @@ -85,9 +85,9 @@ compute fix-ID_temp group-ID temp/deform :pre See the "compute temp/deform"_compute_temp_deform.html command for -details. Note that the ID of the new compute is the fix-ID with -"_temp" appended and the group for the new compute is the same as the -fix group. +details. Note that the ID of the new compute is the fix-ID + +underscore + "temp", and the group for the new compute is the same as +the fix group. Note that this is NOT the compute used by thermodynamic output (see the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. @@ -138,7 +138,7 @@ "fix nve"_fix_nve.html, "fix npt"_fix_npt.html, "fix npt"_fix_npt.html, "fix temp/rescale"_fix_temp_rescale.html, "fix langevin"_fix_langevin.html, "fix_modify"_fix_modify.html, -"temperature"_temperature.html +"compute temp"_compute_temp.html [Default:] diff -Naur lammps-4Jan08/doc/fix_temp_rescale.html lammps-5Jan08/doc/fix_temp_rescale.html --- lammps-4Jan08/doc/fix_temp_rescale.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_temp_rescale.html 2008-01-03 17:37:21.000000000 -0700 @@ -78,10 +78,10 @@Which is used depends on whether the region or partial keywords were specified with the fix. See the compute temp, compute -temp/region, and >compute +temp/region, and compute temp/partial commands for details. Note -that the ID of the new compute is the fix-ID with appended and -the group for the new compute is the same as the fix group. +that the ID of the new compute is the fix-ID + underscore + "temp", +and the group for the new compute is the same as the fix group.
Note that this is NOT the compute used by thermodynamic output (see the thermo_style command) with ID = thermo_temp. diff -Naur lammps-4Jan08/doc/fix_temp_rescale.txt lammps-5Jan08/doc/fix_temp_rescale.txt --- lammps-4Jan08/doc/fix_temp_rescale.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/fix_temp_rescale.txt 2008-01-03 17:37:21.000000000 -0700 @@ -76,8 +76,8 @@ temp"_compute_temp.html, "compute temp/region"_compute_temp_region.html, and "compute temp/partial"_compute_temp_partial.html commands for details. Note -that the ID of the new compute is the fix-ID with "_temp" appended and -the group for the new compute is the same as the fix group. +that the ID of the new compute is the fix-ID + underscore + "temp", +and the group for the new compute is the same as the fix group. Note that this is NOT the compute used by thermodynamic output (see the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}. diff -Naur lammps-4Jan08/doc/thermo_style.html lammps-5Jan08/doc/thermo_style.html --- lammps-4Jan08/doc/thermo_style.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/thermo_style.html 2008-01-03 17:37:21.000000000 -0700 @@ -294,7 +294,8 @@
Related commands:
thermo, thermo_modify, -fix_modify, temperature +fix_modify, compute temp, +compute pressure
Default:
diff -Naur lammps-4Jan08/doc/thermo_style.txt lammps-5Jan08/doc/thermo_style.txt --- lammps-4Jan08/doc/thermo_style.txt 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/thermo_style.txt 2008-01-03 17:37:21.000000000 -0700 @@ -288,7 +288,8 @@ [Related commands:] "thermo"_thermo.html, "thermo_modify"_thermo_modify.html, -"fix_modify"_fix_modify.html, "temperature"_temperature.html +"fix_modify"_fix_modify.html, "compute temp"_compute_temp.html, +"compute pressure"_compute_pressure.html [Default:] diff -Naur lammps-4Jan08/doc/variable.html lammps-5Jan08/doc/variable.html --- lammps-4Jan08/doc/variable.html 2008-01-02 12:25:15.000000000 -0700 +++ lammps-5Jan08/doc/variable.html 2008-01-03 16:28:08.000000000 -0700 @@ -221,12 +221,12 @@Note that the formula for equal-style variables cannot use any formula -element that produces per-atom values, namely atom vectors, a compute -that produces per-atom values, a fix that produces per-atoms values, -or an atom-style variable. The formula for atom-style variables can -use these quantities, as well as quantities that produce a global -scalar or vector, e.g. a compute or fix that produces global +
Note that a formula for equal-style variables cannot use any formula +element that produces per-atom values. This includes atom vectors, a +compute that produces per-atom values, a fix that produces per-atoms +values, or an atom-style variable. A formula for an atom-style +variables can use these elements, as well as elements that produce a +global scalar or vector, e.g. a compute or fix that produces global quantities.
The thermo keywords allowed in a formula are those defined by the
diff -Naur lammps-4Jan08/doc/variable.txt lammps-5Jan08/doc/variable.txt
--- lammps-4Jan08/doc/variable.txt 2008-01-02 12:25:15.000000000 -0700
+++ lammps-5Jan08/doc/variable.txt 2008-01-03 16:28:08.000000000 -0700
@@ -216,12 +216,12 @@
Fix references: f_ID, f_ID\[N\]
Other variables: v_abc, v_x, etc :tb(s=:)
-Note that the formula for equal-style variables cannot use any formula
-element that produces per-atom values, namely atom vectors, a compute
-that produces per-atom values, a fix that produces per-atoms values,
-or an atom-style variable. The formula for atom-style variables can
-use these quantities, as well as quantities that produce a global
-scalar or vector, e.g. a compute or fix that produces global
+Note that a formula for equal-style variables cannot use any formula
+element that produces per-atom values. This includes atom vectors, a
+compute that produces per-atom values, a fix that produces per-atoms
+values, or an atom-style variable. A formula for an atom-style
+variables can use these elements, as well as elements that produce a
+global scalar or vector, e.g. a compute or fix that produces global
quantities.
The thermo keywords allowed in a formula are those defined by the
diff -Naur lammps-4Jan08/src/compute_displace_atom.cpp lammps-5Jan08/src/compute_displace_atom.cpp
--- lammps-4Jan08/src/compute_displace_atom.cpp 1969-12-31 17:00:00.000000000 -0700
+++ lammps-5Jan08/src/compute_displace_atom.cpp 2008-01-03 17:12:32.000000000 -0700
@@ -0,0 +1,150 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+#include "math.h"
+#include "string.h"
+#include "compute_displace_atom.h"
+#include "atom.h"
+#include "domain.h"
+#include "modify.h"
+#include "fix.h"
+#include "memory.h"
+#include "error.h"
+
+using namespace LAMMPS_NS;
+
+#define INVOKED_PERATOM 4
+
+/* ---------------------------------------------------------------------- */
+
+ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
+ Compute(lmp, narg, arg)
+{
+ if (narg != 4) error->all("Illegal compute displace/atom command");
+
+ peratom_flag = 1;
+ size_peratom = 4;
+
+ // store fix ID which stores original atom coords
+
+ int n = strlen(arg[3]) + 1;
+ id_fix = new char[n];
+ strcpy(id_fix,arg[3]);
+
+ int ifix = modify->find_fix(id_fix);
+ if (ifix < 0) error->all("Could not find compute displace/atom fix ID");
+
+ nmax = 0;
+ displace = NULL;
+}
+
+/* ---------------------------------------------------------------------- */
+
+ComputeDisplaceAtom::~ComputeDisplaceAtom()
+{
+ delete [] id_fix;
+ memory->destroy_2d_double_array(displace);
+}
+
+/* ---------------------------------------------------------------------- */
+
+void ComputeDisplaceAtom::init()
+{
+ // set fix which stores original atom coords
+ // check if is correct style
+
+ int ifix = modify->find_fix(id_fix);
+ if (ifix < 0) error->all("Could not find compute displace/atom fix ID");
+ fix = modify->fix[ifix];
+
+ if (strcmp(fix->style,"coord/original") != 0)
+ error->all("Invalid fix style used in compute displace/atom command");
+}
+
+/* ---------------------------------------------------------------------- */
+
+void ComputeDisplaceAtom::compute_peratom()
+{
+ invoked |= INVOKED_PERATOM;
+
+ // grow local displacement array if necessary
+
+ if (atom->nmax > nmax) {
+ memory->destroy_2d_double_array(displace);
+ nmax = atom->nmax;
+ displace =
+ memory->create_2d_double_array(nmax,4,"compute/displace/atom:displace");
+ vector_atom = displace;
+ }
+
+ // dx,dy,dz = displacement of atom from original position
+ // original unwrapped position is stored by fix
+ // for triclinic, need to unwrap current atom coord via h matrix
+
+ double **xoriginal = fix->vector_atom;
+
+ double **x = atom->x;
+ int *mask = atom->mask;
+ int *image = atom->image;
+ int nlocal = atom->nlocal;
+
+ double *h = domain->h;
+ double xprd = domain->xprd;
+ double yprd = domain->yprd;
+ double zprd = domain->zprd;
+ int xbox,ybox,zbox;
+ double dx,dy,dz;
+
+ if (domain->triclinic == 0) {
+ for (int i = 0; i < nlocal; i++)
+ if (mask[i] & groupbit) {
+ xbox = (image[i] & 1023) - 512;
+ ybox = (image[i] >> 10 & 1023) - 512;
+ zbox = (image[i] >> 20) - 512;
+ dx = x[i][0] + xbox*xprd - xoriginal[i][0];
+ dy = x[i][1] + ybox*yprd - xoriginal[i][1];
+ dz = x[i][2] + zbox*zprd - xoriginal[i][2];
+ displace[i][0] = dx;
+ displace[i][1] = dy;
+ displace[i][2] = dz;
+ displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
+ } else displace[i][0] = displace[i][1] =
+ displace[i][2] = displace[i][3] = 0.0;
+
+ } else {
+ for (int i = 0; i < nlocal; i++)
+ if (mask[i] & groupbit) {
+ xbox = (image[i] & 1023) - 512;
+ ybox = (image[i] >> 10 & 1023) - 512;
+ zbox = (image[i] >> 20) - 512;
+ dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xoriginal[i][0];
+ dy = x[i][1] + h[1]*ybox + h[3]*zbox - xoriginal[i][1];
+ dz = x[i][2] + h[2]*zbox - xoriginal[i][2];
+ displace[i][0] = dx;
+ displace[i][1] = dy;
+ displace[i][2] = dz;
+ displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
+ } else displace[i][0] = displace[i][1] =
+ displace[i][2] = displace[i][3] = 0.0;
+ }
+}
+
+/* ----------------------------------------------------------------------
+ memory usage of local atom-based array
+------------------------------------------------------------------------- */
+
+double ComputeDisplaceAtom::memory_usage()
+{
+ double bytes = nmax*4 * sizeof(double);
+ return bytes;
+}
diff -Naur lammps-4Jan08/src/compute_displace_atom.h lammps-5Jan08/src/compute_displace_atom.h
--- lammps-4Jan08/src/compute_displace_atom.h 1969-12-31 17:00:00.000000000 -0700
+++ lammps-5Jan08/src/compute_displace_atom.h 2008-01-03 17:12:32.000000000 -0700
@@ -0,0 +1,38 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+#ifndef COMPUTE_DISPLACE_ATOM_H
+#define COMPUTE_DISPLACE_ATOM_H
+
+#include "compute.h"
+
+namespace LAMMPS_NS {
+
+class ComputeDisplaceAtom : public Compute {
+ public:
+ ComputeDisplaceAtom(class LAMMPS *, int, char **);
+ ~ComputeDisplaceAtom();
+ void init();
+ void compute_peratom();
+ double memory_usage();
+
+ private:
+ int nmax;
+ double **displace;
+ char *id_fix;
+ class Fix *fix;
+};
+
+}
+
+#endif
diff -Naur lammps-4Jan08/src/fix_coord_original.cpp lammps-5Jan08/src/fix_coord_original.cpp
--- lammps-4Jan08/src/fix_coord_original.cpp 1969-12-31 17:00:00.000000000 -0700
+++ lammps-5Jan08/src/fix_coord_original.cpp 2008-01-03 17:12:32.000000000 -0700
@@ -0,0 +1,184 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+#include "stdlib.h"
+#include "string.h"
+#include "fix_coord_original.h"
+#include "atom.h"
+#include "domain.h"
+#include "group.h"
+#include "memory.h"
+#include "error.h"
+
+using namespace LAMMPS_NS;
+
+/* ---------------------------------------------------------------------- */
+
+FixCoordOriginal::FixCoordOriginal(LAMMPS *lmp, int narg, char **arg) :
+ Fix(lmp, narg, arg)
+{
+ if (narg != 3) error->all("Illegal fix coord/original command");
+
+ restart_peratom = 1;
+ peratom_flag = 1;
+ size_peratom = 3;
+ peratom_freq = 1;
+
+ // perform initial allocation of atom-based array
+ // register with Atom class
+
+ xoriginal = NULL;
+ grow_arrays(atom->nmax);
+ atom->add_callback(0);
+ atom->add_callback(1);
+
+ // xoriginal = initial unwrapped positions of atoms
+
+ double **x = atom->x;
+ int *mask = atom->mask;
+ int *image = atom->image;
+ int nlocal = atom->nlocal;
+
+ for (int i = 0; i < nlocal; i++) {
+ if (mask[i] & groupbit) domain->unmap(x[i],image[i],xoriginal[i]);
+ else xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+FixCoordOriginal::~FixCoordOriginal()
+{
+ // unregister callbacks to this fix from Atom class
+
+ atom->delete_callback(id,0);
+ atom->delete_callback(id,1);
+
+ // delete locally stored array
+
+ memory->destroy_2d_double_array(xoriginal);
+}
+
+/* ---------------------------------------------------------------------- */
+
+int FixCoordOriginal::setmask()
+{
+ int mask = 0;
+ return mask;
+}
+
+/* ----------------------------------------------------------------------
+ memory usage of local atom-based array
+------------------------------------------------------------------------- */
+
+double FixCoordOriginal::memory_usage()
+{
+ double bytes = atom->nmax*3 * sizeof(double);
+ return bytes;
+}
+
+/* ----------------------------------------------------------------------
+ allocate atom-based array
+------------------------------------------------------------------------- */
+
+void FixCoordOriginal::grow_arrays(int nmax)
+{
+ xoriginal =
+ memory->grow_2d_double_array(xoriginal,nmax,3,"fix_msd:xoriginal");
+ vector_atom = xoriginal;
+}
+
+/* ----------------------------------------------------------------------
+ copy values within local atom-based array
+------------------------------------------------------------------------- */
+
+void FixCoordOriginal::copy_arrays(int i, int j)
+{
+ xoriginal[j][0] = xoriginal[i][0];
+ xoriginal[j][1] = xoriginal[i][1];
+ xoriginal[j][2] = xoriginal[i][2];
+}
+
+/* ----------------------------------------------------------------------
+ pack values in local atom-based array for exchange with another proc
+------------------------------------------------------------------------- */
+
+int FixCoordOriginal::pack_exchange(int i, double *buf)
+{
+ buf[0] = xoriginal[i][0];
+ buf[1] = xoriginal[i][1];
+ buf[2] = xoriginal[i][2];
+ return 3;
+}
+
+/* ----------------------------------------------------------------------
+ unpack values in local atom-based array from exchange with another proc
+------------------------------------------------------------------------- */
+
+int FixCoordOriginal::unpack_exchange(int nlocal, double *buf)
+{
+ xoriginal[nlocal][0] = buf[0];
+ xoriginal[nlocal][1] = buf[1];
+ xoriginal[nlocal][2] = buf[2];
+ return 3;
+}
+
+/* ----------------------------------------------------------------------
+ pack values in local atom-based arrays for restart file
+------------------------------------------------------------------------- */
+
+int FixCoordOriginal::pack_restart(int i, double *buf)
+{
+ buf[0] = 4;
+ buf[1] = xoriginal[i][0];
+ buf[2] = xoriginal[i][1];
+ buf[3] = xoriginal[i][2];
+ return 4;
+}
+
+/* ----------------------------------------------------------------------
+ unpack values from atom->extra array to restart the fix
+------------------------------------------------------------------------- */
+
+void FixCoordOriginal::unpack_restart(int nlocal, int nth)
+{
+ double **extra = atom->extra;
+
+ // skip to Nth set of extra values
+
+ int m = 0;
+ for (int i = 0; i < nth; i++) m += static_cast