Fix adapt command is not working

I want to decrease and decrease atom radius during simulation.I used fix adapt command for that even after correct syntax it is showing me error.

variable radius equal ramp(2.0951,1.0000)
fix 6 pr adapt 10 atom diameter v_radius


ERROR: Fix adapt requires atom attribute diameter (src/fix_adapt.cpp:453)

Could anyone tell me how to fix this.

lammps file is here (2.1 KB)

You cannot. Your SW potential is simulating point particles. Those don’t have an explicit diameter, only some kind of “effective radius” that is implied by the potential parameters.

Here i have hybrid potential lj and sw. The particle i want to change radius in lj one which have same radius as silicon atoms.

Let me repeat, your atoms do not have an explicit radius. Technically, you can stop the error from happening, by changing the atom style, but such modification of you input would have no effect, since your pair styles do not use the per-atom diameter property.

What I wrote about SW applies to LJ as well. Both simulate point particles which have no explicit diameter so the corresponding per-atom property would be ignored. The only way you can change the effective radius on the fly with fix adapt would be by changing the potential parameters. This should be possible for LJ (-> sigma) and it is not possible for SW. You have to refer to the documentation for details.

thank you for your answer