lammps/doc/set.txt

102 lines
3.7 KiB
Plaintext
Raw Normal View History

"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
set command :h3
[Syntax:]
set ID style value :pre
ID = ID of group or atom
style = {atom} or {bond} or {angle} or {dihedral} or {improper} or \
{charge} or {dipole} or {type} or {mol} or {x} or {y} or {z} or \
{vx} or {vy} or {vz} or {q}
value = value to set selected atom(s) to :ul
[Examples:]
set solvent atom 2
set edge bond 4
set half charge 0.5
set 100 x 0.5
set 1492 type 3 :pre
[Description:]
Set an attribute for a single atom or each atom in a group. The
context depends on the specified {style}.
Styles {atom}, {bond}, {angle}, {dihedral}, {improper}, {charge}, and
{dipole} set attributes for all atoms in a group, so the specified ID
is a group-ID string.
Styles {type}, {mol}, {x}, {y}, {z}, {vx}, {vy}, {vz}, and {q} set the
attribute of a single atom, so the specified ID is an atom-ID number
(1-N).
Since atom attributes are assigned by the "read_data"_read_data.html,
"read_restart"_read_restart.html or "create_atoms"_create_atoms.html
commands, this command changes those assignments. This can be useful
for altering pairwise and molecular force interactions, since
force-field coefficients are defined in terms of types. It can also
be used to change the labeling of atoms when they are output in
"dump"_dump.html files. It can also be useful for debugging purposes;
i.e. positioning an atom at a precise location to compute subsequent
forces or energy.
For style {atom}, the atom type of all atoms in the group is changed
to the specified value from 1 to ntypes. Note that ntypes must be
within the range the simulation was initialized for. The maximum
number of types is set by the "create_box"_create_box.html command or
the {atom types} field in the header of the data file read by the
"read_data"_read_data.html command.
For style {bond}, {angle}, {dihedral}, or {improper}, the bond type
(angle type, etc) of all bonds (angles, etc) of atoms in the group is
changed to the specified value from 1 to nbondtypes (angletypes, etc).
All atoms in the bond (angle, etc) must be in the group in order for
the change to be made. The maximum number of types is set by the
{bond types} ({angle types}, etc) field in the header of the data
file.
For style {charge}, the charge of each atom in the group is set to
the specified value.
For style {dipole}, the specified value is used as a random number
seed. The dipole moment of each atom in the group is set to a random
orientation with a magnitude determined by the "dipole"_dipole.html
command setting for that atom type.
For styles {type}, {mol}, {x}, {y}, {z}, {vx}, {vy}, {vz}, or {q}, the
corresponding attribute of a single atom with the specified atom-ID is
set to the specified value. E.g. the last example above, sets the
atom-type of atom 1492 to 3. If "type" were replaced by "q", the
charge on atom 1492 would be set to 3; if it were replaced by "mol",
then then the molecule-ID would be set to 3. The values for x,y,z are
in distance units, the values for vx,vy,vz are in velocity units, and
the value for charge is in charge units, as explained by the
"units"_units.html command.
[Restrictions:]
This command requires inter-processor communication to coordinate the
setting of bond types (angle types, etc). This means that your system
must be ready to perform a simulation before using this command (force
fields setup, atom masses set, etc). This is not necessary to simply
reset atom types.
You cannot set the {mol} or {q} for an atom if the
"atom_style"_atom_style.html does not have those attributes.
[Related commands:]
"create_box"_create_box.html, "create_atoms"_create_atoms.html,
"read_data"_read_data.html
[Default:] none