SPARTA WWW Site - SPARTA Documentation - SPARTA Commands

compute property/grid command


compute ID property/grid group-ID input1 input2 ... 


compute 1 all property/grid id xc yc zc 


Define a computation that simply stores grid attributes for each grid cell in a grid cell group. This is useful so that the values can be used by other output commands that take computes as inputs. See for example, the compute reduce, fix ave/grid, and dump grid commands.

Only grid cells in the grid group specified by group-ID are included in the calculation. See the group grid command for info on how grid cells can be assigned to grid groups.

The values are stored in a per-grid vector or array as discussed below.

Id is the grid cell ID. In SPARTA each grid cell is assigned a unique ID which represents its location, in a topological sense, within the hierarchical grid. This ID is stored as an integer such as 5774983, but can also be decoded into a string such as 33-4-6, which makes it easier to understand the grid hierarchy. In this case it means the grid cell is at the 3rd level of the hierarchy. Its grandparent cell was 33 at the 1st level, its parent was cell 4 (at level 2) within cell 33, and the cell itself is cell 6 (at level 3) within cell 4 within cell 33. If you specify id, the ID is printed directly as an integer. The ID in string format can be accessed by the dump grid command and its idstr argument.

Proc is the ID of the processor which currently owns the grid cell.

The xlo, ylo, zlo attributes are the coordinates of the lower-left corner of the grid cell in the appropriate distance units. The xhi, yhi, zhi are the coordinates of the upper-right corner of the grid cell. The xc, yc, zc attributes are the coordinates of the center point of the grid cell. The zlo, zhi, zc attributes cannot be used for a 2d simulation.

The vol attribute is the flow volume of the grid cell (or area in 2d). Flow volume is the portion of the grid cell that is accessible to particles, i.e. outside any closed surface that may intersect the cell.

Output info:

This compute calculates a per-grid vector or per-grid array depending on the number of input values. If a single input is specified, a per-grid vector is produced. If two or more inputs are specified, a per-grid array is produced where the number of columns = the number of inputs.

This compute performs calculations for all flavors of child grid cells in the simulation, 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 id and xlo,ylo,zlo and xhi,yhi,zhi values for a split cell and its sub cells are all the same. The vol of a cut cell is the portion of the cell in the flow. The vol of a split cell is the same as if it were unsplit. The vol of each sub cell within a split cell is its portion of the flow volume.

Grid cells not in the specified group-ID will output zeroes for all their values.

The vector or array can be accessed by any command that uses per-atom values from a compute as input. See Section 4.4 for an overview of SPARTA output options.

The vector or array values will be in whatever units the corresponding attribute is in, e.g. distance units for xlo or xc.

Restrictions: none

Related commands:

dump grid, compute reduce, fix ave/grid

Default: none