Hello,
I am trying to store the initial coordinates before I do some MC moves within a LAMMPS input script. I need to copy several atom coordinates at once for the kind of MC moves I am doing.
I am trying to use the fix property/atom
fix initial all property/atom d_x0 d_y0 d_z0
set atom * d_x0 x
set atom * d_y0 y
set atom * d_z0 z
This gives me the error “ERROR: Expected floating point parameter in input script or data file”
Are x, y and z floating point vectors?
My understanding was the “*” will allow you to set one vector to another?
http://lammps.sandia.gov/doc/set.html
Is it possible to do this?
Thanks
Josh
Hello,
I am trying to store the initial coordinates before I do some MC moves
within a LAMMPS input script. I need to copy several atom coordinates at
once for the kind of MC moves I am doing.
I am trying to use the fix property/atom
fix initial all property/atom d_x0 d_y0 d_z0
set atom * d_x0 x
set atom * d_y0 y
set atom * d_z0 z
This gives me the error "ERROR: Expected floating point parameter in input
script or data file"
Are x, y and z floating point vectors?
only when you define an atom style variable.
anyway, fix property/atom seems like overkill for this. you can probably do
what you want to do simply with
fix pos0 all store/state 0 x y z
and then access the fix later either directly or through an atom style
variable.
axel.
Thanks Axel for the quick reply.
I guess I am still struggling with the syntax.
I tried
fix pos0 all store/state 0 x y z
variable pos0x vector f_pos0[1]
variable pos0y vector f_pos0[2]
variable pos0z vector f_pos0[3]
set atom * x v_pos0x
set atom * x v_pos0y
set atom * x v_pos0z
This gives me “ERROR: Variable for set command is invalid style” for the “set atom * x v_pos0x” command.
When trying to just dump the first part I get a segmentation fault with
dump testdump all custom 1 dump.test f_pos0[1] f_pos0[2] f_pos0[3]
Thanks.
Josh
Thanks Axel for the quick reply.
I guess I am still struggling with the syntax.
I tried
fix pos0 all store/state 0 x y z
variable pos0x vector f_pos0[1]
variable pos0y vector f_pos0[2]
variable pos0z vector f_pos0[3]
vector != atom
set atom * x v_pos0x
set atom * x v_pos0y
set atom * x v_pos0z
This gives me "ERROR: Variable for set command is invalid style" for the
"set atom * x v_pos0x" command.
When trying to just dump the first part I get a segmentation fault with
dump testdump all custom 1 dump.test f_pos0[1] f_pos0[2] f_pos0[3]
i have no problem at all with this modified version of the melt example:
units lj
atom_style atomic
lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 3.0 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
fix 2 all store/state 0 x y z
variable x0 atom f_2[1]
variable y0 atom f_2[2]
variable z0 atom f_2[3]
dump id all custom 50 dump.melt f_2[*]
thermo 50
run 250
# restore positions and velocities and redo the same run
set atom * x v_x0
set atom * y v_y0
set atom * z v_z0
velocity all create 3.0 87287
run 250
Thanks Axel,
That works.
I didn’t see the “atom” style for the variable and was confusing it with vector. Your first message makes sense now to me.
Thanks again.
Josh