2006-09-22 00:22:34 +08:00
|
|
|
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
|
|
|
|
|
|
|
:link(lws,http://lammps.sandia.gov)
|
|
|
|
:link(ld,Manual.html)
|
|
|
|
:link(lc,Section_commands.html#comm)
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
region command :h3
|
|
|
|
|
|
|
|
[Syntax:]
|
|
|
|
|
2010-10-29 08:17:32 +08:00
|
|
|
region ID style args keyword arg ... :pre
|
2006-09-22 00:22:34 +08:00
|
|
|
|
|
|
|
ID = user-assigned name for the region :ulb,l
|
2010-08-20 00:01:18 +08:00
|
|
|
style = {delete} or {block} or {cone} or {cylinder} or {plane} or {prism} or {sphere} or {union} or {intersect} :l
|
|
|
|
{delete} = no args
|
2009-07-13 23:55:54 +08:00
|
|
|
{block} args = xlo xhi ylo yhi zlo zhi
|
2009-06-24 01:19:47 +08:00
|
|
|
xlo,xhi,ylo,yhi,zlo,zhi = bounds of block in all dimensions (distance units)
|
2009-07-13 23:55:54 +08:00
|
|
|
{cone} args = dim c1 c2 radlo radhi lo hi
|
2009-06-24 01:19:47 +08:00
|
|
|
dim = {x} or {y} or {z} = axis of cone
|
|
|
|
c1,c2 = coords of cone axis in other 2 dimensions (distance units)
|
|
|
|
radlo,radhi = cone radii at lo and hi end (distance units)
|
|
|
|
lo,hi = bounds of cone in dim (distance units)
|
2006-09-22 00:22:34 +08:00
|
|
|
{cylinder} args = dim c1 c2 radius lo hi
|
|
|
|
dim = {x} or {y} or {z} = axis of cylinder
|
|
|
|
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
|
|
|
|
radius = cylinder radius (distance units)
|
|
|
|
lo,hi = bounds of cylinder in dim (distance units)
|
2010-01-01 05:08:23 +08:00
|
|
|
{plane} args = px py pz nx ny nz
|
2010-01-09 06:54:29 +08:00
|
|
|
px,py,pz = point on the plane (distance units)
|
2010-01-01 05:08:23 +08:00
|
|
|
nx,ny,nz = direction normal to plane (distance units)
|
2007-03-08 09:01:08 +08:00
|
|
|
{prism} args = xlo xhi ylo yhi zlo zhi xy xz yz
|
2009-06-24 01:19:47 +08:00
|
|
|
xlo,xhi,ylo,yhi,zlo,zhi = bounds of untilted prism (distance units)
|
|
|
|
xy = distance to tilt y in x direction (distance units)
|
|
|
|
xz = distance to tilt z in x direction (distance units)
|
|
|
|
yz = distance to tilt z in y direction (distance units)
|
2006-10-13 04:46:30 +08:00
|
|
|
{sphere} args = x y z radius
|
2009-06-24 01:19:47 +08:00
|
|
|
x,y,z = center of sphere (distance units)
|
|
|
|
radius = radius of sphere (distance units)
|
2006-09-22 00:22:34 +08:00
|
|
|
{union} args = N reg-ID1 reg-ID2 ...
|
|
|
|
N = # of regions to follow, must be 2 or greater
|
|
|
|
reg-ID1,reg-ID2, ... = IDs of regions to join together
|
|
|
|
{intersect} args = N reg-ID1 reg-ID2 ...
|
|
|
|
N = # of regions to follow, must be 2 or greater
|
|
|
|
reg-ID1,reg-ID2, ... = IDs of regions to intersect :pre
|
2010-10-29 08:17:32 +08:00
|
|
|
zero or more keyword/arg pairs may be appended :l
|
|
|
|
keyword = {side} or {units} or {move} or {rotate} :l
|
2006-09-22 00:22:34 +08:00
|
|
|
{side} value = {in} or {out}
|
|
|
|
{in} = the region is inside the specified geometry
|
|
|
|
{out} = the region is outside the specified geometry
|
|
|
|
{units} value = {lattice} or {box}
|
|
|
|
{lattice} = the geometry is defined in lattice units
|
2010-01-12 04:54:59 +08:00
|
|
|
{box} = the geometry is defined in simulation box units
|
2010-10-29 08:17:32 +08:00
|
|
|
{move} args = v_x v_y v_z
|
|
|
|
v_x,v_y,v_z = equal-style variables for x,y,z displacement of region over time
|
2010-10-29 08:19:00 +08:00
|
|
|
{rotate} args = v_theta Px Py Pz Rx Ry Rz
|
2010-10-29 08:17:32 +08:00
|
|
|
v_theta = equal-style variable for rotaton of region over time (in radians)
|
|
|
|
Px,Py,Pz = origin for axis of rotation (distance units)
|
|
|
|
Rx,Ry,Rz = axis of rotation vector :pre
|
2006-09-22 00:22:34 +08:00
|
|
|
:ule
|
|
|
|
|
|
|
|
[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
|
2009-01-09 07:18:29 +08:00
|
|
|
region void cylinder y 2 3 5 -5.0 EDGE units box
|
2006-10-13 04:37:55 +08:00
|
|
|
region 1 prism 0 10 0 10 0 10 2 0 0
|
2010-01-12 04:54:59 +08:00
|
|
|
region outside union 4 side1 side2 side3 side4
|
2010-10-29 08:17:32 +08:00
|
|
|
region 2 sphere 0.0 0.0 0.0 5 side out move v_left v_up NULL :pre
|
2010-01-12 04:54:59 +08:00
|
|
|
|
2006-09-22 00:22:34 +08:00
|
|
|
[Description:]
|
|
|
|
|
|
|
|
This command defines a geometric region of space. Various other
|
|
|
|
commands use regions. For example, the region can be filled with
|
2010-10-12 00:45:51 +08:00
|
|
|
atoms via the "create_atoms"_create_atoms.html command. Or a bounding
|
|
|
|
box around the region, can be used to define the simulation box via
|
|
|
|
the "create_box"_create_box.html command. Or the atoms in the region
|
|
|
|
can be identified as a group via the "group"_group.html command, or
|
|
|
|
deleted via the "delete_atoms"_delete_atoms.html command. Or the
|
|
|
|
surface of the region can be used as a boundary wall via the "fix
|
|
|
|
wall/region"_fix_wall_region.html command.
|
2006-09-22 00:22:34 +08:00
|
|
|
|
2010-01-12 04:54:59 +08:00
|
|
|
Normally, regions in LAMMPS are "static", meaning their geometric
|
2010-10-29 08:17:32 +08:00
|
|
|
extent does not change with time. If the {move} or {rotate} keyword
|
|
|
|
is used, as described below, the region becomes "dynamic", meaning
|
|
|
|
it's location or orientation changes with time. This may be useful,
|
|
|
|
for example, when thermostatting a region, via the compute temp/region
|
|
|
|
command, or when the fix wall/region command uses a region surface as
|
|
|
|
a bounding wall on particle motion, i.e. a rotating container.
|
2010-01-12 04:54:59 +08:00
|
|
|
|
2010-08-20 00:01:18 +08:00
|
|
|
The {delete} style removes the named region. Since there is little
|
|
|
|
overhead to defining extra regions, there is normally no need to do
|
|
|
|
this, unless you are defining and discarding large numbers of regions
|
|
|
|
in your input script.
|
|
|
|
|
2009-06-24 01:19:47 +08:00
|
|
|
The lo/hi values for {block} or {cone} or {cylinder} or {prism} styles
|
|
|
|
can be specified as EDGE or INF. EDGE means they extend all the way
|
|
|
|
to the global simulation box boundary. Note that this is the current
|
|
|
|
box boundary; if the box changes size during a simulation, the region
|
|
|
|
does not. INF means a large negative or positive number (1.0e20), so
|
|
|
|
it should encompass the simulation box even if it changes size. If a
|
2007-08-07 21:47:11 +08:00
|
|
|
region is defined before the simulation box has been created (via
|
|
|
|
"create_box"_create_box.html or "read_data"_read_data.html or
|
|
|
|
"read_restart"_read_restart.html commands), then an EDGE or INF
|
2010-01-09 06:54:29 +08:00
|
|
|
parameter cannot be used. For a {prism} region, a non-zero tilt
|
|
|
|
factor in any pair of dimensions cannot be used if both the lo/hi
|
|
|
|
values in either of those dimensions are INF. E.g. if the xy tilt is
|
|
|
|
non-zero, then xlo and xhi cannot both be INF, nor can ylo and yhi.
|
|
|
|
|
|
|
|
IMPORTANT NOTE: Regions in LAMMPS do not get wrapped across periodic
|
|
|
|
boundaries, as specified by the "boundary"_boundary.html command. For
|
|
|
|
example, a spherical region that is defined so that it overlaps a
|
|
|
|
periodic boundary is not treated as 2 half-spheres, one on either side
|
|
|
|
of the simulation box.
|
|
|
|
|
|
|
|
IMPORTANT NOTE: Regions in LAMMPS are always 3d geometric objects,
|
|
|
|
regardless of whether the "dimension"_dimension.html of a simulation
|
|
|
|
is 2d or 3d. Thus when using regions in a 2d simulation, you should
|
|
|
|
be careful to define the region so that its intersection with the 2d
|
2010-10-29 08:17:32 +08:00
|
|
|
x-y plane of the simulation has the 2d geometric extent you want.
|
2006-09-22 00:22:34 +08:00
|
|
|
|
2009-06-24 01:19:47 +08:00
|
|
|
For style {cone}, an axis-aligned cone is defined which is like a
|
|
|
|
{cylinder} except that two different radii (one at each end) can be
|
2010-01-09 06:54:29 +08:00
|
|
|
defined. Either of the radii (but not both) can be 0.0.
|
2009-06-24 01:19:47 +08:00
|
|
|
|
|
|
|
For style {cone} and {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 specifies a cylinder with its axis in the
|
2006-09-22 00:22:34 +08:00
|
|
|
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.
|
|
|
|
|
2010-01-09 06:54:29 +08:00
|
|
|
For style {plane}, a plane is defined which contain the point
|
|
|
|
(px,py,pz) and has a normal vector (nx,ny,nz). The normal vector does
|
|
|
|
not have to be of unit length. The "inside" of the plane is the
|
|
|
|
half-space in the direction of the normal vector; see the discussion
|
|
|
|
of the {side} option below.
|
|
|
|
|
2007-03-08 09:01:08 +08:00
|
|
|
For style {prism}, a parallelepiped is defined (it's too hard to spell
|
2010-10-15 07:23:43 +08:00
|
|
|
parallelepiped in an input script!). The parallelepiped has its
|
|
|
|
"origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting
|
|
|
|
from the origin given by A = (xhi-xlo,0,0); B = (xy,yhi-ylo,0); C =
|
|
|
|
(xz,yz,zhi-zlo). {Xy,xz,yz} can be 0.0 or positive or negative values
|
|
|
|
and are called "tilt factors" because they are the amount of
|
|
|
|
displacement applied to faces of an originally orthogonal box to
|
|
|
|
transform it into the parallelepiped.
|
|
|
|
|
|
|
|
A prism region that will be used with the "create_box"_create_box.html
|
|
|
|
command to define a triclinic simulation box must have tilt factors
|
|
|
|
(xy,xz,yz) that do not skew the box more than half the distance of
|
|
|
|
corresponding the parallel box length. For example, if xlo = 2 and
|
2007-06-20 20:56:17 +08:00
|
|
|
xhi = 12, then the x box length is 10 and the xy tilt factor must be
|
|
|
|
between -5 and 5. Similarly, both xz and yz must be between
|
|
|
|
-(xhi-xlo)/2 and +(yhi-ylo)/2. Note that this is not a limitation,
|
|
|
|
since if the maximum tilt factor is 5 (as in this example), then
|
|
|
|
configurations with tilt = ..., -15, -5, 5, 15, 25, ... are all
|
2010-10-15 07:23:43 +08:00
|
|
|
geometrically equivalent.
|
|
|
|
|
|
|
|
See "this section"_Section_howto.html#4_12 of the doc pages for a
|
|
|
|
geometric description of triclinic boxes, as defined by LAMMPS, and
|
2010-10-15 07:31:42 +08:00
|
|
|
how to transform these parameters to and from other commonly used
|
|
|
|
triclinic representations.
|
2007-06-20 20:56:17 +08:00
|
|
|
|
2006-09-22 00:22:34 +08:00
|
|
|
The {union} style creates a region consisting of the volume of all the
|
2008-03-01 09:13:20 +08:00
|
|
|
listed regions combined. The {intersect} style creates a region
|
2006-09-22 00:22:34 +08:00
|
|
|
consisting of the volume that is common to all the listed regions.
|
|
|
|
|
2010-01-12 04:54:59 +08:00
|
|
|
:line
|
|
|
|
|
2006-09-22 00:22:34 +08:00
|
|
|
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
|
2010-01-09 06:54:29 +08:00
|
|
|
to define the region for any argument above listed as having distance
|
2010-01-12 04:54:59 +08:00
|
|
|
units. It also affects the scaling of the velocity vector specfied
|
|
|
|
with the {vel} keyword, the amplitude vector specified with the
|
|
|
|
{wiggle} keyword, and the rotation point specified with the {rotate}
|
|
|
|
keyword, since they each involve a distance metric.
|
|
|
|
|
|
|
|
A {box} value selects standard distance units as defined by the
|
|
|
|
"units"_units.html command, e.g. Angstroms for units = real or metal.
|
|
|
|
A {lattice} value means the distance units are in lattice spacings.
|
|
|
|
The "lattice"_lattice.html command must have been previously used to
|
|
|
|
define the lattice spacings which are used as follows:
|
2010-01-09 06:54:29 +08:00
|
|
|
|
|
|
|
For style {block}, the lattice spacing in dimension x is applied to
|
|
|
|
xlo and xhi, similarly the spacings in dimensions y,z are applied to
|
|
|
|
ylo/yhi and zlo/zhi. :ulb,l
|
|
|
|
|
|
|
|
For style {cone}, the lattice spacing in argument {dim} is applied to
|
|
|
|
lo and hi. The spacings in the two radial dimensions are applied to
|
|
|
|
c1 and c2. The two cone radii are scaled by the lattice
|
|
|
|
spacing in the dimension corresponding to c1. :l
|
|
|
|
|
|
|
|
For style {cylinder}, the lattice spacing in argument {dim} is applied
|
|
|
|
to lo and hi. The spacings in the two radial dimensions are applied
|
|
|
|
to c1 and c2. The cylinder radius is scaled by the lattice
|
|
|
|
spacing in the dimension corresponding to c1. :l
|
|
|
|
|
|
|
|
For style {plane}, the lattice spacing in dimension x is applied to
|
|
|
|
px and nx, similarly the spacings in dimensions y,z are applied to
|
|
|
|
py/ny and pz/nz. :l
|
|
|
|
|
|
|
|
For style {prism}, the lattice spacing in dimension x is applied to
|
|
|
|
xlo and xhi, similarly for ylo/yhi and zlo/zhi. The lattice spacing
|
|
|
|
in dimension x is applied to xy and xz, and the spacing in dimension y
|
|
|
|
to yz. :l
|
|
|
|
|
|
|
|
For style {sphere}, the lattice spacing in dimensions x,y,z are
|
|
|
|
applied to the sphere center x,y,z. The spacing in dimension x is
|
|
|
|
applied to the sphere radius. :l,ule
|
2006-09-22 00:22:34 +08:00
|
|
|
|
2010-01-12 04:54:59 +08:00
|
|
|
:line
|
|
|
|
|
2010-10-29 08:17:32 +08:00
|
|
|
If the {move} or {rotate} keywords are used, the region is "dynamic",
|
|
|
|
meaning its location or orientation changes with time. These keywords
|
|
|
|
cannot be used with a {union} or {intersect} style region. Instead,
|
|
|
|
the keywords should be used to make the individual sub-regions of the
|
|
|
|
{union} or {intersect} region dynamic. Normally, each sub-region
|
|
|
|
should be "dynamic" in the same manner (e.g. rotate around the same
|
|
|
|
point), though this is not a requirement.
|
|
|
|
|
|
|
|
The {move} keyword allows one or more "equal-style
|
|
|
|
variables"_variable.html to be used to specify the x,y,z displacement
|
|
|
|
of the region, typically as a function of time. A variable is
|
|
|
|
specified as v_name, where name is the variable name. Any of the
|
|
|
|
three variables can be specified as NULL, in which case no
|
|
|
|
displacement is calculated in that dimension.
|
|
|
|
|
|
|
|
Note that equal-style variables can specify formulas with various
|
|
|
|
mathematical functions, and include "thermo_style"_thermo_style.html
|
|
|
|
command keywords for the simulation box parameters and timestep and
|
|
|
|
elapsed time. Thus it is easy to specify a region displacement that
|
|
|
|
change as a function of time or spans consecutive runs in a continuous
|
|
|
|
fashion. For the latter, see the {start} and {stop} keywords of the
|
|
|
|
"run"_run.html command and the {elaplong} keyword of "thermo_style
|
|
|
|
custom"_thermo_style.html for details.
|
|
|
|
|
|
|
|
For example, these commands would displace a region from its initial
|
|
|
|
position, in the positive x direction, effectively at a constant
|
|
|
|
velocity:
|
|
|
|
|
|
|
|
variable dx equal ramp(0,10)
|
|
|
|
region 2 sphere 10.0 10.0 0.0 5 move v_dx NULL NULL :pre
|
|
|
|
|
|
|
|
Note that the initial displacemet is 0.0, though that is not required.
|
|
|
|
|
|
|
|
Either of these varaibles would "wiggle" the region back and forth in
|
|
|
|
the y direction:
|
|
|
|
|
|
|
|
variable dy equal swiggle(0,5,100)
|
|
|
|
variable dysame equal 5*sin(2*PI*elaplong*dt/100)
|
|
|
|
region 2 sphere 10.0 10.0 0.0 5 move NULL v_dy NULL :pre
|
|
|
|
|
|
|
|
The {rotate} keyword rotates the region around a rotation axis {R} =
|
|
|
|
(Rx,Ry,Rz) that goes thru a point {P} = (Px,Py,Pz). The rotation
|
|
|
|
angle is calculated, presumably as a function of time, by a variable
|
|
|
|
specified as v_theta, where theta is the variable name. The variable
|
|
|
|
should generate its result in radians. The direction of rotation for
|
|
|
|
the region around the rotation axis is consistent with the right-hand
|
2010-01-12 04:54:59 +08:00
|
|
|
rule: if your right-hand thumb points along {R}, then your fingers
|
|
|
|
wrap around the axis in the direction of rotation.
|
|
|
|
|
2010-10-29 08:17:32 +08:00
|
|
|
The {move} and {rotate} keywords can be used together. In this case,
|
|
|
|
the displacement specified by the {move} keyword is applied to the {P}
|
|
|
|
point of the {rotate} keyword.
|
|
|
|
|
2007-03-09 08:00:06 +08:00
|
|
|
[Restrictions:]
|
2006-09-22 00:22:34 +08:00
|
|
|
|
2006-10-13 04:37:55 +08:00
|
|
|
A prism cannot be of 0.0 thickness in any dimension; use a small z
|
2007-03-08 09:01:08 +08:00
|
|
|
thickness for 2d simulations. For 2d simulations, the xz and yz
|
|
|
|
parameters must be 0.0.
|
2006-10-13 04:37:55 +08:00
|
|
|
|
2006-09-22 00:22:34 +08:00
|
|
|
[Related commands:]
|
|
|
|
|
|
|
|
"lattice"_lattice.html, "create_atoms"_create_atoms.html,
|
|
|
|
"delete_atoms"_delete_atoms.html, "group"_group.html
|
|
|
|
|
|
|
|
[Default:]
|
|
|
|
|
2010-10-29 08:19:00 +08:00
|
|
|
The option defaults are side = in, units = lattice, and no move or
|
2010-10-29 08:17:32 +08:00
|
|
|
rotation.
|