LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

region command

Syntax:

region ID style args keyword value ... 

Examples:

region 1 block -3.0 5.0 INF 10.0 INF INF
region 2 sphere 0.0 0.0 0.0 5 side out
region void cylinder y 2 3 5 -5.0 INF units box
region 1 prism 0 10 0 10 0 10 2 0 0
region outside union 4 side1 side2 side3 side4 

Description:

This command defines a geometric region of space. Various other commands use regions. For example, the region can be filled with atoms via the create_atoms command. Or the atoms in the region can be identified as a group via the group command, or deleted via the delete_atoms command.

The lo/hi values for block or cylinder or prism styles can be specified as INF which means they extend all the way to the global simulation box boundary. If a region is defined before the simulation box has been created (via create_box or read_data or read_restart commands), then an INF parameter cannot be used.

For style cylinder, the c1,c2 params are coordinates in the 2 other dimensions besides the cylinder axis dimension. For dim = x, c1/c2 = y/z; for dim = y, c1/c2 = x/z; for dim = z, c1/c2 = x/y. Thus the third example above specifes a cylinder with its axis in the y-direction located at x = 2.0 and z = 3.0, with a radius of 5.0, and extending in the y-direction from -5.0 to the upper box boundary.

For style prism, a tilted block is defined. The bounds of the untilted axis-aligned block are specified in the same way as for the block style. A tilt factor for each dimension with respect to another dimension is also specified. If the lower xy face of the prism is initially a rectangle (untilted), then the yxtilt factor specifies how far the upper y edge of that face is shifted in the x direction (skewing that face, keeping the xy face a parallelogram). A plus or minus value can be chosen; 0.0 would be no tilt. Similarly, zxtilt and zytilt describe how far the upper xy face of the prism is translated in the x and y directions to further tilt the prism. The final prism shape remains a parallelipiped, with opposing pairs of the 6 faces remaining parallel to each other.

The union style creates a region consisting of the volume of all the listed regions combined. The intesect style creates a region consisting of the volume that is common to all the listed regions.

The side keyword determines whether the region is considered to be inside or outside of the specified geometry. Using this keyword in conjunction with union and intersect regions, complex geometries can be built up. For example, if the interior of two spheres were each defined as regions, and a union style with side = out was constructed listing the region-IDs of the 2 spheres, the resulting region would be all the volume in the simulation box that was outside both of the spheres.

The units keyword determines the meaning of the distance units used to define the region. A box value selects standard distance units as defined by the units command, e.g. Angstroms for units = real or metal. A lattice value means the distance units are in lattice spacings. The lattice command must have been previously used to define the lattice spacing.

Restrictions: none

A prism cannot be of 0.0 thickness in any dimension; use a small z thickness for 2d simulations. For 2d simulations, the zxtilt and zytilt parameters must be 0.0.

Related commands:

lattice, create_atoms, delete_atoms, group

Default:

The option defaults are side = in and units = lattice.