How to assign the per-chunk values to each atom in the chunk?

Hi LAMMPS developers and users,

I used chunk/atom to separate the atoms into 100 chunks along the z-axis. Then I used fix ave/chunk to average a certain property r_stretch of the atoms in each chunk.

compute zID wall chunk/atom bin/1d z upper ${dz} units box nchunk once
fix ave_stretch wall ave/chunk 1 1 1 zID v_r_stretch

Now I want to assign the fix result ave_stretch, which is a per-chunk value, to each atom of the corresponding chunk for ensuring calculation. Maybe I should create a new variable? But it seems the variable command won’t accept a per-chunk value…

Any comment or advice is welcome. Thanks in advance!

1 Like

Please have a look at the compute chunk/spread/atom command — LAMMPS documentation

1 Like

Thanks @akohlmey . I used

compute ave_eps wall chunk/spread/atom zID f_ave_stretch[3]

and spread the property to each atom successfully.