[lammps-users] compute and variable

I'm new to lammps and I have a very basic question and couldn't find an
answer anywhere. I must be doing something wrong somewhere.

I am loading a single particle from a file and want to scale its
diameter by two.
I use

compute a all property/atom radius
variable b equal 4*c_a[1]
set atom 1 diameter b
run 0

and get the error message:

ERROR on proc 0: Fix nve/sphere requires extended particles

So I guess the compute or variable command is wrong and there is no
numeric value stored in "a".

Thanks, Jens

INPUT FILE:

You need lines like this at the end of your script.

compute a all property/atom radius
variable b equal 4*c_a[1]
thermo_style custom step temp v_b

run 0
set atom 1 diameter $b
run 0

The initial error is b/c you used b and not $b.
Then you need to insure the compute property/atom
is invoked in a previous run, before you use it
inbetween runs. The thermo custom command
is one way of doing this.

Steve