Commit 1a213363 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

add group style to create an empty group directly

parent 63714c70
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -13,11 +13,13 @@ group command :h3
group ID style args :pre

ID = user-defined name of the group :ulb,l
style = {delete} or {region} or {type} or {id} or {molecule} or {variable} or \
style = {delete} or {clear} or {empty} or {region} or \
        {type} or {id} or {molecule} or {variable} or \
        {include} or {subtract} or {union} or {intersect} or \
        {dynamic} or {static} :l
  {delete} = no args
  {clear} = no args
  {empty} = no args
  {region} args = region-ID
  {type} or {id} or {molecule}
    args = list of one or more atom types, atom IDs, or molecule IDs
@@ -99,6 +101,10 @@ e.g. using the "run every"_run.html command if a fix or compute or
other operation expects the atoms in the group to remain constant, but
LAMMPS does not check for this.

The {empty} style creates an empty group, which is useful for commands
like "fix gcmc"_fix_gcmc.html or with complex scripts that add atoms
to a group.

The {region} style puts all atoms in the region volume into the group.
Note that this is a static one-time assignment.  The atoms remain
assigned (or not assigned) to the group even in they later move out of
+6 −0
Original line number Diff line number Diff line
@@ -188,6 +188,12 @@ void Group::assign(int narg, char **arg)
      if (domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
        mask[i] |= bit;

  // create an empty group

  } else if (strcmp(arg[1],"empty") == 0) {

    ; // nothing to do here

  // style = type, molecule, id
  // add to group if atom matches type/molecule/id or condition