Define atom style variable from compute property/atom output

Dear LAMMPS users,

I have a group with four atoms, which I need to store their x,y,z coordinates in variables during simulation. I can easily output these values into a file using dump custom command, however what I want is use these coordinate values in the next step of simulation. That means I need to define 12 different variables such that x1,y1,z1,x2,y2,z2….x4,y4,z4 etc. for four atoms. So I have defined compute property/atom command to get those coordinates, such as

Compute 1 groupname property/atom x y z

In the manual I read that output calculated by compute property/atom command can be accessed by atom style variables. But it’s not clear to me how this output can be stored in variables. I would be grateful if you can explain me how to write the code for that.

Many thanks

Hansinee

Dear LAMMPS users,

I have a group with four atoms, which I need to store their x,y,z coordinates in variables during simulation. I can easily output these values into a file using dump custom command, however what I want is use these coordinate values in the next step of simulation. That means I need to define 12 different variables

No, you don’t. Please have a look at fix store/state.

such that x1,y1,z1,x2,y2,z2….x4,y4,z4 etc. for four atoms. So I have defined compute property/atom command to get those coordinates, such as

Compute 1 groupname property/atom x y z

In the manual I read that output calculated by compute property/atom command can be accessed by atom style variables. But it’s not clear to me how this output can be stored in variables. I would be grateful if you can explain me how to write the code for that.

Please see the documentation of the variable command about how to access properties of a compute. However, you should also note, that atom style variables can access coordinates directly. Again, the documentation for the variable command has all the details.

Axel