Question about compute chunk/atom command


I have just started using the compute chunk/atom command. I would like to assign a few layers as delta, which the LAMMPS package conveniently provides. I am interested in assigning this delta, as a fixed volume normal to my direction of interest, which I have done. However, the one thing I cannot seem to figure out is this:

I’d like to initially choose my volumes of interest with their respective bins, but I want the atoms that are initially in that volume to always be assigned to the same layer. Meaning if the atom leaves the volume of the delta-spaced bin, the properties of that atom will still always be used to calculate the properties of that region.

Ultimately, I want to define layers at t = 0 which assigns all the atoms to their respective regions, and at t = t1, no matter where the atoms are, they will only be used to calculate the properties of the layer that they were initially in.

Can this be done with the compute chunk/atom command?

Best Regards,

See the nchunk and ids options on the compute chunk/atom command.

They can do what you are asking.


Steve, I now see this, thanks.
Could you take a look at these 2 commands series and explain why they are not equivalent? It seems the second approach achieves the results I was expecting, whereas the first one does not.

compute cc1 all chunk/atom bin/1d z lower 5 nchunk once
compute 2 all com/chunk cc1
fix 1 all ave/time 10 10 100 c_2 file com.txt mode vector


region layer1 block INF INF INF INF INF 5
group layer1 region layer1
compute com layer1 com
fix 2 layer1 ave/time 10 10 100 c_com file com_compare.txt mode vector

If I compare layer1 defined be the region command, it does not match the results with the chunk/atom command. Any ideas why?

I don’t know. I suggest you “debug” by printing/dumping
info from each command. E.g. dump the chunk ID of
each atom to a dump file and verity it is doing what
you expect.


When I Compare the info dumped by each command, they do not match. It’s no big deal - I have just accomplished what I want by manually defining my own groups. However, if I want to define the density per region, I am having difficulties. I don’t want to use the fix ave/chunk command until I can sort out why the results are different. It does not seem that I can use LAMMPS to compute density in the different regions like I can with the temperature. Is this actually true or am I missing something?

If I want to calculate temperature for a given layer, I can use:

compute temp1 layer1 temp
fix 1 layer 1 ave/time 5 5 100 c_temp1 file temp1.profile

If I try the same with density, I get “Unknown compute style”