"LIGGGHTS(R)-PUBLIC WWW Site"_liws - "LIGGGHTS(R)-PUBLIC Documentation"_ld - "LIGGGHTS(R)-PUBLIC Commands"_lc :c

:link(liws,http://www.cfdem.com)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)

:line

compute nparticles/tracer/region command :h3

[Syntax:]

compute ID group-ID nparticles/tracer/region general_keyword general_values :pre

ID, group-ID are documented in "compute"_compute.html command  :l
nparticles/tracer/region = style name of this compute command :l
general_keywords general_values are documented in "compute"_compute.html" :l
region_count = obligatory keyword :l
region-ID = ID of region atoms must be in to be counted :l
tracer = obligatory keyword :l
tracer-ID = ID of a fix of type "fix property/atom/tracer"_fix_property_atom_tracer.html  :l
zero or more keyword/value pairs may be appended to args :l
keyword = {periodic} or {reset_marker} :l
  {periodic} value = dim image
    dim = {x} or {y} or {z}
    image = image that a particle has to be in to be counted (any integer number or {all})
  {reset_marker} value = {yes} or {no}
    yes = un-mark particles after counting them
    no = do not un-mark particles after counting them  :pre

:ule

[Examples:]

compute nparticles all nparticles/tracer/region region_count count tracer tr periodic z -1 :pre

[Description:]

Define a computation that calculates the number and mass of marked and un-marked particles
that are in the region speficied via the {region_count} keyword. Particles have
to be in the group "group-ID" to be counted.

Note that only particles marked by a "fix property/atom/tracer"_fix_property_atom_tracer.html
or "fix property/atom/tracer/stream"_fix_property_atom_tracer_stream.html
command are counted - therefore, a valid ID of such a fix has to be
provided via the {tracer} keyword.

The {reset_marker} keyword controls if particles are un-marked (default)
after they have been counted once by this command.

IMPORTANT NOTE: If multiple compute nparticles/tracer/region
commands are operating on the same "fix property/atom/tracer"_fix_property_atom_tracer.html
commands, and the first compute resets the marker value, the second
compute will not count them.

With the {periodic} keyword, you can restrict counting/unmarking to
particles which are in a specified image in a periodic simulation.
For example, using

periodic z +2 :pre

means that particles are only counted if they are in z-image #2.
By default, all particles are counted/unmarked regardless in which
periodic image they are.

IMPORTANT NOTE: Currently, this command only supports one periodic
boundary restriction via the {periodic} keyword. If keyword {periodic}
is used multiple times, the last setting will be applied.

[Output info:]

This this compute calculates a global vector containing the following information
(the number in brackets corresponds to the vector id):

[(1)] total number of (marked + un-marked) particles in region :l
[(2)] number of marked particles in region :l
[(3)] total mass of (marked + un-marked) particles in region :l
[(4)] mass of marked particles in region :l

See "this section"_Section_howto.html#howto_8 for an overview of LIGGGHTS(R)-PUBLIC output
options.

[Restrictions:]

Currently, only one periodic restriction via the {periodic} keyword
can be used.

[Related commands:]

"fix property/atom/tracer"_fix_property_atom_tracer.html

[Default:]
{reset_marker} = yes, {periodic} is off per default
