Dear all,
I am trying to “incorporate” the following two LAMMPS commands to a PyLAMMPS script:
compute metal_id shell_atom property/atom id
dump myDump all custom 2 dump.atom id c_metal_id
where shell_atom is a group I have previously defined using a command that looks like “group shell_atom type 1”. Following the manual, the compute command can be written as
L.compute(" metal_id shell_atom property/atom id")
I would like to assign the c_metal_id in a python variable instead of writing it to a file. How can I do that? I have thought of the following commands:
L.variable("xxx atom c_ metal_id ")
L.run(0)
x = L.variables[‘xxx’]
but when executing I get the following message: “ERROR: Variable xxx: Compute used in variable between runs is not current (…/variable.cpp:1529)”
Thank you,
Evangelos