diff --git a/doc/fix_indent.html b/doc/fix_indent.html index 945aad6186..76abc80b33 100644 --- a/doc/fix_indent.html +++ b/doc/fix_indent.html @@ -122,12 +122,11 @@ the right edge, even if the box size changes:

variable x equal "xlo + 0.25*lx" 
 
-

Similarly, these variable definitions will move the indenter at a -constant velocity: +

Similarly, either of these variable definitions will move the indenter +from an initial position at 2.5 at a constant velocity of 5:

-
variable x0 equal 2.5
-variable vx equal 5.0
-variable x equal "v_x0 + step*dt*v_vx" 
+
variable x equal "2.5 + 5*elaplong*dt"
+variable x equal vdisplace(2.5,5) 
 

If a spherical indenter's radius is specified as v_r, then these variable definitions will grow the size of the indenter at a specfied diff --git a/doc/fix_indent.txt b/doc/fix_indent.txt index eacdb72d4b..65811ef770 100644 --- a/doc/fix_indent.txt +++ b/doc/fix_indent.txt @@ -113,12 +113,11 @@ the right edge, even if the box size changes: variable x equal "xlo + 0.25*lx" :pre -Similarly, these variable definitions will move the indenter at a -constant velocity: +Similarly, either of these variable definitions will move the indenter +from an initial position at 2.5 at a constant velocity of 5: -variable x0 equal 2.5 -variable vx equal 5.0 -variable x equal "v_x0 + step*dt*v_vx" :pre +variable x equal "2.5 + 5*elaplong*dt" +variable x equal vdisplace(2.5,5) :pre If a spherical indenter's radius is specified as v_r, then these variable definitions will grow the size of the indenter at a specfied diff --git a/doc/region.html b/doc/region.html index 0978c4926e..1f291ccd07 100644 --- a/doc/region.html +++ b/doc/region.html @@ -13,7 +13,7 @@

Syntax:

-
region ID style args keyword value ... 
+
region ID style args keyword arg ... 
 
-
  • zero or more keyword/value pairs may be appended +
  • zero or more keyword/arg pairs may be appended -
  • keyword = side or units or vel or wiggle or rotate +
  • keyword = side or units or move or rotate
      side value = in or out
         in = the region is inside the specified geometry
    @@ -60,15 +60,12 @@
       units value = lattice or box
         lattice = the geometry is defined in lattice units
         box = the geometry is defined in simulation box units
    -  vel args = Vx Vy Vz
    -    Vx,Vy,Vz = components of velocity vector (velocity units)
    -  wiggle args = Ax Ay Az period
    -    Ax,Ay,Az = components of amplitude vector (distance units)
    -    period = period of oscillation (time units)
    -  rotate args = Px Py Pz Rx Ry Rz period
    -    Px,Py,Pz = origin point of axis of rotation (distance units)
    -    Rx,Ry,Rz = axis of rotation vector
    -    period = period of rotation (time units) 
    +  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
    + rotate args = v_theta Px Py Pz Rx Ry Rz
    +    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 
     
    @@ -79,7 +76,7 @@ region 2 sphere 0.0 0.0 0.0 5 side out region void cylinder y 2 3 5 -5.0 EDGE units box region 1 prism 0 10 0 10 0 10 2 0 0 region outside union 4 side1 side2 side3 side4 -region 2 sphere 0.0 0.0 0.0 5 side out wiggle 1 1 0 10 +region 2 sphere 0.0 0.0 0.0 5 side out move v_left v_up NULL
  • Description:

    @@ -94,13 +91,12 @@ surface of the region can be used as a boundary wall via the vel or wiggle 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. +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.

    The delete style removes the named region. Since there is little overhead to defining extra regions, there is normally no need to do @@ -131,7 +127,7 @@ of the simulation box. regardless of whether the dimension 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 -x-y plane of the simulation is the 2d geometric object you want. +x-y plane of the simulation has the 2d geometric extent you want.

    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 @@ -232,44 +228,59 @@ applied to the sphere radius.


    -

    If the vel or wiggle or rotate keywords are used, the region -is "dynamic", meaning its location or orientation changes with time. -No more than one of these keywords can be used at a time. These -keywords cannot be used with a union or intersect style region. -Instead, the keywords should be used to define the individual -sub-regions of the union or intersect region. Normally, each -sub-region should be "dynamic" in the same manner (e.g. rotate around -the same point), though this is not a requirement. +

    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 vel style moves the region at a constant velocity, so that its -position X = (x,y,z) as a function of time is given in vector -notation as +

    The move keyword allows one or more equal-style +variables 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.

    -
    X(t) = X0 + V * delta 
    +

    Note that equal-style variables can specify formulas with various +mathematical functions, and include thermo_style +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 command and the elaplong keyword of thermo_style +custom 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 
     
    -

    where X0 = (x0,y0,z0) is its position at the time the region is -specified, V is the specified velocity vector with components -(Vx,Vy,Vz), and delta is the time elapsed since the region was -specified. +

    Note that the initial displacemet is 0.0, though that is not required.

    -

    The wiggle style moves the region in an oscillatory fashion, so that -its position X = (x,y,z) as a function of time is given in vector -notation as +

    Either of these varaibles would "wiggle" the region back and forth in +the y direction:

    -
    X(t) = X0 + A sin(omega*delta) 
    +
    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 
     
    -

    where X0 = (x0,y0,z0) is its position at the time the region is -specified, A is the specified amplitude vector with components -(Ax,Ay,Az), omega is 2 PI / period, and delta is the time -elapsed since the region was specified. -

    -

    The rotate style rotates the region around a rotation axis R = -(Rx,Ry,Rz) that goes thru a point P = (Px,Py,Pz). The period of -the rotation is also specified. The direction of rotation for the -region around the rotation axis is consistent with the right-hand +

    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 rule: if your right-hand thumb points along R, then your fingers wrap around the axis in the direction of rotation.

    +

    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. +

    Restrictions:

    A prism cannot be of 0.0 thickness in any dimension; use a small z @@ -283,7 +294,7 @@ parameters must be 0.0.

    Default:

    -

    The option defaults are side = in, units = lattice, and no -velocity, wiggling, or rotation. +

    The option defaults are side = in, units = lattice, and no moving or +rotation.

    diff --git a/doc/region.txt b/doc/region.txt index 3d0eaa9769..36022ebb26 100644 --- a/doc/region.txt +++ b/doc/region.txt @@ -10,7 +10,7 @@ region command :h3 [Syntax:] -region ID style args keyword value ... :pre +region ID style args keyword arg ... :pre ID = user-assigned name for the region :ulb,l style = {delete} or {block} or {cone} or {cylinder} or {plane} or {prism} or {sphere} or {union} or {intersect} :l @@ -44,23 +44,20 @@ style = {delete} or {block} or {cone} or {cylinder} or {plane} or {prism} or {sp {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 -zero or more keyword/value pairs may be appended :l -keyword = {side} or {units} or {vel} or {wiggle} or {rotate} :l +zero or more keyword/arg pairs may be appended :l +keyword = {side} or {units} or {move} or {rotate} :l {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 {box} = the geometry is defined in simulation box units - {vel} args = Vx Vy Vz - Vx,Vy,Vz = components of velocity vector (velocity units) - {wiggle} args = Ax Ay Az period - Ax,Ay,Az = components of amplitude vector (distance units) - period = period of oscillation (time units) - {rotate} args = Px Py Pz Rx Ry Rz period - Px,Py,Pz = origin point of axis of rotation (distance units) - Rx,Ry,Rz = axis of rotation vector - period = period of rotation (time units) :pre + {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 + {rotate} args = v_theta Px Py Pz Rx Ry Rz + 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 :ule [Examples:] @@ -70,7 +67,7 @@ region 2 sphere 0.0 0.0 0.0 5 side out region void cylinder y 2 3 5 -5.0 EDGE units box region 1 prism 0 10 0 10 0 10 2 0 0 region outside union 4 side1 side2 side3 side4 -region 2 sphere 0.0 0.0 0.0 5 side out wiggle 1 1 0 10 :pre +region 2 sphere 0.0 0.0 0.0 5 side out move v_left v_up NULL :pre [Description:] @@ -85,13 +82,12 @@ surface of the region can be used as a boundary wall via the "fix wall/region"_fix_wall_region.html command. Normally, regions in LAMMPS are "static", meaning their geometric -extent does not change with time. If the {vel} or {wiggle} 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. +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. The {delete} style removes the named region. Since there is little overhead to defining extra regions, there is normally no need to do @@ -122,7 +118,7 @@ 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 -x-y plane of the simulation is the 2d geometric object you want. +x-y plane of the simulation has the 2d geometric extent you want. 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 @@ -223,44 +219,59 @@ applied to the sphere radius. :l,ule :line -If the {vel} or {wiggle} or {rotate} keywords are used, the region -is "dynamic", meaning its location or orientation changes with time. -No more than one of these keywords can be used at a time. These -keywords cannot be used with a {union} or {intersect} style region. -Instead, the keywords should be used to define the individual -sub-regions of the {union} or {intersect} region. Normally, each -sub-region should be "dynamic" in the same manner (e.g. rotate around -the same point), though this is not a requirement. +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 {vel} style moves the region at a constant velocity, so that its -position {X} = (x,y,z) as a function of time is given in vector -notation as +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. -X(t) = X0 + V * delta :pre +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. -where {X0} = (x0,y0,z0) is its position at the time the region is -specified, {V} is the specified velocity vector with components -(Vx,Vy,Vz), and {delta} is the time elapsed since the region was -specified. +For example, these commands would displace a region from its initial +position, in the positive x direction, effectively at a constant +velocity: -The {wiggle} style moves the region in an oscillatory fashion, so that -its position {X} = (x,y,z) as a function of time is given in vector -notation as +variable dx equal ramp(0,10) +region 2 sphere 10.0 10.0 0.0 5 move v_dx NULL NULL :pre -X(t) = X0 + A sin(omega*delta) :pre +Note that the initial displacemet is 0.0, though that is not required. -where {X0} = (x0,y0,z0) is its position at the time the region is -specified, {A} is the specified amplitude vector with components -(Ax,Ay,Az), {omega} is 2 PI / {period}, and {delta} is the time -elapsed since the region was specified. +Either of these varaibles would "wiggle" the region back and forth in +the y direction: -The {rotate} style rotates the region around a rotation axis {R} = -(Rx,Ry,Rz) that goes thru a point {P} = (Px,Py,Pz). The {period} of -the rotation is also specified. The direction of rotation for the -region around the rotation axis is consistent with the right-hand +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 rule: if your right-hand thumb points along {R}, then your fingers wrap around the axis in the direction of rotation. +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. + [Restrictions:] A prism cannot be of 0.0 thickness in any dimension; use a small z @@ -274,5 +285,5 @@ parameters must be 0.0. [Default:] -The option defaults are side = in, units = lattice, and no -velocity, wiggling, or rotation. +The option defaults are side = in, units = lattice, and no moving or +rotation. diff --git a/doc/variable.html b/doc/variable.html index 05d4b9cb5e..d9bcc47cd2 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -433,7 +433,9 @@ run, according to this formula:

    The run begins on startstep. Startstep can span multiple runs, using the start keyword of the run command. See the -run command for details of how to do this. +run command for details of how to do this. Note that the +thermo_style keyword elaplong = +timestep-startstep.

    The swiggle(x,y,z) and cwiggle(x,y,z) functions each take 3 arguments: x = coord0, y = amplitude, z = period. They use the elapsed time to @@ -448,7 +450,9 @@ value = coord0 + Amplitude * (1 - cos(omega*(timestep-startstep)*dt))

    The run begins on startstep. Startstep can span multiple runs, using the start keyword of the run command. See the -run command for details of how to do this. +run command for details of how to do this. Note that the +thermo_style keyword elaplong = +timestep-startstep.


    diff --git a/doc/variable.txt b/doc/variable.txt index de31b92218..13edc7bce8 100644 --- a/doc/variable.txt +++ b/doc/variable.txt @@ -432,7 +432,9 @@ where dt = the timestep size. The run begins on startstep. Startstep can span multiple runs, using the {start} keyword of the "run"_run.html command. See the -"run"_run.html command for details of how to do this. +"run"_run.html command for details of how to do this. Note that the +"thermo_style"_thermo_style.html keyword elaplong = +timestep-startstep. The swiggle(x,y,z) and cwiggle(x,y,z) functions each take 3 arguments: x = coord0, y = amplitude, z = period. They use the elapsed time to @@ -447,7 +449,9 @@ where dt = the timestep size. The run begins on startstep. Startstep can span multiple runs, using the {start} keyword of the "run"_run.html command. See the -"run"_run.html command for details of how to do this. +"run"_run.html command for details of how to do this. Note that the +"thermo_style"_thermo_style.html keyword elaplong = +timestep-startstep. :line