From 029ad193185aa127ced73512b84d1f7176cc6321 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 5 Jan 2009 22:26:31 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2332 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Section_commands.html | 20 +-- doc/Section_commands.txt | 6 +- doc/Section_errors.html | 4 +- doc/Section_errors.txt | 4 +- doc/angle_hybrid.html | 5 +- doc/angle_hybrid.txt | 5 +- doc/bond_hybrid.html | 5 +- doc/bond_hybrid.txt | 5 +- doc/dihedral_hybrid.html | 6 +- doc/dihedral_hybrid.txt | 6 +- doc/dump.html | 12 +- doc/dump.txt | 12 +- doc/fix.html | 2 + doc/fix.txt | 2 + doc/fix_wall_reflect.html | 8 -- doc/fix_wall_reflect.txt | 8 -- doc/improper_hybrid.html | 6 +- doc/improper_hybrid.txt | 6 +- doc/pair_gran.html | 16 ++- doc/pair_gran.txt | 16 ++- doc/read_data.html | 8 +- doc/read_data.txt | 8 +- doc/replicate.html | 17 ++- doc/replicate.txt | 17 ++- doc/reset_timestep.html | 15 +++ doc/reset_timestep.txt | 15 +++ doc/run.html | 8 ++ doc/run.txt | 8 ++ doc/special_bonds.html | 160 +++++++++++++---------- doc/special_bonds.txt | 155 ++++++++++++---------- doc/variable.html | 264 ++++++++++++++++++++++++++++++-------- doc/variable.txt | 260 +++++++++++++++++++++++++++++-------- 32 files changed, 747 insertions(+), 342 deletions(-) diff --git a/doc/Section_commands.html b/doc/Section_commands.html index da2fdbdeab..de14d53ccc 100644 --- a/doc/Section_commands.html +++ b/doc/Section_commands.html @@ -113,8 +113,8 @@ line are arguments.

(6) Text with spaces can be enclosed in double quotes so it will be treated as a single argument. See the dump modify or fix print commands for examples. A '#' or '$' -character that in text between double quotes will not be treated as a -comment or substituted for as a variable. +character that is in text between double quotes will not be treated as +a comment or substituted for as a variable.


@@ -317,14 +317,14 @@ in the command's documentation. of each style or click on the style itself for a full description:

- - - - - - - - + + + + + + +
addforceaveforceave/atomave/spatialave/timebond/swapcomcoord/original
deformdepositdragdt/resetefieldenforce2dfreezegravity
gyrationheatindentlangevinlineforcemsdmomentumnph
nptnpt/aspherenpt/spherenvenve/aspherenve/limitnve/noforcenve/sphere
nvtnvt/aspherenvt/sllodnvt/sphereorient/fccplaneforcepoemspour
press/berendsenprintrdfrecenterrigidsetforceshakespring
spring/rgspring/selftemp/berendsentemp/rescalethermal/conductivitytmdviscosityviscous
wall/granwall/lj126wall/lj93wall/reflectwiggle +
addforceaveforceave/atomave/spatialave/timebond/breakbond/createbond/swap
comcoord/originaldeformdepositdragdt/resetefieldenforce2d
freezegravitygyrationheatindentlangevinlineforcemsd
momentumnphnptnpt/aspherenpt/spherenvenve/aspherenve/limit
nve/noforcenve/spherenvtnvt/aspherenvt/sllodnvt/sphereorient/fccplaneforce
poemspourpress/berendsenprintrdfrecenterrigidsetforce
shakespringspring/rgspring/selftemp/berendsentemp/rescalethermal/conductivitytmd
viscosityviscouswall/granwall/lj126wall/lj93wall/reflectwiggle

These are fix styles contributed by users, which can be used if diff --git a/doc/Section_commands.txt b/doc/Section_commands.txt index 128cd551b4..d664460efc 100644 --- a/doc/Section_commands.txt +++ b/doc/Section_commands.txt @@ -110,8 +110,8 @@ line are arguments. (6) Text with spaces can be enclosed in double quotes so it will be treated as a single argument. See the "dump modify"_dump_modify.html or "fix print"_fix_print.html commands for examples. A '#' or '$' -character that in text between double quotes will not be treated as a -comment or substituted for as a variable. +character that is in text between double quotes will not be treated as +a comment or substituted for as a variable. :line @@ -380,6 +380,8 @@ of each style or click on the style itself for a full description: "ave/atom"_fix_ave_atom.html, "ave/spatial"_fix_ave_spatial.html, "ave/time"_fix_ave_time.html, +"bond/break"_fix_bond_break.html, +"bond/create"_fix_bond_create.html, "bond/swap"_fix_bond_swap.html, "com"_fix_com.html, "coord/original"_fix_coord_original.html, diff --git a/doc/Section_errors.html b/doc/Section_errors.html index 259f066071..f024e6f1a9 100644 --- a/doc/Section_errors.html +++ b/doc/Section_errors.html @@ -42,8 +42,8 @@ See the discussion of the loop option in the

Similarly, the create_atoms command generates a lattice of atoms. For the same physical system, the ordering and -numbering of atoms (atom ID or tag) may be different depending on the -number of processors. +numbering of atoms by atom ID may be different depending on the number +of processors.

Some commands use random number generators which may be setup to produce different random number streams on each processor and hence diff --git a/doc/Section_errors.txt b/doc/Section_errors.txt index fcdda91ff8..3908a23645 100644 --- a/doc/Section_errors.txt +++ b/doc/Section_errors.txt @@ -39,8 +39,8 @@ See the discussion of the {loop} option in the Similarly, the "create_atoms"_create_atoms.html command generates a lattice of atoms. For the same physical system, the ordering and -numbering of atoms (atom ID or tag) may be different depending on the -number of processors. +numbering of atoms by atom ID may be different depending on the number +of processors. Some commands use random number generators which may be setup to produce different random number streams on each processor and hence diff --git a/doc/angle_hybrid.html b/doc/angle_hybrid.html index 8f43f633cf..97e9163539 100644 --- a/doc/angle_hybrid.html +++ b/doc/angle_hybrid.html @@ -48,9 +48,8 @@ assigned to other hybrid styles, use the style name (e.g. "harmonic") appropriate to that style. The BondBond and BondAngle coeffs for that angle type will then be ignored.

-

An angle style of none can be specified as an argument to -angle_style hybrid and the corresponding angle_coeff commands, if you -desire to turn off certain angle types. +

An angle style of none can be specified as the 2nd argument to the +angle_coeff command, if you desire to turn off certain angle types.

Restrictions:

diff --git a/doc/angle_hybrid.txt b/doc/angle_hybrid.txt index 17883b25df..7e6a2f27e6 100644 --- a/doc/angle_hybrid.txt +++ b/doc/angle_hybrid.txt @@ -45,9 +45,8 @@ assigned to other hybrid styles, use the style name (e.g. "harmonic") appropriate to that style. The BondBond and BondAngle coeffs for that angle type will then be ignored. -An angle style of {none} can be specified as an argument to -angle_style hybrid and the corresponding angle_coeff commands, if you -desire to turn off certain angle types. +An angle style of {none} can be specified as the 2nd argument to the +angle_coeff command, if you desire to turn off certain angle types. [Restrictions:] diff --git a/doc/bond_hybrid.html b/doc/bond_hybrid.html index aeef272796..bdf750b8f5 100644 --- a/doc/bond_hybrid.html +++ b/doc/bond_hybrid.html @@ -41,9 +41,8 @@ coefficients 80.0, 1.2 for K, r0. All other bond types (2-N) would be computed with a fene potential with coefficients 30.0, 1.5, 1.0, 1.0 for K, R0, epsilon, sigma.

-

A bond style of none can be specified as an argument to bond_style -hybrid and the corresponding bond_coeff commands, if you desire to -turn off certain bond types. +

A bond style of none can be specified as the 2nd argument to the +bond_coeff command, if you desire to turn off certain bond types.

Restrictions:

diff --git a/doc/bond_hybrid.txt b/doc/bond_hybrid.txt index 50e6ab1356..9fb42206f2 100644 --- a/doc/bond_hybrid.txt +++ b/doc/bond_hybrid.txt @@ -38,9 +38,8 @@ coefficients 80.0, 1.2 for K, r0. All other bond types (2-N) would be computed with a {fene} potential with coefficients 30.0, 1.5, 1.0, 1.0 for K, R0, epsilon, sigma. -A bond style of {none} can be specified as an argument to bond_style -hybrid and the corresponding bond_coeff commands, if you desire to -turn off certain bond types. +A bond style of {none} can be specified as the 2nd argument to the +bond_coeff command, if you desire to turn off certain bond types. [Restrictions:] diff --git a/doc/dihedral_hybrid.html b/doc/dihedral_hybrid.html index 50e67db17c..63ce89a220 100644 --- a/doc/dihedral_hybrid.html +++ b/doc/dihedral_hybrid.html @@ -50,9 +50,9 @@ to other hybrid styles, use the style name (e.g. "harmonic") appropriate to that style. The MiddleBondTorsion, etc coeffs for that dihedral type will then be ignored.

-

A dihedral style of none can be specified as an argument to -dihedral_style hybrid and the corresponding dihedral_coeff commands, -if you desire to turn off certain dihedral types. +

A dihedral style of none can be specified as the 2nd argument to the +dihedral_coeff command, if you desire to turn off certain dihedral +types.

Restrictions:

diff --git a/doc/dihedral_hybrid.txt b/doc/dihedral_hybrid.txt index a8baa24d4a..f92fc490d6 100644 --- a/doc/dihedral_hybrid.txt +++ b/doc/dihedral_hybrid.txt @@ -47,9 +47,9 @@ to other hybrid styles, use the style name (e.g. "harmonic") appropriate to that style. The MiddleBondTorsion, etc coeffs for that dihedral type will then be ignored. -A dihedral style of {none} can be specified as an argument to -dihedral_style hybrid and the corresponding dihedral_coeff commands, -if you desire to turn off certain dihedral types. +A dihedral style of {none} can be specified as the 2nd argument to the +dihedral_coeff command, if you desire to turn off certain dihedral +types. [Restrictions:] diff --git a/doc/dump.html b/doc/dump.html index 0e362ba388..001b876a8c 100644 --- a/doc/dump.html +++ b/doc/dump.html @@ -33,7 +33,7 @@ xtc args = none xyz args = none custom args = list of atom attributes - possible attributes = tag, mol, type, + possible attributes = id, mol, type, x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz, vx, vy, vz, fx, fy, fz, q, mux, muy, muz, @@ -41,7 +41,7 @@ angmomx, angmomy, angmomz, quatw, quati, quatj, quatk, tqx, tqy, tqz, c_ID, c_ID[N], f_ID, f_ID[N], v_name - tag = atom ID + id = atom ID mol = molecule ID type = atom type x,y,z = unscaled atom coordinates @@ -69,8 +69,8 @@

dump myDump all atom 100 dump.atom
 dump 2 subgroup atom 50 dump.run.bin
-dump 4a all custom 100 dump.myforce.* tag type x y vx fx
-dump 4b flow custom 100 dump.%.myforce tag type c_myF[3] v_ke
+dump 4a all custom 100 dump.myforce.* id type x y vx fx
+dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke
 dump 1 all xtc 1000 file.xtc 
 

Description: @@ -229,8 +229,8 @@ styles.

This section explains the atom quantities that can be specified as part of the custom style.

-

The tag, mol, type, x, y, z, vx, vy, vz, fx, fy, -fz, q keywords are self-explanatory. Tag is the atom ID. Mol +

The id, mol, type, x, y, z, vx, vy, vz, fx, fy, +fz, q keywords are self-explanatory. Id is the atom ID. Mol is the molecule ID, included in the data file for molecular systems. The x, y, z keywords write atom coordinates "unscaled", in the appropriate distance units (Angstroms, sigma, etc). Use diff --git a/doc/dump.txt b/doc/dump.txt index b700d71fec..348df6b427 100644 --- a/doc/dump.txt +++ b/doc/dump.txt @@ -24,7 +24,7 @@ args = list of arguments for a particular style :l {xtc} args = none {xyz} args = none {custom} args = list of atom attributes - possible attributes = tag, mol, type, + possible attributes = id, mol, type, x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz, vx, vy, vz, fx, fy, fz, q, mux, muy, muz, @@ -32,7 +32,7 @@ args = list of arguments for a particular style :l angmomx, angmomy, angmomz, quatw, quati, quatj, quatk, tqx, tqy, tqz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name - tag = atom ID + id = atom ID mol = molecule ID type = atom type x,y,z = unscaled atom coordinates @@ -59,8 +59,8 @@ args = list of arguments for a particular style :l dump myDump all atom 100 dump.atom dump 2 subgroup atom 50 dump.run.bin -dump 4a all custom 100 dump.myforce.* tag type x y vx fx -dump 4b flow custom 100 dump.%.myforce tag type c_myF\[3\] v_ke +dump 4a all custom 100 dump.myforce.* id type x y vx fx +dump 4b flow custom 100 dump.%.myforce id type c_myF\[3\] v_ke dump 1 all xtc 1000 file.xtc :pre [Description:] @@ -219,8 +219,8 @@ styles. This section explains the atom quantities that can be specified as part of the {custom} style. -The {tag}, {mol}, {type}, {x}, {y}, {z}, {vx}, {vy}, {vz}, {fx}, {fy}, -{fz}, {q} keywords are self-explanatory. {Tag} is the atom ID. {Mol} +The {id}, {mol}, {type}, {x}, {y}, {z}, {vx}, {vy}, {vz}, {fx}, {fy}, +{fz}, {q} keywords are self-explanatory. {Id} is the atom ID. {Mol} is the molecule ID, included in the data file for molecular systems. The {x}, {y}, {z} keywords write atom coordinates "unscaled", in the appropriate distance "units"_units.html (Angstroms, sigma, etc). Use diff --git a/doc/fix.html b/doc/fix.html index 41e46c1ab7..abb6410e7f 100644 --- a/doc/fix.html +++ b/doc/fix.html @@ -108,6 +108,8 @@ list of fix styles available in LAMMPS:

  • ave/atom - compute per-atom time-averaged quantities
  • ave/spatial - output per-atom quantities by layer
  • ave/time - output time-averaged compute quantities +
  • bond/break - break bonds on the fly +
  • bond/create - create bonds on the fly
  • bond/swap - Monte Carlo bond swapping
  • com - compute a center-of-mass
  • coord/original - store original coords of each atom diff --git a/doc/fix.txt b/doc/fix.txt index 7b84ab4c0c..ba410b95ff 100644 --- a/doc/fix.txt +++ b/doc/fix.txt @@ -105,6 +105,8 @@ list of fix styles available in LAMMPS: "ave/atom"_fix_ave_atom.html - compute per-atom time-averaged quantities "ave/spatial"_fix_ave_spatial.html - output per-atom quantities by layer "ave/time"_fix_ave_time.html - output time-averaged compute quantities +"bond/break"_fix_bond_break.html - break bonds on the fly +"bond/create"_fix_bond_create.html - create bonds on the fly "bond/swap"_fix_bond_swap.html - Monte Carlo bond swapping "com"_fix_com.html - compute a center-of-mass "coord/original"_fix_coord_original.html - store original coords of each atom diff --git a/doc/fix_wall_reflect.html b/doc/fix_wall_reflect.html index 52f5bbbdb8..80750d5605 100644 --- a/doc/fix_wall_reflect.html +++ b/doc/fix_wall_reflect.html @@ -43,14 +43,6 @@ the corresponding timestep asymmetrically, energy conservation is only satisfied to O(dt), rather than to O(dt^2) as it would be for velocity-Verlet integration without reflective walls.

    -

    IMPORTANT NOTE: This fix performs its operations at the same point in -the timestep as other time integration fixes, such as fix -nve, fix nvt, or fix npt. -Thus fix wall/reflect should normally be the last such fix specified -in the input script, since the adjustments it makes to atom -coordinates should come after the changes made by time integration. -LAMMPS will warn you if your fixes are not ordered this way. -

    Restart, fix_modify, output, run start/stop, minimize info:

    No information about this fix is written to binary restart diff --git a/doc/fix_wall_reflect.txt b/doc/fix_wall_reflect.txt index 14a3a4e7ff..22c8de4097 100644 --- a/doc/fix_wall_reflect.txt +++ b/doc/fix_wall_reflect.txt @@ -40,14 +40,6 @@ the corresponding timestep asymmetrically, energy conservation is only satisfied to O(dt), rather than to O(dt^2) as it would be for velocity-Verlet integration without reflective walls. -IMPORTANT NOTE: This fix performs its operations at the same point in -the timestep as other time integration fixes, such as "fix -nve"_fix_nve.html, "fix nvt"_fix_nvt.html, or "fix npt"_fix_npt.html. -Thus fix wall/reflect should normally be the last such fix specified -in the input script, since the adjustments it makes to atom -coordinates should come after the changes made by time integration. -LAMMPS will warn you if your fixes are not ordered this way. - [Restart, fix_modify, output, run start/stop, minimize info:] No information about this fix is written to "binary restart diff --git a/doc/improper_hybrid.html b/doc/improper_hybrid.html index bd7b5c7ed6..981fc7945a 100644 --- a/doc/improper_hybrid.html +++ b/doc/improper_hybrid.html @@ -49,9 +49,9 @@ to other hybrid styles, use the style name (e.g. "harmonic") appropriate to that style. The AngleAngle coeffs for that improper type will then be ignored.

    -

    An improper style of none can be specified as an argument to -improper_style hybrid and the corresponding improper_coeff commands, -if you desire to turn off certain improper types. +

    An improper style of none can be specified as the 2nd argument to +the improper_coeff command, if you desire to turn off certain improper +types.

    Restrictions:

    diff --git a/doc/improper_hybrid.txt b/doc/improper_hybrid.txt index 9c5e074fa3..6a17b82ee4 100644 --- a/doc/improper_hybrid.txt +++ b/doc/improper_hybrid.txt @@ -46,9 +46,9 @@ to other hybrid styles, use the style name (e.g. "harmonic") appropriate to that style. The AngleAngle coeffs for that improper type will then be ignored. -An improper style of {none} can be specified as an argument to -improper_style hybrid and the corresponding improper_coeff commands, -if you desire to turn off certain improper types. +An improper style of {none} can be specified as the 2nd argument to +the improper_coeff command, if you desire to turn off certain improper +types. [Restrictions:] diff --git a/doc/pair_gran.html b/doc/pair_gran.html index 1682dcd117..0adbe7cb05 100644 --- a/doc/pair_gran.html +++ b/doc/pair_gran.html @@ -74,9 +74,19 @@ The tangential force between 2 particles grows according to a tangential spring and dash-pot model until Ft/Fn = xmu and is then held at Ft = Fn*xmu until the particles lose contact.

    -

    For granular styles there are no individual atom type coefficients -that can be set via the pair_coeff command. All -global settings are made via the pair_style command. +

    For granular styles there are no additional coefficients to set for +each pair of atom types via the pair_coeff command. +All settings are global and are made via the pair_style command. +However you must still use the pair_coeff for all +pairs of granular atom types. For example the command +

    +
    pair_coeff * * 
    +
    +

    should be used if all atoms in the simulation interact via a granular +potential. If a granular potential is used as part of pair_style +hybrid, then specific atom types can be used in the +pair_coeff command to determine which atoms interact via a granular +potential.

    See the citation below for more discussion of granular potentials.

    diff --git a/doc/pair_gran.txt b/doc/pair_gran.txt index 513ca7ee87..c5d2f4bfb1 100644 --- a/doc/pair_gran.txt +++ b/doc/pair_gran.txt @@ -66,9 +66,19 @@ The tangential force between 2 particles grows according to a tangential spring and dash-pot model until Ft/Fn = xmu and is then held at Ft = Fn*xmu until the particles lose contact. -For granular styles there are no individual atom type coefficients -that can be set via the "pair_coeff"_pair_coeff.html command. All -global settings are made via the pair_style command. +For granular styles there are no additional coefficients to set for +each pair of atom types via the "pair_coeff"_pair_coeff.html command. +All settings are global and are made via the pair_style command. +However you must still use the "pair_coeff"_pair_coeff.html for all +pairs of granular atom types. For example the command + +pair_coeff * * :pre + +should be used if all atoms in the simulation interact via a granular +potential. If a granular potential is used as part of "pair_style +hybrid"_pair_hybrid.html, then specific atom types can be used in the +pair_coeff command to determine which atoms interact via a granular +potential. See the citation below for more discussion of granular potentials. diff --git a/doc/read_data.html b/doc/read_data.html index e484763c11..612f0df44b 100644 --- a/doc/read_data.html +++ b/doc/read_data.html @@ -78,6 +78,7 @@ is different than the default.
  • angle types = # of angle types in system
  • dihedral types = # of dihedral types in system
  • improper types = # of improper types in system +
  • extra bond per atom = leave space for this many new bonds per atom
  • xlo xhi = simulation box boundaries in x dimension
  • ylo yhi = simulation box boundaries in y dimension
  • zlo zhi = simulation box boundaries in z dimension @@ -87,7 +88,7 @@ is different than the default. In any dimension, the system may be periodic or non-periodic; see the boundary command.

    -

    If the xy xz yz line does not appear, then LAMMPS will set up an +

    If the xy xz yz line does not appear, LAMMPS will set up an axis-aligned (orthogonal) simulation box. If the line does appear, LAMMPS creates a non-orthogonal simulation domain shaped as a parallelepiped with triclinic symmetry. See the region @@ -139,6 +140,11 @@ specified box size to layout the 3d grid of processors. A huge parallel simulation to lose atoms if LAMMPS shrink-wraps the box around the atoms.

    +

    The "extra bond per atom" setting should be used if new bonds will be +added to the system when a simulation runs, e.g. by using the fix +bond/create command. This will pre-allocate +space in LAMMPS data structures for storing the new bonds. +


    These are the section keywords for the body of the file. diff --git a/doc/read_data.txt b/doc/read_data.txt index e793f02dd9..85197862c3 100644 --- a/doc/read_data.txt +++ b/doc/read_data.txt @@ -73,6 +73,7 @@ is different than the default. {angle types} = # of angle types in system {dihedral types} = # of dihedral types in system {improper types} = # of improper types in system +{extra bond per atom} = leave space for this many new bonds per atom {xlo xhi} = simulation box boundaries in x dimension {ylo yhi} = simulation box boundaries in y dimension {zlo zhi} = simulation box boundaries in z dimension @@ -82,7 +83,7 @@ The initial simulation box size is determined by the lo/hi settings. In any dimension, the system may be periodic or non-periodic; see the "boundary"_boundary.html command. -If the {xy xz yz} line does not appear, then LAMMPS will set up an +If the {xy xz yz} line does not appear, LAMMPS will set up an axis-aligned (orthogonal) simulation box. If the line does appear, LAMMPS creates a non-orthogonal simulation domain shaped as a parallelepiped with triclinic symmetry. See the "region @@ -134,6 +135,11 @@ specified box size to layout the 3d grid of processors. A huge parallel simulation to lose atoms if LAMMPS shrink-wraps the box around the atoms. +The "extra bond per atom" setting should be used if new bonds will be +added to the system when a simulation runs, e.g. by using the "fix +bond/create"_fix_bond_create.html command. This will pre-allocate +space in LAMMPS data structures for storing the new bonds. + :line These are the section keywords for the body of the file. diff --git a/doc/replicate.html b/doc/replicate.html index 07f47e92cc..de49ff26ad 100644 --- a/doc/replicate.html +++ b/doc/replicate.html @@ -30,15 +30,14 @@ dimension. A replication factor of 1 in a dimension leaves the simulation domain unchanged.

    All properties of the atoms are replicated, including their -velocities, which may or may not be desirable. New atom IDs (tags) -are assigned to new atoms, as are molecule IDs. Bonds and other -topology interactions are created between pairs of new atoms as well -as between old and new atoms. This is done by using the image flag -for each atom to "unwrap" it out of the periodic box before -replicating it. This means that molecular bonds you specify in the -original data file that span the periodic box should be between two -atoms with image flags that differ by 1. This will allow them to be -unwrapped appropriately. +velocities, which may or may not be desirable. New atom IDs are +assigned to new atoms, as are molecule IDs. Bonds and other topology +interactions are created between pairs of new atoms as well as between +old and new atoms. This is done by using the image flag for each atom +to "unwrap" it out of the periodic box before replicating it. This +means that molecular bonds you specify in the original data file that +span the periodic box should be between two atoms with image flags +that differ by 1. This will allow them to be unwrapped appropriately.

    Restrictions:

    diff --git a/doc/replicate.txt b/doc/replicate.txt index f0091c0d6a..68619cc22a 100644 --- a/doc/replicate.txt +++ b/doc/replicate.txt @@ -27,15 +27,14 @@ dimension. A replication factor of 1 in a dimension leaves the simulation domain unchanged. All properties of the atoms are replicated, including their -velocities, which may or may not be desirable. New atom IDs (tags) -are assigned to new atoms, as are molecule IDs. Bonds and other -topology interactions are created between pairs of new atoms as well -as between old and new atoms. This is done by using the image flag -for each atom to "unwrap" it out of the periodic box before -replicating it. This means that molecular bonds you specify in the -original data file that span the periodic box should be between two -atoms with image flags that differ by 1. This will allow them to be -unwrapped appropriately. +velocities, which may or may not be desirable. New atom IDs are +assigned to new atoms, as are molecule IDs. Bonds and other topology +interactions are created between pairs of new atoms as well as between +old and new atoms. This is done by using the image flag for each atom +to "unwrap" it out of the periodic box before replicating it. This +means that molecular bonds you specify in the original data file that +span the periodic box should be between two atoms with image flags +that differ by 1. This will allow them to be unwrapped appropriately. [Restrictions:] diff --git a/doc/reset_timestep.html b/doc/reset_timestep.html index 165467758e..31bdc71630 100644 --- a/doc/reset_timestep.html +++ b/doc/reset_timestep.html @@ -45,6 +45,21 @@ write. See the undump command or fix +ave/spatial or fix +wall/lj126, and also fix +indent. The wall and indeter fixes allow for a +velocity or other time-dependent parameter to be specified, which +would be messed up by resetting the timestep. +

    +

    Restting the timestep will clear the flags for computes +that may have calculated some quantity from a previous run. This +means that quantity cannot be accessed by a variable in between runs +until a new run is performed. See the variable +command for more details. +

    Related commands: none

    Default: none diff --git a/doc/reset_timestep.txt b/doc/reset_timestep.txt index c791597311..3da3655276 100644 --- a/doc/reset_timestep.txt +++ b/doc/reset_timestep.txt @@ -42,6 +42,21 @@ write. See the "undump"_undump.html command or "restart if necessary. New specifications for dump and restart files can be given after the reset_timestep command is used. +This command cannot be used when any fixes are defined that keep track +of time or the timestep in order to perform time-dependent operations. +Examples include the "ave" or "wall" fixes such as "fix +ave/spatial"_fix_ave_spatial.html or "fix +wall/lj126"_fix_wall_lj126.html, and also "fix +indent"_fix_indent.html. The wall and indeter fixes allow for a +velocity or other time-dependent parameter to be specified, which +would be messed up by resetting the timestep. + +Restting the timestep will clear the flags for "computes"_compute.html +that may have calculated some quantity from a previous run. This +means that quantity cannot be accessed by a variable in between runs +until a new run is performed. See the "variable"_variable.html +command for more details. + [Related commands:] none [Default:] none diff --git a/doc/run.html b/doc/run.html index 08a3297cfc..c63fe422da 100644 --- a/doc/run.html +++ b/doc/run.html @@ -157,6 +157,14 @@ command (e.g. print "Protein Rg = $r" as in the example above). This means that, if specified, the every option must be the last keyword used.

    +

    IMPORTANT NOTE: For the every option, if the command includes a +variable (e.g. $x or ${abc}), and you want the variable to be +evaluated afresh each time the command is invoked, then you should +enclose that command argument in double quotes, as in the "Protein Rg += $r" example above. If you don't do this, then the variable will be +substituted for only once initially when the run command is parsed, +just as occurs for any other command containing a variable. +

    If the pre and post options are set to "no" when used with the every keyword, then the 1st run will do the full setup and the last run will print the full timing summary, but these operations will be diff --git a/doc/run.txt b/doc/run.txt index 5d71dc481f..2e3b15c0e7 100644 --- a/doc/run.txt +++ b/doc/run.txt @@ -150,6 +150,14 @@ command (e.g. print "Protein Rg = $r" as in the example above). This means that, if specified, the {every} option must be the last keyword used. +IMPORTANT NOTE: For the {every} option, if the command includes a +variable (e.g. $x or $\{abc\}), and you want the variable to be +evaluated afresh each time the command is invoked, then you should +enclose that command argument in double quotes, as in the "Protein Rg += $r" example above. If you don't do this, then the variable will be +substituted for only once initially when the run command is parsed, +just as occurs for any other command containing a variable. + If the {pre} and {post} options are set to "no" when used with the {every} keyword, then the 1st run will do the full setup and the last run will print the full timing summary, but these operations will be diff --git a/doc/special_bonds.html b/doc/special_bonds.html index db52902779..73026d8d36 100644 --- a/doc/special_bonds.html +++ b/doc/special_bonds.html @@ -13,105 +13,125 @@

    Syntax:

    -
    special_bonds style args 
    +
    special_bonds keyword values ... 
     
    -
    • style = charmm or amber or dihedral or explicit (explicit can be omitted) +
      • one or more keyword/value pairs may be appended -
          charmm args = none
        -  amber args = none
        -  dihedral args = c1 c2 c3 c4 c5 c6
        -    c1,c2,c3 = weights (0.0 to 1.0) on pairwise Lennard-Jones interactions (and Coulomb if c4,c5,c6 are not specified)
        -    c4,c5,c6 = weights (0.0 to 1.0) on pairwise Coulomb interactions (optional)
        -  explicit args = c1 c2 c3 c4 c5 c6
        -    c1,c2,c3 = weights (0.0 to 1.0) on pairwise Lennard-Jones interactions (and Coulomb if c4,c5,c6 are not specified)
        -    c4,c5,c6 = weights (0.0 to 1.0) on pairwise Coulomb interactions (optional) 
        +
      • keyword = amber or charmm or fene or lj/coul or lj or coul or dihedral or extra + +
          amber values = none
        +  charmm values = none
        +  fene values = none
        +  lj/coul values = w1,w2,w3
        +    w1,w2,w3 = weights (0.0 to 1.0) on pairwise Lennard-Jones and Coulombic interactions
        +  lj values = w1,w2,w3
        +    w1,w2,w3 = weights (0.0 to 1.0) on pairwise Lennard-Jones interactions
        +  coul values = w1,w2,w3
        +    w1,w2,w3 = weights (0.0 to 1.0) on pairwise Coulombic interactions
        +  dihedral value = yes or no
        +  extra value = N
        +    N = number of extra 1-2,1-3,1-4 interactions to save space for 
         

      Examples:

      -
      special_bonds charmm
      -special_bonds amber
      -special_bonds dihedral 0.0 0.0 0.5
      -special_bonds explicit 0 1 1
      -special_bonds 0 1 1
      -special_bonds 0.0 0.0 1.0 0.0 0.0 0.5 
      +
      special_bonds amber
      +special_bonds charmm
      +special_bonds fene dihedral no
      +special_bonds lj/coul 0.0 0.0 0.5 dihedral yes
      +special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.0 dihedral yes
      +special_bonds lj/coul 0 1 1 extra 2 
       

      Description:

      -

      Set the weighting coefficients for the pairwise force and energy -contributions from atom pairs that are also bonded to each other -directly or indirectly. For Lennard-Jones and Coulombic pairwise -interactions, the 1st coefficient is the weighting factor on 1-2 atom -pairs, which are those directly bonded to each other. The 2nd -coefficient is the weighting factor on 1-3 atom pairs which are those -separated by 2 bonds (e.g. the 2 H atoms in a water molecule). The -3rd coefficient is the weighting factor on 1-4 atom pairs which are -separated by 3 bonds (e.g. the 1st and 4th atoms in a dihedral -interaction). +

      Set weighting coefficients for pairwise energy and force contributions +from atom pairs that are also bonded to each other directly or +indirectly. For Lennard-Jones (LJ) and Coulombic pairwise +interactions, these coefficients come in sets of three. The 1st +coefficient is the weighting factor on 1-2 atom pairs, which are those +directly bonded to each other. The 2nd coefficient is the weighting +factor on 1-3 atom pairs which are those separated by 2 bonds +(e.g. the two H atoms in a water molecule). The 3rd coefficient is +the weighting factor on 1-4 atom pairs which are those separated by 3 +bonds (e.g. the 1st and 4th atoms in a dihedral interaction). Thus if +the 1-2 coefficient is set to 0.0, then the pairwise interaction is +effectively turned off for all pairs of atoms bonded to each other.

      -

      Note that for purposes of computing weighted pairwise interactions, -1-3 and 1-4 interactions are NOT defined from the list of angles or -dihedrals used by the simulation. Rather, they are inferred -topologically by the set of bonds defined when atoms are read in from -a file (read_data or -read_restart). Thus the set of 1-2,1-3,1-4 -interactions is the same whether angle and dihedral potentials are +

      IMPORTANT NOTE: For purposes of computing weighted pairwise +interactions, 1-3 and 1-4 interactions are not defined from the list +of angles or dihedrals used by the simulation. Rather, they are +inferred topologically from the set of bonds defined when the +simulation is defined from a data or restart file (see +read_data or read_restart +commands). Thus the set of 1-2,1-3,1-4 interactions that the weights +apply to is the same whether angle and dihedral potentials are computed or not, and remains the same even if bonds are constrained, or turned off, or removed during a simulation.

      -

      The two exceptions to this rule are (a) if the special_bonds -dihedral style is used (see below), or (b) if the +

      The two exceptions to this rule are (a) if the dihedral keyword is +set to yes (see below), or (b) if the delete_bonds command is used with the special option that recomputes the 1-2,1-3,1-4 topologies after bonds are deleted; see the delete_bonds command for more details.

      -

      The charmm style sets all 3 coefficients to 0.0 for both LJ and -Coulombic interactions, which is the default for the CHARMM force -field. In pair styles lj/charmm/coul/charmm and -lj/charmm/coul/long the 1-4 coefficients are defined explicitly, and -these pair-wise contributions are computed in the charmm dihedral -style - see the pair_coeff and -dihedral_style commands for more information. -

      -

      The amber style sets the 3 coefficients to 0.0 0.0 0.5 for LJ -interactions and to 0.0 0.0 0.8333 for Coulombic interactions, which -is the default for a particular version of the AMBER force field, +

      The amber keyword sets the 3 coefficients to 0.0, 0.0, 0.5 for LJ +interactions and to 0.0, 0.0, 0.8333 for Coulombic interactions, which +is the default for a commonly used version of the AMBER force field, where the last value is really 5/6.

      -

      The dihedral style requires you to set 3 or 6 coefficients (see the -explicit style), but it turns off the 1-4 weighting factor for -individual atom pairs if they are not listed as the first and last +

      The charmm keyword sets the 3 coefficients to 0.0, 0.0, 0.0 for both +LJ and Coulombic interactions, which is the default for a commonly +used version of the CHARMM force field. Note that in pair styles +lj/charmm/coul/charmm and lj/charmm/coul/long the 1-4 coefficients +are defined explicitly, and these pairwise contributions are computed +as part of the charmm dihedral style - see the +pair_coeff and dihedral_style +commands for more information. +

      +

      The fene keyword sets the 3 coefficients to 0.0, 1.0, 1.0 for both +LJ and Coulombic interactions, which is consistent with a +coarse-grained polymer model with FENE bonds. +

      +

      The lj/coul, lj, and coul keywords allow the 3 coefficients to +be set explicitly. The lj/coul keyword sets both the LJ and +Coulombic coefficients to the same 3 values. The lj and coul +keywords only set either the LJ or Coulombic coefficients. Use both +of them if you wish to set the LJ coefficients to different values +than the Coulombic coefficients. +

      +

      The dihedral keyword allows the 1-4 weighting factor to be ignored +for individual atom pairs if they are not listed as the first and last atoms in any dihedral defined in the simulation. For example, imagine -you have set the 1-4 weighting factor to 0.5 and you have a linear -molecule with 5 atoms and bonds as follows: 1-2-3-4-5. If your data -file defines 1-2-3-4 as a dihedral, but does not define 2-3-4-5 as a -dihedral, then the pairwise interaction between atoms 1 and 4 will be -weighted by 0.5, but the interaction between atoms 2 and 5 will be -unaffected (full weighting of 1.0). Note that if any of the other -special_bond styles are used, then the 2,5 interaction would also be -weighted by 0.5. The dihedral style is provided because some force -fields follow this rule. +the 1-4 weighting factor is set to 0.5 and you have a linear molecule +with 5 atoms and bonds as follows: 1-2-3-4-5. If your data file +defines 1-2-3-4 as a dihedral, but does not define 2-3-4-5 as a +dihedral, then the pairwise interaction between atoms 1 and 4 will +always be weighted by 0.5, but different force fields use different +rules for weighting the pairwise interaction between atoms 2 and 5. +If the dihedral keyword is specified as yes, then the pairwise +interaction between atoms 2 and 5 will be unaffected (full weighting +of 1.0). If the dihedral keyword is specified as no which is the +default, then the 2,5 interaction will also be weighted by 0.5.

      -

      The explicit style requires you to set 3 or 6 coefficients directly. -If 3 are specified, they are used for both LJ and Coulombic -interactions. If 6 are specified then the first 3 are LJ coefficients -and the second 3 are Coulombic coefficients. Note that the explicit -keyword itself is optional; the special_bonds command can just take 3 -or 6 numeric arguments by themselves. -

      -

      IMPORTANT NOTE: For a lj units system with FENE -bonds a setting of special bonds 0 1 1 should be used. +

      The extra keyword is used when additional bonds will be created +during a simulation run, e.g. by the fix +bond/create command. A list of 1-2,1-3,1-4 +neighbors for each atom is calculated and stored by LAMMPS. If new +bonds are created, the list needs to grow. Using the extra keyword +leaves empty space in the list for N additional bonds to be added. If +you do not do this, you may get an error when bonds are added.

      Restrictions: none

      Related commands:

      -

      delete_bonds +

      delete_bonds, fix bond/create

      Default:

      -
      special_bonds 0.0 0.0 0.0 
      -
      +

      All 3 Lennard-Jones and 3 Coulobmic weighting coefficients = 0.0, +dihedral = no, and extra = 0. +

      diff --git a/doc/special_bonds.txt b/doc/special_bonds.txt index 80edb4c4a6..7d33897e16 100644 --- a/doc/special_bonds.txt +++ b/doc/special_bonds.txt @@ -10,101 +10,120 @@ special_bonds command :h3 [Syntax:] -special_bonds style args :pre +special_bonds keyword values ... :pre -style = {charmm} or {amber} or {dihedral} or {explicit} ({explicit} can be omitted) :ulb,l - {charmm} args = none - {amber} args = none - {dihedral} args = c1 c2 c3 c4 c5 c6 - c1,c2,c3 = weights (0.0 to 1.0) on pairwise Lennard-Jones interactions (and Coulomb if c4,c5,c6 are not specified) - c4,c5,c6 = weights (0.0 to 1.0) on pairwise Coulomb interactions (optional) - {explicit} args = c1 c2 c3 c4 c5 c6 - c1,c2,c3 = weights (0.0 to 1.0) on pairwise Lennard-Jones interactions (and Coulomb if c4,c5,c6 are not specified) - c4,c5,c6 = weights (0.0 to 1.0) on pairwise Coulomb interactions (optional) :pre +one or more keyword/value pairs may be appended :ulb,l +keyword = {amber} or {charmm} or {fene} or {lj/coul} or {lj} or {coul} or {dihedral} or {extra} :l + {amber} values = none + {charmm} values = none + {fene} values = none + {lj/coul} values = w1,w2,w3 + w1,w2,w3 = weights (0.0 to 1.0) on pairwise Lennard-Jones and Coulombic interactions + {lj} values = w1,w2,w3 + w1,w2,w3 = weights (0.0 to 1.0) on pairwise Lennard-Jones interactions + {coul} values = w1,w2,w3 + w1,w2,w3 = weights (0.0 to 1.0) on pairwise Coulombic interactions + {dihedral} value = {yes} or {no} + {extra} value = N + N = number of extra 1-2,1-3,1-4 interactions to save space for :pre :ule Examples: -special_bonds charmm special_bonds amber -special_bonds dihedral 0.0 0.0 0.5 -special_bonds explicit 0 1 1 -special_bonds 0 1 1 -special_bonds 0.0 0.0 1.0 0.0 0.0 0.5 :pre +special_bonds charmm +special_bonds fene dihedral no +special_bonds lj/coul 0.0 0.0 0.5 dihedral yes +special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.0 dihedral yes +special_bonds lj/coul 0 1 1 extra 2 :pre [Description:] -Set the weighting coefficients for the pairwise force and energy -contributions from atom pairs that are also bonded to each other -directly or indirectly. For Lennard-Jones and Coulombic pairwise -interactions, the 1st coefficient is the weighting factor on 1-2 atom -pairs, which are those directly bonded to each other. The 2nd -coefficient is the weighting factor on 1-3 atom pairs which are those -separated by 2 bonds (e.g. the 2 H atoms in a water molecule). The -3rd coefficient is the weighting factor on 1-4 atom pairs which are -separated by 3 bonds (e.g. the 1st and 4th atoms in a dihedral -interaction). +Set weighting coefficients for pairwise energy and force contributions +from atom pairs that are also bonded to each other directly or +indirectly. For Lennard-Jones (LJ) and Coulombic pairwise +interactions, these coefficients come in sets of three. The 1st +coefficient is the weighting factor on 1-2 atom pairs, which are those +directly bonded to each other. The 2nd coefficient is the weighting +factor on 1-3 atom pairs which are those separated by 2 bonds +(e.g. the two H atoms in a water molecule). The 3rd coefficient is +the weighting factor on 1-4 atom pairs which are those separated by 3 +bonds (e.g. the 1st and 4th atoms in a dihedral interaction). Thus if +the 1-2 coefficient is set to 0.0, then the pairwise interaction is +effectively turned off for all pairs of atoms bonded to each other. -Note that for purposes of computing weighted pairwise interactions, -1-3 and 1-4 interactions are NOT defined from the list of angles or -dihedrals used by the simulation. Rather, they are inferred -topologically by the set of bonds defined when atoms are read in from -a file ("read_data"_read_data.html or -"read_restart"_read_restart.html). Thus the set of 1-2,1-3,1-4 -interactions is the same whether angle and dihedral potentials are +IMPORTANT NOTE: For purposes of computing weighted pairwise +interactions, 1-3 and 1-4 interactions are not defined from the list +of angles or dihedrals used by the simulation. Rather, they are +inferred topologically from the set of bonds defined when the +simulation is defined from a data or restart file (see +"read_data"_read_data.html or "read_restart"_read_restart.html +commands). Thus the set of 1-2,1-3,1-4 interactions that the weights +apply to is the same whether angle and dihedral potentials are computed or not, and remains the same even if bonds are constrained, or turned off, or removed during a simulation. -The two exceptions to this rule are (a) if the special_bonds -{dihedral} style is used (see below), or (b) if the +The two exceptions to this rule are (a) if the {dihedral} keyword is +set to {yes} (see below), or (b) if the "delete_bonds"_delete_bonds.html command is used with the {special} option that recomputes the 1-2,1-3,1-4 topologies after bonds are deleted; see the "delete_bonds"_delete_bonds.html command for more details. -The {charmm} style sets all 3 coefficients to 0.0 for both LJ and -Coulombic interactions, which is the default for the CHARMM force -field. In pair styles {lj/charmm/coul/charmm} and -{lj/charmm/coul/long} the 1-4 coefficients are defined explicitly, and -these pair-wise contributions are computed in the charmm dihedral -style - see the "pair_coeff"_pair_coeff.html and -"dihedral_style"_dihedral_style.html commands for more information. - -The {amber} style sets the 3 coefficients to 0.0 0.0 0.5 for LJ -interactions and to 0.0 0.0 0.8333 for Coulombic interactions, which -is the default for a particular version of the AMBER force field, +The {amber} keyword sets the 3 coefficients to 0.0, 0.0, 0.5 for LJ +interactions and to 0.0, 0.0, 0.8333 for Coulombic interactions, which +is the default for a commonly used version of the AMBER force field, where the last value is really 5/6. -The {dihedral} style requires you to set 3 or 6 coefficients (see the -{explicit} style), but it turns off the 1-4 weighting factor for -individual atom pairs if they are not listed as the first and last +The {charmm} keyword sets the 3 coefficients to 0.0, 0.0, 0.0 for both +LJ and Coulombic interactions, which is the default for a commonly +used version of the CHARMM force field. Note that in pair styles +{lj/charmm/coul/charmm} and {lj/charmm/coul/long} the 1-4 coefficients +are defined explicitly, and these pairwise contributions are computed +as part of the charmm dihedral style - see the +"pair_coeff"_pair_coeff.html and "dihedral_style"_dihedral_style.html +commands for more information. + +The {fene} keyword sets the 3 coefficients to 0.0, 1.0, 1.0 for both +LJ and Coulombic interactions, which is consistent with a +coarse-grained polymer model with "FENE bonds"_bond_fene.html. + +The {lj/coul}, {lj}, and {coul} keywords allow the 3 coefficients to +be set explicitly. The {lj/coul} keyword sets both the LJ and +Coulombic coefficients to the same 3 values. The {lj} and {coul} +keywords only set either the LJ or Coulombic coefficients. Use both +of them if you wish to set the LJ coefficients to different values +than the Coulombic coefficients. + +The {dihedral} keyword allows the 1-4 weighting factor to be ignored +for individual atom pairs if they are not listed as the first and last atoms in any dihedral defined in the simulation. For example, imagine -you have set the 1-4 weighting factor to 0.5 and you have a linear -molecule with 5 atoms and bonds as follows: 1-2-3-4-5. If your data -file defines 1-2-3-4 as a dihedral, but does not define 2-3-4-5 as a -dihedral, then the pairwise interaction between atoms 1 and 4 will be -weighted by 0.5, but the interaction between atoms 2 and 5 will be -unaffected (full weighting of 1.0). Note that if any of the other -special_bond styles are used, then the 2,5 interaction would also be -weighted by 0.5. The {dihedral} style is provided because some force -fields follow this rule. +the 1-4 weighting factor is set to 0.5 and you have a linear molecule +with 5 atoms and bonds as follows: 1-2-3-4-5. If your data file +defines 1-2-3-4 as a dihedral, but does not define 2-3-4-5 as a +dihedral, then the pairwise interaction between atoms 1 and 4 will +always be weighted by 0.5, but different force fields use different +rules for weighting the pairwise interaction between atoms 2 and 5. +If the {dihedral} keyword is specified as {yes}, then the pairwise +interaction between atoms 2 and 5 will be unaffected (full weighting +of 1.0). If the {dihedral} keyword is specified as {no} which is the +default, then the 2,5 interaction will also be weighted by 0.5. -The {explicit} style requires you to set 3 or 6 coefficients directly. -If 3 are specified, they are used for both LJ and Coulombic -interactions. If 6 are specified then the first 3 are LJ coefficients -and the second 3 are Coulombic coefficients. Note that the {explicit} -keyword itself is optional; the special_bonds command can just take 3 -or 6 numeric arguments by themselves. - -IMPORTANT NOTE: For a "lj units"_units.html system with "FENE -bonds"_bond_fene.html a setting of special bonds 0 1 1 should be used. +The {extra} keyword is used when additional bonds will be created +during a simulation run, e.g. by the "fix +bond/create"_fix_bond_create.html command. A list of 1-2,1-3,1-4 +neighbors for each atom is calculated and stored by LAMMPS. If new +bonds are created, the list needs to grow. Using the {extra} keyword +leaves empty space in the list for N additional bonds to be added. If +you do not do this, you may get an error when bonds are added. [Restrictions:] none [Related commands:] -"delete_bonds"_delete_bonds.html +"delete_bonds"_delete_bonds.html, "fix bond/create"_fix_bond_create.html [Default:] -special_bonds 0.0 0.0 0.0 :pre +All 3 Lennard-Jones and 3 Coulobmic weighting coefficients = 0.0, +dihedral = no, and extra = 0. diff --git a/doc/variable.html b/doc/variable.html index 448f2d9f33..8c193daa2b 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -69,17 +69,18 @@ evaluation later in the input script or during a simulation. referenced elsewhere in an input script to become part of a new input command. For variable styles that store multiple strings, the next command can be used to increment which string is -assigned to the variable. Variables of style equal can be evaluated -to produce a single numeric value which can be output either directly -(see the print, fix print, and run -every commands) or as part of thermodynamic output (see the -thermo_style command), or used as input to an -averaging fix (see the fix ave/time command). -Variables of style atom can be evaluated to produce one numeric -value per atom which can be output to a dump file (see the dump -custom command) or used as input to an averaging fix (see -the fix ave/spatial and fix -ave/atom commands). +assigned to the variable. Variables of style equal store a formula +which when evaluated produces a single numeric value which can be +output either directly (see the print, fix +print, and run every commands) or as part +of thermodynamic output (see the thermo_style +command), or used as input to an averaging fix (see the fix +ave/time command). Variables of style atom store a +formula which when evaluated produces one numeric value per atom which +can be output to a dump file (see the dump custom command) +or used as input to an averaging fix (see the fix +ave/spatial and fix ave/atom +commands).

      In the discussion that follows, the "name" of the variable is the arbitrary string that is the 1st argument in the variable command. @@ -92,6 +93,12 @@ evaluation of the string. Note that the same string can generate different values when it is evaluated at different times during a simulation.

      +

      IMPORTANT NOTE: When the input script line that defines a variable of +style equal or atom that contain a formula is encountered, the +formula is NOT immediately evaluated and the result stored. See the +discussion below about "Immediate Evaluation of Variables" if you want +to do this. +

      IMPORTANT NOTE: When a variable command is encountered in the input script and the variable name has already been specified, the command is ignored. This means variables can NOT be re-defined in an input @@ -104,9 +111,9 @@ script.

      There are two exceptions to this rule. First, variables of style equal and atom ARE redefined each time the command is encountered. -This allows them to be reset, when their formulas contain a -substitution for another variable, e.g. $x. This can be useful in a -loop. +This only changes their associated formula if the formula contains a +substitution for another variable, e.g. $x. But that can be useful, +for example, in a loop.

      Second, as described below, if a variable is iterated on to the end of its list of strings via the next command, it is removed @@ -214,7 +221,10 @@ atom whenever it is evaluated. different stages of the input script or at different times during a run. For example, if an equal variable is used in a fix print command, different values could be printed each -timestep it was invoked. +timestep it was invoked. If you want a variable to be evaluated +immediately, so that the result is stored by the variable instead of +the string, see the section below on "Immediate Evaluation of +Variables".

      The next command cannot be used with equal or atom style variables, since there is only one string. @@ -253,10 +263,17 @@ can use formula elements that produce either global values or per-atom values.

      The thermo keywords allowed in a formula are those defined by the -"thermo_style custom" command. Since many thermodynamic quantities -are only computable after the a simulation has begun, these keywords -cannot be used if a variable is evaluated before the first simulation -begins. +"thermo_style custom" command. Thermo keywords that require a +compute to calculate their values such as "temp" or +"press", use computes stored and invoked by the thermo_style command. +This means that you can only use those keywords in a variable if the +style you are using with the thermo_style command (and the thermo +keywords associated with that style) also define and use the needed +compute. Note that some thermo keywords use a compute indirectly to +calculate their value (e.g. the enthalpy keyword uses temp, pe, and +pressure). If a variable is evaluated in an input script (not during +a run), then the values accessed by the thermo keyword must be +current. See the discussion below about "Variable Accuracy".

      Math operations are written in the usual way, where the "x" and "y" in the examples above can be another section of the formula. Operators @@ -300,7 +317,10 @@ See the doc pages for individual computes to see which ones calculate global versus per-atom quantities. If the compute reference contains empty brackets, then per-atom values calculated by the compute are accessed. Otherwise a single value (global or per-atom) calculated by -the compute is accessed. +the compute is accessed. If a variable containing a compute is +evaluated in an input script (not during a run), then the values +accessed by the compute must be current. See the discussion below +about "Variable Accuracy".

      The different kinds of compute references are as follows. M is a positive integer <= the number of vector values calculated by the @@ -321,14 +341,17 @@ actual ID of the fix defined elsewhere in the input script. See the doc pages for individual computes to see which ones calculate global versus per-atom quantities. If the fix reference contains empty brackets, then per-atom values calculated by the fix are accessed. -Otherwise a single value (global or per-atom) calculated by the -fix is accessed. +Otherwise a single value (global or per-atom) calculated by the fix is +accessed.

      Note that some fixes only generate quantities on certain timesteps. If a variable attempts to access the fix on non-allowed timesteps, an error is generated. For example, the fix ave/time command may only generate averaged quantities every 100 steps. See -the doc pages for individual fix commands for details. +the doc pages for individual fix commands for details. If a variable +containing a fix is evaluated in an input script (not during a run), +then the values accessed by the fix should be current. See the +discussion below about "Variable Accuracy".

      The different kinds of fix references are exactly the same as the compute references listed in the above table, where "c_" is replaced @@ -358,48 +381,177 @@ print $a


      -

      It is useful to understand the distinction between referencing a -variable in a formula using the $x form instead of v_x. There is a -subtle difference between the two references that has to do with when -the evaluation of the included variable is done. +

      Immediate Evaluation of Variables:

      -

      Referencing the variable as $x, the value of the include variable is -substituted for immediately when the line is read from the input -script, just as it would be in other input script command. +

      There is a difference between referencing a variable with a leading $ +sign (e.g. $x or ${abc}) versus with a leading "v_" (e.g. v_x or +v_abc). The former can be used in any command, including a variable +command, to force the immediate evaluation of the referenced variable +and the substitution of its value into the command. The latter is a +required kind of argument to some commands (e.g. the fix +ave/spatial or dump custom or +thermo_style commands) if you wish it to evaluate +a variable periodically during a run. It can also be used in a +variable formula if you wish to reference a second variable. The +second variable will be evaluated whenever the first variable is +evaluated.

      -

      This could be the desired behavior if a static value is desired. Or -it could be the desired behavior for an equal-style variable if the -variable command appears in a loop (see the jump and -next commands), since the substitution will be performed -anew each time thru the loop as the command is re-read. Note that if -the variable formula is enclosed in double quotes, this prevents -variable substitution and thus an error will be generated when the -variable formula is evaluated. +

      As an example, suppose you use this command in your input script to +define the variable "v" as

      -

      Referencing the variable as v_x, the value of the included variable -will not be accessed until the variable formula is evaluated. Thus -the value may change each time the evaluation is performed. This may -also be desired behavior. -

      -

      As an example, if the current simulation box volume is 1000.0, then -these lines: -

      -
      variable x equal vol
      -variable y equal 2*$x 
      +
      variable v equal vol 
       
      -

      will associate the equation string "2*1000.0" with variable y. +

      before a run where the simulation box size changes. You might think +this will assign the initial volume to the variable "v". That is not +the case. Rather it assigns a formula which evaluates the volume +(using the thermo_style keyword "vol") to the variable "v". If you +use the variable "v" in some other command like "fix ave/time" then +the current volume of the box will be evaluated continuously during +the run.

      -

      By contrast, these lines: +

      If you want to store the initial volume of the system, you can do it +this way:

      -
      variable x equal vol
      -variable y equal 2*v_x 
      +
      variable v equal vol
      +variable v0 equal $v 
       
      -

      will associate the equation string "2*v_x" with variable y. +

      The second command will force "v" to be evaluated (yielding the +initial volume) and assign that value to the variable "v0". Thus the +command

      -

      Thus if the variable y were evaluated periodically during a run where -the box volume changed, the resulting value would always be 2000.0 for -the first case, but would change dynamically for the second case. +

      thermo_style custom step v_v v_v0 
      +
      +

      would print out both the current and initial volume periodically +during the run.

      +

      Note that it is a mistake to enclose a variable formula in double +quotes if it contains variables preceeded by $ signs. For example, +

      +
      variable vratio equal "${vfinal}/${v0}" 
      +
      +

      This is because the quotes prevent variable substitution (see this +section on parsing input script commands), +and thus an error will occur when the formula for "vratio" is +evaluated later. +

      +
      + +

      Variable Accuracy: +

      +

      Obviously, LAMMPS attempts to evaluate variables containing formulas +(equal and atom style variables) accurately whenever the +evaluation is performed. Depending on what is included in the +formula, this may require invoking a compute, either +directly or indirectly via a thermo keyword, or accessing a value +calculated and stored by a fix. If the compute is one that +calculates the pressure or energy of the system, then these quantities +need to be tallied during the evaluation of the interatomic potentials +(pair, bond, etc) on timesteps that the variable will need the values. +

      +

      LAMMPS keeps track of all of this during a run or energy +minimization. An error will be generated if you +attempt to evaluate a variable on timesteps when it cannot produce +accurate values. For example, if a thermo_style +custom command prints a variable which accesses +values stored by a fix ave/time command and the +timesteps on which thermo output is generated are not multiples of the +averaging frequency used in the fix command, then it is an error. +

      +

      However, your input script can also require variables to be evaluated +before or after or inbetween runs. In this case, one of three things +may happen. +

      +

      (1) The variable may be evaluated accurately. If it contains +references to a compute or fix, and these values were calculated and +stored on the last timestep of a preceeding run, then they can be +accessed and used by the variable. +

      +

      (2) LAMMPS may not be able to evaluate the variable and generate an +error. For example, if the variable formula requires a +compute to be invoked, either directly or indirectly +via a thermo keyword, then the variable cannot be evaluated before the +first run has occurred. The general rule is that if a variable uses a +value calculated by a compute, and the variable is not being evaluated +during a run, then the variable will not invoke the compute. Instead, +it can only use the value stored by the compute, which for accuracy +requires that the compute was already invoked on the same timestep +during a preceeding run. +

      +

      Thus the way to get around this error is to perform a 0-timestep run +before using the variable. For example, these commands +

      +
      variable t equal temp
      +print "Initial temperature = $t"
      +run 1000 
      +
      +

      will generate an error if the run is the first run specified in the +input script, because generating a value for the "t" variable requires +a compute for calculating the temperature to be invoked. +

      +

      However, this sequence of commands would be fine: +

      +
      run 0
      +variable t equal temp
      +print "Initial temperature = $t"
      +run 1000 
      +
      +

      The 0-timestep run initializes and invokes various computes, including +the one for temperature, so that the value it stores is current and +can be accessed by the variable "t" after the run has completed. Note +that a 0-timestep run does not alter the state of the system, so it +does not change the input state for the 1000-timestep run that +follows. Also note, that the 0-timestep run must actually use and +invoke the compute in question (e.g. via thermo or +dump output) in order for it to enable the compute to be +used in a variable after the run. +

      +

      Note that unlike computes, fixes will never generate an +error if their values are accessed by a variable in between runs. +They always return some value to the variable. However, this value +may not be what you expect if the fix has not yet calculated the +quantity of interest. For example, the fix indent +command stores the force on the indenter. But this is not computed +until a run is performed. Thus if a variable attempts to print this +value before the first run, values of zero will be output. Again, +performing a 0-timestep run before printing the variable has the +desired effect. +

      +

      (3) The variable may be evaluated incorrectly. And LAMMPS may have +no way to detect this has occurred. Consider the following sequence +of commands: +

      +
      pair_coeff 1 1 1.0 1.0
      +run 1000
      +pair_coeff 1 1 1.5 1.0
      +variable e equal pe
      +print "Final potential energy = $e" 
      +
      +

      The first run is performed using one setting for the pairwise +potential defined by the pair_style and +pair_coeff commands. The potential energy is +evaluated on the final timestep and stored by the compute +pe compute (this is done by the +thermo_style command). Then a pair coefficient is +changed, altering the potential energy of the system. When the +potential energy is printed via the "e" variable, LAMMPS will use the +potential energy value stored by the compute pe +compute, thinking it is current. There are many other commands which +could alter the state of the system between runs, causing a variable +to evaluate incorrectly. +

      +

      The solution to this issue is the same as for case (2) above, namely +to perform a 0-timestep run before the variable is evaluated to insure +the system is up-to-date. For example, this sequence of commands +would print a potential energy that reflected the changed pairwise +coefficient: +

      +
      pair_coeff 1 1 1.0 1.0
      +run 1000
      +pair_coeff 1 1 1.5 1.0
      +run 0
      +variable e equal pe
      +print "Final potential energy = $e" 
      +

      Restrictions: diff --git a/doc/variable.txt b/doc/variable.txt index dfeaa006ac..d34d0fa5dd 100644 --- a/doc/variable.txt +++ b/doc/variable.txt @@ -63,17 +63,18 @@ Variables can be used in several ways in LAMMPS. A variable can be referenced elsewhere in an input script to become part of a new input command. For variable styles that store multiple strings, the "next"_next.html command can be used to increment which string is -assigned to the variable. Variables of style {equal} can be evaluated -to produce a single numeric value which can be output either directly -(see the "print"_print.html, "fix print"_fix_print.html, and "run -every"_run.html commands) or as part of thermodynamic output (see the -"thermo_style"_thermo_style.html command), or used as input to an -averaging fix (see the "fix ave/time"_fix_ave/time command). -Variables of style {atom} can be evaluated to produce one numeric -value per atom which can be output to a dump file (see the "dump -custom"_dump.html command) or used as input to an averaging fix (see -the "fix ave/spatial"_fix_ave_spatial.html and "fix -ave/atom"_fix_ave_atom.html commands). +assigned to the variable. Variables of style {equal} store a formula +which when evaluated produces a single numeric value which can be +output either directly (see the "print"_print.html, "fix +print"_fix_print.html, and "run every"_run.html commands) or as part +of thermodynamic output (see the "thermo_style"_thermo_style.html +command), or used as input to an averaging fix (see the "fix +ave/time"_fix_ave/time command). Variables of style {atom} store a +formula which when evaluated produces one numeric value per atom which +can be output to a dump file (see the "dump custom"_dump.html command) +or used as input to an averaging fix (see the "fix +ave/spatial"_fix_ave_spatial.html and "fix ave/atom"_fix_ave_atom.html +commands). In the discussion that follows, the "name" of the variable is the arbitrary string that is the 1st argument in the variable command. @@ -86,6 +87,12 @@ evaluation of the string. Note that the same string can generate different values when it is evaluated at different times during a simulation. +IMPORTANT NOTE: When the input script line that defines a variable of +style {equal} or {atom} that contain a formula is encountered, the +formula is NOT immediately evaluated and the result stored. See the +discussion below about "Immediate Evaluation of Variables" if you want +to do this. + IMPORTANT NOTE: When a variable command is encountered in the input script and the variable name has already been specified, the command is ignored. This means variables can NOT be re-defined in an input @@ -98,9 +105,9 @@ script. There are two exceptions to this rule. First, variables of style {equal} and {atom} ARE redefined each time the command is encountered. -This allows them to be reset, when their formulas contain a -substitution for another variable, e.g. $x. This can be useful in a -loop. +This only changes their associated formula if the formula contains a +substitution for another variable, e.g. $x. But that can be useful, +for example, in a loop. Second, as described below, if a variable is iterated on to the end of its list of strings via the "next"_next.html command, it is removed @@ -208,7 +215,10 @@ Note that {equal} and {atom} variables can produce different values at different stages of the input script or at different times during a run. For example, if an {equal} variable is used in a "fix print"_fix_print.html command, different values could be printed each -timestep it was invoked. +timestep it was invoked. If you want a variable to be evaluated +immediately, so that the result is stored by the variable instead of +the string, see the section below on "Immediate Evaluation of +Variables". The next command cannot be used with {equal} or {atom} style variables, since there is only one string. @@ -248,10 +258,17 @@ can use formula elements that produce either global values or per-atom values. The thermo keywords allowed in a formula are those defined by the -"thermo_style custom" command. Since many thermodynamic quantities -are only computable after the a simulation has begun, these keywords -cannot be used if a variable is evaluated before the first simulation -begins. +"thermo_style custom" command. Thermo keywords that require a +"compute"_compute.html to calculate their values such as "temp" or +"press", use computes stored and invoked by the thermo_style command. +This means that you can only use those keywords in a variable if the +style you are using with the thermo_style command (and the thermo +keywords associated with that style) also define and use the needed +compute. Note that some thermo keywords use a compute indirectly to +calculate their value (e.g. the enthalpy keyword uses temp, pe, and +pressure). If a variable is evaluated in an input script (not during +a run), then the values accessed by the thermo keyword must be +current. See the discussion below about "Variable Accuracy". Math operations are written in the usual way, where the "x" and "y" in the examples above can be another section of the formula. Operators @@ -295,7 +312,10 @@ See the doc pages for individual computes to see which ones calculate global versus per-atom quantities. If the compute reference contains empty brackets, then per-atom values calculated by the compute are accessed. Otherwise a single value (global or per-atom) calculated by -the compute is accessed. +the compute is accessed. If a variable containing a compute is +evaluated in an input script (not during a run), then the values +accessed by the compute must be current. See the discussion below +about "Variable Accuracy". The different kinds of compute references are as follows. M is a positive integer <= the number of vector values calculated by the @@ -314,14 +334,17 @@ actual ID of the fix defined elsewhere in the input script. See the doc pages for individual computes to see which ones calculate global versus per-atom quantities. If the fix reference contains empty brackets, then per-atom values calculated by the fix are accessed. -Otherwise a single value (global or per-atom) calculated by the -fix is accessed. +Otherwise a single value (global or per-atom) calculated by the fix is +accessed. Note that some fixes only generate quantities on certain timesteps. If a variable attempts to access the fix on non-allowed timesteps, an error is generated. For example, the "fix ave/time"_fix_ave_time.html command may only generate averaged quantities every 100 steps. See -the doc pages for individual fix commands for details. +the doc pages for individual fix commands for details. If a variable +containing a fix is evaluated in an input script (not during a run), +then the values accessed by the fix should be current. See the +discussion below about "Variable Accuracy". The different kinds of fix references are exactly the same as the compute references listed in the above table, where "c_" is replaced @@ -349,47 +372,176 @@ then LAMMPS will run for a while when the print statement is invoked! :line -It is useful to understand the distinction between referencing a -variable in a formula using the $x form instead of v_x. There is a -subtle difference between the two references that has to do with when -the evaluation of the included variable is done. +Immediate Evaluation of Variables: -Referencing the variable as $x, the value of the include variable is -substituted for immediately when the line is read from the input -script, just as it would be in other input script command. +There is a difference between referencing a variable with a leading $ +sign (e.g. $x or $\{abc\}) versus with a leading "v_" (e.g. v_x or +v_abc). The former can be used in any command, including a variable +command, to force the immediate evaluation of the referenced variable +and the substitution of its value into the command. The latter is a +required kind of argument to some commands (e.g. the "fix +ave/spatial"_fix_ave_spatial.html or "dump custom"_dump.html or +"thermo_style"_thermo_style.html commands) if you wish it to evaluate +a variable periodically during a run. It can also be used in a +variable formula if you wish to reference a second variable. The +second variable will be evaluated whenever the first variable is +evaluated. -This could be the desired behavior if a static value is desired. Or -it could be the desired behavior for an equal-style variable if the -variable command appears in a loop (see the "jump"_jump.html and -"next"_next.html commands), since the substitution will be performed -anew each time thru the loop as the command is re-read. Note that if -the variable formula is enclosed in double quotes, this prevents -variable substitution and thus an error will be generated when the -variable formula is evaluated. +As an example, suppose you use this command in your input script to +define the variable "v" as -Referencing the variable as v_x, the value of the included variable -will not be accessed until the variable formula is evaluated. Thus -the value may change each time the evaluation is performed. This may -also be desired behavior. +variable v equal vol :pre -As an example, if the current simulation box volume is 1000.0, then -these lines: +before a run where the simulation box size changes. You might think +this will assign the initial volume to the variable "v". That is not +the case. Rather it assigns a formula which evaluates the volume +(using the thermo_style keyword "vol") to the variable "v". If you +use the variable "v" in some other command like "fix ave/time" then +the current volume of the box will be evaluated continuously during +the run. -variable x equal vol -variable y equal 2*$x :pre +If you want to store the initial volume of the system, you can do it +this way: -will associate the equation string "2*1000.0" with variable y. +variable v equal vol +variable v0 equal $v :pre -By contrast, these lines: +The second command will force "v" to be evaluated (yielding the +initial volume) and assign that value to the variable "v0". Thus the +command -variable x equal vol -variable y equal 2*v_x :pre +thermo_style custom step v_v v_v0 :pre -will associate the equation string "2*v_x" with variable y. +would print out both the current and initial volume periodically +during the run. -Thus if the variable y were evaluated periodically during a run where -the box volume changed, the resulting value would always be 2000.0 for -the first case, but would change dynamically for the second case. +Note that it is a mistake to enclose a variable formula in double +quotes if it contains variables preceeded by $ signs. For example, + +variable vratio equal "$\{vfinal\}/$\{v0\}" :pre + +This is because the quotes prevent variable substitution (see "this +section"_Section_commands.html#3_2 on parsing input script commands), +and thus an error will occur when the formula for "vratio" is +evaluated later. + +:line + +Variable Accuracy: + +Obviously, LAMMPS attempts to evaluate variables containing formulas +({equal} and {atom} style variables) accurately whenever the +evaluation is performed. Depending on what is included in the +formula, this may require invoking a "compute"_compute.html, either +directly or indirectly via a thermo keyword, or accessing a value +calculated and stored by a "fix"_fix.html. If the compute is one that +calculates the pressure or energy of the system, then these quantities +need to be tallied during the evaluation of the interatomic potentials +(pair, bond, etc) on timesteps that the variable will need the values. + +LAMMPS keeps track of all of this during a "run"_run.html or "energy +minimization"_minimize.html. An error will be generated if you +attempt to evaluate a variable on timesteps when it cannot produce +accurate values. For example, if a "thermo_style +custom"_thermo_style.html command prints a variable which accesses +values stored by a "fix ave/time"_fix_ave_time.html command and the +timesteps on which thermo output is generated are not multiples of the +averaging frequency used in the fix command, then it is an error. + +However, your input script can also require variables to be evaluated +before or after or inbetween runs. In this case, one of three things +may happen. + +(1) The variable may be evaluated accurately. If it contains +references to a compute or fix, and these values were calculated and +stored on the last timestep of a preceeding run, then they can be +accessed and used by the variable. + +(2) LAMMPS may not be able to evaluate the variable and generate an +error. For example, if the variable formula requires a +"compute"_compute.html to be invoked, either directly or indirectly +via a thermo keyword, then the variable cannot be evaluated before the +first run has occurred. The general rule is that if a variable uses a +value calculated by a compute, and the variable is not being evaluated +during a run, then the variable will not invoke the compute. Instead, +it can only use the value stored by the compute, which for accuracy +requires that the compute was already invoked on the same timestep +during a preceeding run. + +Thus the way to get around this error is to perform a 0-timestep run +before using the variable. For example, these commands + +variable t equal temp +print "Initial temperature = $t" +run 1000 :pre + +will generate an error if the run is the first run specified in the +input script, because generating a value for the "t" variable requires +a compute for calculating the temperature to be invoked. + +However, this sequence of commands would be fine: + +run 0 +variable t equal temp +print "Initial temperature = $t" +run 1000 :pre + +The 0-timestep run initializes and invokes various computes, including +the one for temperature, so that the value it stores is current and +can be accessed by the variable "t" after the run has completed. Note +that a 0-timestep run does not alter the state of the system, so it +does not change the input state for the 1000-timestep run that +follows. Also note, that the 0-timestep run must actually use and +invoke the compute in question (e.g. via "thermo"_thermo_style.html or +"dump"_dump.html output) in order for it to enable the compute to be +used in a variable after the run. + +Note that unlike computes, "fixes"_fix.html will never generate an +error if their values are accessed by a variable in between runs. +They always return some value to the variable. However, this value +may not be what you expect if the fix has not yet calculated the +quantity of interest. For example, the "fix indent"_fix_indent.html +command stores the force on the indenter. But this is not computed +until a run is performed. Thus if a variable attempts to print this +value before the first run, values of zero will be output. Again, +performing a 0-timestep run before printing the variable has the +desired effect. + +(3) The variable may be evaluated incorrectly. And LAMMPS may have +no way to detect this has occurred. Consider the following sequence +of commands: + +pair_coeff 1 1 1.0 1.0 +run 1000 +pair_coeff 1 1 1.5 1.0 +variable e equal pe +print "Final potential energy = $e" :pre + +The first run is performed using one setting for the pairwise +potential defined by the "pair_style"_pair_style.html and +"pair_coeff"_pair_coeff.html commands. The potential energy is +evaluated on the final timestep and stored by the "compute +pe"_compute_pe.html compute (this is done by the +"thermo_style"_thermo_style.html command). Then a pair coefficient is +changed, altering the potential energy of the system. When the +potential energy is printed via the "e" variable, LAMMPS will use the +potential energy value stored by the "compute pe"_compute_pe.html +compute, thinking it is current. There are many other commands which +could alter the state of the system between runs, causing a variable +to evaluate incorrectly. + +The solution to this issue is the same as for case (2) above, namely +to perform a 0-timestep run before the variable is evaluated to insure +the system is up-to-date. For example, this sequence of commands +would print a potential energy that reflected the changed pairwise +coefficient: + +pair_coeff 1 1 1.0 1.0 +run 1000 +pair_coeff 1 1 1.5 1.0 +run 0 +variable e equal pe +print "Final potential energy = $e" :pre :line