Chunk and per atom-style variable

Dear all,

I need to evaluate for each atoms a quantity related to the local density. I’m considering to use the chunk command :

compute 1 all chunk/atom bin/3d x lower 1.0 y lower 1.0 z lower 1.0 compress no every
compute 2 all property/chunk ID count coord123

and to use the count quantity computed by the chunk to evaluate the density in this space region.

variable mydens atom count_in_my_bin/${binVolume}

The question is how to get for each atoms the count in the bin where it is located (count_in_my_bin) ?

Is there any possibility to get for each atoms in an atom-style variable the ID of the chunk where it is located ?
Is there any possibility to get for each atoms in an atom-style variable the count of the chunk where it is located ?

Thanks for your help,

Paul

Dear all,

I need to evaluate for each atoms a quantity related to the local density. I’m considering to use the chunk command :

compute 1 all chunk/atom bin/3d x lower 1.0 y lower 1.0 z lower 1.0 compress no every
compute 2 all property/chunk ID count coord123

and to use the count quantity computed by the chunk to evaluate the density in this space region.

variable mydens atom count_in_my_bin/${binVolume}

The question is how to get for each atoms the count in the bin where it is located (count_in_my_bin) ?

Is there any possibility to get for each atoms in an atom-style variable the ID of the chunk where it is located ?

yes. see the compute chunk/atom documentation. the chunk-id is
available as a per-atom property. you'd do something like this.

variable chunkid atom c_1

Is there any possibility to get for each atoms in an atom-style variable the count of the chunk where it is located ?

yes. compute property/chunk returns a global vector or array, so you
should be able to reference it in an atom style variable using a
reference to the previously defined atom style variable containing the
chunk id.

please note that the syntax or the compute command definitions you
quote at the beginning of your mail is in conflict with the
documentation.

axel.