Histogram per-chunk o per-bin?

Hi all ,

I have a monatomic fluid in a cubic box simulation. The fluid is confined by two walls at different temperatures in the dim z. I am interested in studying the steady state, therefore, I need to ensure that there is local equilibrium .

I would like to calculate the velocity distribution in each bin . I have reviewed the documentation atom/chunk and ave/histo , however , do not know how you could do both commands work together, so that you can get:“1 histogram per-chunk(bin).”

We appreciate that you can give me some tips on doing this. I am currently using 140 bin on the z axis.


The fix ave/histo command does not compute histograms within a bin,

or within 140 different bins to give 140 different histograms. There

is no command to do that in LAMMPS.

You could use fix ave/histo to histogram a group of atoms which

could be the atoms in a single bin. You could use it several

times to compute histograms in several different bins.


Hi thanks for the reply,
Try using groups, however , I need to use a dynamic group as the atoms move in and out of the bin, but ave / histo not support dynamic groups :(.

region r_inf block 0 10 0 10 1 2
group slab_inf dynamic all region r_inf
fix histo_slab_inf slab_inf ave/histo 1 10 10 -4 4 100 vx vy vz mode vector beyond ignore file ./histograma_inf

ERROR: Fix histo_slab_inf does not allow use of dynamic group (…/modify.cpp:228)


Try adding this line to the top of fix_ave_histo.cpp and rebuild.

extarray = 0;

dynamic_group_allow = 1; // this line

I think it should just work. Please test and let us know.

Then we will post a patch.


Thanks !, I made the change you mention and works well.


will be in the next patch …