diff --git a/doc/src/group.txt b/doc/src/group.txt index afa218c5a34880aa0ef71935be0d1f825fd79c08..81c38c106e58c610552ace7814a8a6e1bb3d2c47 100644 --- a/doc/src/group.txt +++ b/doc/src/group.txt @@ -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 diff --git a/src/group.cpp b/src/group.cpp index 76275f301d34272e6e6d1c8572c37840eb6c73f6..93c9c12bcf8df5618cae05075181ba396787ae18 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -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