Set with Atom-style Variable

Dear LAMMPS users,

For the input script shown below, when I try to set the atom type for many atoms based on an atom-style variable, I get a message that says, “Invalid value in set command”. Additionally, if I instead try to set the molecule type for each atom, the molecule type is changed to 0. (I’m using the 14 May 2013 version)

#---------initialization---------

units real
dimension 3
boundary p p p
atom_style molecular

#--------force field------------

pair_style lj/cut 10.0

#—make box and create atoms—

lattice sc 1.0
region thebox block -10 10 -10 10 -10 10
create_box 2 thebox
create_atoms 1 random 10 839725983 NULL
create_atoms 2 random 10 934590954 NULL

#----------parameters-----------

pair_coeff * * 0.0660 3.5
mass * 12.011

#------change atom types--------

variable newtype atom 1
set atom * type v_newtype
#set atom * mol v_newtype

#-------------run---------------

timestep 0.50
fix 1 all nvt temp 1000 1000 100
dump 1 all custom 1 dump.set id type mol x y z v_newtype
run 10

This script is intended to simply re-set all the atoms to type 1 after creating a mix of type 1 and type 2 atoms. In the future, I’d like to use the set command with the every keyword of the run command in order to change atom types throughout a simulation based on a specially-calculated atom-style variable.

Thanks,

Matt

in.set (747 Bytes)

Dear LAMMPS users,

For the input script shown below, when I try to set the atom type for many
atoms based on an atom-style variable, I get a message that says, "Invalid
value in set command". Additionally, if I instead try to set the molecule
type for each atom, the molecule type is changed to 0. (I'm using the 14
May 2013 version)

both seem to be working with the current lammps version.

#------change atom types--------

variable newtype atom 1
set atom * type v_newtype
Setting atom values ...
  20 settings made for type
#set atom * mol v_newtype

#-------------run---------------

#------change atom types--------

variable newtype atom 1
#set atom * type v_newtype
set atom * mol v_newtype
Setting atom values ...
  20 settings made for mol

#-------------run---------------

ITEM: TIMESTEP
0
ITEM: NUMBER OF ATOMS
20
ITEM: BOX BOUNDS pp pp pp
-10 10
-10 10
-10 10
ITEM: ATOMS id type mol x y z v_newtype
1 1 1 -7.93717 -0.0588558 -9.18898 1
11 2 1 -9.53812 -7.17475 -6.09708 1
2 1 1 9.68988 -2.26018 -6.9121 1
3 1 1 -9.88761 -0.99668 8.80512 1
13 2 1 -3.71278 -0.755406 3.88417 1
6 1 1 0.873189 -4.31786 9.66946 1
4 1 1 7.64996 -7.07744 9.52472 1
5 1 1 6.94056 -9.94571 2.42114 1
12 2 1 4.96921 -2.50196 9.59221 1
8 1 1 -5.44522 2.12387 -4.1941 1
7 1 1 1.91134 3.92532 -7.20968 1
10 1 1 -1.62509 7.18116 -6.19298 1
14 2 1 1.28192 5.19307 -0.0267471 1
16 2 1 -1.47673 0.625625 -5.11817 1
9 1 1 8.2873 4.5907 -4.14242 1
15 2 1 6.35096 0.599334 -6.99717 1
17 2 1 -0.92175 8.15543 8.35467 1
18 2 1 -3.06875 3.45967 6.74867 1
19 2 1 -1.12758 8.68625 9.75226 1
20 2 1 6.27153 5.6549 1.95622 1