SPARTA WWW Site - SPARTA Documentation - SPARTA Commands

group command

Syntax:

group ID which style args 

Examples:

group sphere surf type 1 3
group sphere surf id 50 100:150
group sphere surf id <= 1000
group sphere surf id <> 50 250
group patch grid region leftedge
group patch surf region cutout
group boundary surf subtract all a2 a3
group boundary grid union lower upper
group boundary surf union lower upper
group boundary surf intersect upper leftside 

Description:

Assign grid cells to grid groups or surface elements to surface groups. In SPARTA, a "grid group" is a collection of one or more grid cells. A "surface" group is a collection of one or more surface elements (line segements in 2d, triangles in 3d). Other commands take group IDs as arguments so that they act on a set of grid cells or surface elements. For example, see the compute grid, compute surf, fix ave/grid, fix ave/surf, dump grid, or dump surf commands.

An individual grid cell can belong to multiple grid groups. An individual surface element can belong to multiple surface groups. Each grid or surface group has a name which is specified as the ID in this command. Each grid group and surface group ID must be unique, though the same ID can be used for both a grid and surface group. IDs can only contain alphanumeric characters and underscores.

If the specified group ID already exists, grid cells or surface elements are added to the group. Otherwise a new group is created. This means the group command can be used multiple times with the same group ID to incrementally add grid cells or surface elements to the group.

A grid group with the ID all is pre-defined. All grid cells belong to this group. Likewise, a surface group with the ID all is pre-defined. All surface elements belong to this group.

After this command has performed its grid cell or surface elements assignments, statistics about the group are printed to the screen, so that you can check if the command operated as you expect.

Note that this command assigns all flavors of child grid cells to groups, which includes unsplit, cut, split, and sub cells. See Section 4.8 of the manual gives details of how SPARTA defines child, unsplit, split, and sub cells.


The following styles can be used for grid groups.

The region style puts all grid cells in the region volume associated with the region-ID into the group. See the region command for details on what kind of geometric regions can be defined. Note that the side option for the region command can be used to define whether the inside or outside of the geometric region is considered to be "in" the region.

The rflag setting determines how a grid cell is judged to be in the region or not. For rflag = one, it is in the region if any of its corner points (4 for 2d, 8 for 3d) is in the region. For rflag = all, all its corner points must be in the region. For rflag = center, the center point of the grid cell must be in the region.


The following styles can be used for surface groups.

The type and id styles put all surface elements with the specified types or surface element IDs into the group. These two styles can use arguments specified in one of two formats.

For surface elements, the "type" of each element is defined when the elements are read from a surface file, via the read_surf command. In the file, a positive integer type value can be optionally defined for each element (default = 1). The specified type values can also be incremented using the typeadd keyword of the read_surf commmand.

For surface elements, the "ID" of each element is simply its index from 1 to N, for all N surface elements that have been read in via the read_surf command. The ordering of IDs is determined by the order the elements appear in the read-in surface file. If multiple files are read (or the same file multiple times), IDs increase monotonically each time new surface elements are added.

The first format is a list of values (types or IDs). For example, the first command in the examples above puts all surface elements of type 1 and 3 into the group named sphere. Each entry in the list can optionally be a colon-separated range A:B, as in the second axample above. A "range" is a series of values (types or IDs). The second example with 100:150 adds all surface elements with IDs from 100 to 150 (inclusive) to the group named sphere, along with element 50 since it also appears in the list of values.

The second format is a logical operator followed by one or two values (type or ID). The 7 valid logicals are listed above. All the logicals except "<>" take a single argument. The third example above adds all surface elements with IDs from 1 to 1000 to the group named sphere. The logical "<>" means "between" and takes 2 arguments. The fourth example above adds all surface elements IDs from 50 to 250 (inclusive) to the group named sphere.

The region style puts all surface elements in the region volume associated with the region-ID into the group. See the region command for details on what kind of geometric regions can be defined. Note that the side option for the region command can be used to define whether the inside or outside of the geometric region is considered to be "in" the region.

The rflag setting determines how a surface element is judged to be in the region or not. For rflag = one, it is in the region if any of its corner points (3 for triangle, 2 for line) is in the region. For rflag = all, all its corner points must be in the region. For rflag = center, the center point of the line segment or centroid point of the triangle must be in the region.


The following styles can be used for either grid or surface groups.

The subtract style takes a list of two or more existing group names as arguments. All grid cells or surface elements that belong to the 1st group, but not to any of the other groups are added to the specified group.

The union style takes a list of one or more existing group names as arguments. All grid cells or surface elements that belong to any of the listed groups are added to the specified group.

The intersect style takes a list of two or more existing group names as arguments. Grid cells or surface elements that belong to every one of the listed groups are added to the specified group.

The clear style un-assigns all grid cells or surface elements that were assigned to that group. This is a way to empty a group before adding more grid cells or surface elements to it.


Restrictions:

No more than 32 grid groups and no more than 32 surface groups can be defined, including "all".

Related commands:

dump, region, compute grid, compute surf

Default:

All grid cells belong to the "all" grid group. All surface elements belong to the "all" surface group.