addforce using sphere diameter

Dear all,

Sorry for disturbing you, I have spheres with random diameters and I want to add force to spherical particles using fix addfocre which includes diameter of each sphere, but i got error, please let me know where I’m wrong?

atom_style sphere

variable Diam atom random(0.024,0.026,16)
set region mybox diameter v_Diam
variable dz atom 2diameter # or 2v_diameter
fix archimeius all addforce 0.0 v_dz 0.0

ERROR: Invalid thermo keyword in variable formula (…/variable.cpp:1716)

but when I use position of particles instead of diameters , it works.

Thanks in Advance,

The invalid keyword is diameter. The only keywords allowed

are in the thermo_style command, not from dump commands.

If you want an atom-style variable that uses diameter or radius,

you need to use compute property/atom, then reference

the compute in your per-atom varaible formula.

Steve

Dear all,

Sorry for disturbing you, I have spheres with random diameters and I want to
add force to spherical particles using fix addfocre which includes diameter
of each sphere, but i got error, please let me know where I'm wrong?

atom_style sphere

variable Diam atom random(0.024,0.026,16)
set region mybox diameter v_Diam
variable dz atom 2*diameter # or 2*v_diameter
fix archimeius all addforce 0.0 v_dz 0.0

ERROR: Invalid thermo keyword in variable formula (../variable.cpp:1716)

but when I use position of particles instead of diameters , it works.

because those are supported parameters, diameter is not. it is nowhere
listed as supported. to get access to the diameter property, you need
to define a suitable compute property/atom and reference that instead.

axel.

Thank you very much.