Unverified Commit ee5ad9cb authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #857 from lammps/resetids

new reset_ids command and dump_modify delay option
parents 81caeffb a19e8fb2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -497,6 +497,7 @@ in the command's documentation.
"region"_region.html,
"replicate"_replicate.html,
"rerun"_rerun.html,
"reset_ids"_reset_ids.html,
"reset_timestep"_reset_timestep.html,
"restart"_restart.html,
"run"_run.html,
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ Commands :h1
   region
   replicate
   rerun
   reset_ids
   reset_timestep
   restart
   run
+33 −27
Original line number Diff line number Diff line
@@ -15,8 +15,9 @@ compute ID group-ID displace/atom :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
displace/atom = style name of this compute command :l
zero or more keyword/arg pairs may be appended :l
keyword = {refresh} :l
  {refresh} arg = per-atom variable ID :pre
keyword = {refresh} :
  {replace} arg = name of per-atom variable :pre

:ule

[Examples:]
@@ -75,36 +76,41 @@ a distance {Dhop}. For any snapshot we only want to output atoms that
have hopped since the last snapshot.  This can be accomplished with
something like the following commands:

write_dump      all custom tmp.dump id type x y z    # see comment below :pre

variable        Dhop equal 0.6
variable        check atom "c_dsp[4] > v_Dhop"
compute         dsp all displace/atom refresh check
dump            1 all custom 20 tmp.dump id type x y z
dump_modify     1 append yes thresh c_dsp[4] > ${Dhop} refresh c_dsp :pre

The "dump_modify thresh"_dump_modify.html command will cause only
atoms that have displaced more than 0.6 Angstroms to be output on a
given snapshot (assuming metal units).  The dump_modify {refresh}
option triggers a call to this compute at the end of every dump.

The argument for compute displace/atom refresh is the ID of an
"atom-style variable"_variable.html which calculates a Boolean value
(0 or 1) based on the same criterion used by dump_modify thresh.  What
this compute will then do is evaluate the atom-style variable and for
each atom that returns 1 (true), it will update the original
(reference) coordinates of the atom, which are stored by this compute.
dump            1 all custom 100 tmp.dump id type x y z
dump_modify     1 append yes thresh c_dsp[4] > ${Dhop} &
                refresh c_dsp delay 100 :pre

The "dump_modify thresh"_dump_modify.html command will only ouptut
atoms that have displaced more than 0.6 Angstroms on each snapshot
(assuming metal units).  The dump_modify {refresh} option triggers a
call to this compute at the end of every dump.

The {refresh} argument for this compute is the ID of an "atom-style
variable"_variable.html which calculates a Boolean value (0 or 1)
based on the same criterion used by dump_modify thresh.  This compute
evaluates the atom-style variable.  For each atom that returns 1
(true), the original (reference) coordinates of the atom (stored by
this compute) are updated.

The effect of these commands is that a particular atom will only be
output in the dump file on shapshots following a diffusive hop.  It
will not be output again until it performs another hop.

Note that the first snapshot (geneated by the first run after the dump
and this compute are defined), no atoms will be typically be output.
That is because the initial displacement for all atoms is 0.0.  If an
initial dump snapshot is desired, containing the initial reference
position of all atoms, a command like this can be used before the
first simulation is performed

write_dump      all custom tmp.dump.initial id type x y z :pre
output in the dump file on the snapshot after it makes a diffusive
hop.  It will not be output again until it makes another hop.

Note that in the first snapshot of a subsequent run, no atoms will be
typically be output.  That is because the initial displacement for all
atoms is 0.0.  If an initial dump snapshot is desired, containing the
initial reference positions of all atoms, one way to do this is
illustrated above.  An initial write_dump command can be used before
the first run.  It will contain the positions of all the atoms,
Options in the "dump_modify"_dump_modify.html command above will
append new output to that same file and delay the output until a later
timestep.  The {delay} setting avoids a second time = 0 snapshot which
would be empty.

:line

+9 −5
Original line number Diff line number Diff line
@@ -264,11 +264,15 @@ spacings.
Atom IDs are assigned to created atoms in the following way.  The
collection of created atoms are assigned consecutive IDs that start
immediately following the largest atom ID existing before the
create_atoms command was invoked.  When a simulation is performed on
different numbers of processors, there is no guarantee a particular
created atom will be assigned the same ID.  If molecules are being
created, molecule IDs are assigned to created molecules in a similar
fashion.
create_atoms command was invoked.  This is done by the processor's
communicating the number of atoms they each own, the first processor
numbering its atoms from 1 to N1, the second processor from N1+1 to
N2, etc.  Where N1 = number of atoms owned by the first processor, N2
= number owned by the second processor, etc.  Thus when the same
simulation is performed on different numbers of processors, there is
no guarantee a particular created atom will be assigned the same ID in
both simulations.  If molecules are being created, molecule IDs are
assigned to created molecules in a similar fashion.

Aside from their ID, atom type, and xyz position, other properties of
created atoms are set to default values, depending on which quantities
+10 −2
Original line number Diff line number Diff line
@@ -80,7 +80,15 @@ deleted, then atom IDs are re-assigned so that they run from 1 to the
number of atoms in the system.  Note that this is not done for
molecular systems (see the "atom_style"_atom_style.html command),
regardless of the {compress} setting, since it would foul up the bond
connectivity that has already been assigned.
connectivity that has already been assigned.  However, the
"reset_ids"_reset_ids.html command can be used after this command to
accomplish the same thing.

Note that the re-assignement of IDs is not really a compression, where
gaps in atom IDs are removed by decrementing atom IDs that are larger.
Instead the IDs for all atoms are erased, and new IDs are assigned so
that the atoms owned by individual processors have consecutive IDs, as
the "create_atoms"_create_atoms.html command explains.

A molecular system with fixed bonds, angles, dihedrals, or improper
interactions, is one where the topology of the interactions is
@@ -137,7 +145,7 @@ using molecule template files via the "molecule"_molecule.html and

[Related commands:]

"create_atoms"_create_atoms.html
"create_atoms"_create_atoms.html, "reset_ids"_reset_ids.html

[Default:]

Loading