From 16dc820a58b4907b4fe00ac9bb9576f6320f7faa Mon Sep 17 00:00:00 2001
From: sjplimp Description:
mol value = template-ID seed
template-ID = ID of molecule template specified in a separate molecule command
@@ -40,6 +40,10 @@
M = which basis atom
itype = atom type (1-N) to assign to this basis atom
remap value = yes or no
+ var value = name = variable name to evaluate for test of atom creation
+ set values = dim vname
+ dim = x or y or z
+ name = name of variable to set with x,y,z atom position
units value = lattice or box
lattice = the geometry is defined in lattice units
box = the geometry is defined in simulation box units
@@ -51,6 +55,7 @@
create_atoms 1 box
create_atoms 3 region regsphere basis 2 3
create_atoms 3 single 0 0 5
+create_atoms 1 box var v set x xpos set y ypos
The var and set keywords can be used to provide a criterion for +accepting or rejecting the addition of an individual atom, based on +its coordinates. The vname specified for the var keyword is the +name of an equal-style variable which should evaluate +to a zero or non-zero value based on one or two or three variables +which will store the x, y, or z coordinates of an atom (one variable +per coordinate). These other variables must be equal-style +variables defined in the input script, but their +formula can by anything. The set keyword is used to identify the +names of these other variables, one variable for the x-coordinate of a +created atom, one for y, and one for z. +
+When an atom is created, its x, y, or z coordinates override the +formula for any set variable that is defined. The var variable is +then evaluated. If the returned value is 0.0, the atom is not +created. If it is non-zero, the atom is created. +
+As an example, these commands can be used in a 2d simulation, to +create a sinusoidal surface. Note that the surface is "rough" due to +individual lattice points being "above" or "below" the mathematical +expression for the sinusoidal curve. If a finer lattice were used, +the sinusoid would appear to be "smoother". Also note the use of the +"xlat" and "ylat" thermo_style keywords which +converts lattice spacings to distance. Click on the image for a +larger version. +
+variable x equal 100 +variable y equal 25 +lattice hex 0.8442 +region box block 0 $x 0 $y -0.5 0.5 +create_box 1 box ++
variable xx equal 0.0 +variable yy equal 0.0 +variable v equal "(0.2*v_y*ylat * cos(v_xx/xlat * 2.0*PI*4.0/v_x) + 0.5*v_y*ylat - v_yy) > 0.0" +create_atoms 1 box var v set x xx set y yy ++
The units keyword determines the meaning of the distance units used to specify the coordinates of the one particle created by the single style. A box value selects standard distance units as defined by diff --git a/doc/create_atoms.txt b/doc/create_atoms.txt index 4552d43e9a..f395b87b32 100644 --- a/doc/create_atoms.txt +++ b/doc/create_atoms.txt @@ -24,7 +24,7 @@ style = {box} or {region} or {single} or {random} :l seed = random # seed (positive integer) region-ID = create atoms within this region, use NULL for entire simulation box :pre zero or more keyword/value pairs may be appended :l -keyword = {mol} or {basis} or {remap} or {units} :l +keyword = {mol} or {basis} or {remap} or {var} or {set} or {units} :l {mol} value = template-ID seed template-ID = ID of molecule template specified in a separate "molecule"_molecule.html command seed = random # seed (positive integer) @@ -32,6 +32,10 @@ keyword = {mol} or {basis} or {remap} or {units} :l M = which basis atom itype = atom type (1-N) to assign to this basis atom {remap} value = {yes} or {no} + {var} value = name = variable name to evaluate for test of atom creation + {set} values = dim vname + dim = {x} or {y} or {z} + name = name of variable to set with x,y,z atom position {units} value = {lattice} or {box} {lattice} = the geometry is defined in lattice units {box} = the geometry is defined in simulation box units :pre @@ -41,7 +45,8 @@ keyword = {mol} or {basis} or {remap} or {units} :l create_atoms 1 box create_atoms 3 region regsphere basis 2 3 -create_atoms 3 single 0 0 5 :pre +create_atoms 3 single 0 0 5 +create_atoms 1 box var v set x xpos set y ypos :pre [Description:] @@ -180,6 +185,45 @@ box, it will mapped back into the box, assuming the relevant dimensions are periodic. If it is set to {no}, no remapping is done and no particle is created if its position is outside the box. +The {var} and {set} keywords can be used to provide a criterion for +accepting or rejecting the addition of an individual atom, based on +its coordinates. The {vname} specified for the {var} keyword is the +name of an "equal-style variable"_variable.html which should evaluate +to a zero or non-zero value based on one or two or three variables +which will store the x, y, or z coordinates of an atom (one variable +per coordinate). These other variables must be "equal-style +variables"_variable.html defined in the input script, but their +formula can by anything. The {set} keyword is used to identify the +names of these other variables, one variable for the x-coordinate of a +created atom, one for y, and one for z. + +When an atom is created, its x, y, or z coordinates override the +formula for any {set} variable that is defined. The {var} variable is +then evaluated. If the returned value is 0.0, the atom is not +created. If it is non-zero, the atom is created. + +As an example, these commands can be used in a 2d simulation, to +create a sinusoidal surface. Note that the surface is "rough" due to +individual lattice points being "above" or "below" the mathematical +expression for the sinusoidal curve. If a finer lattice were used, +the sinusoid would appear to be "smoother". Also note the use of the +"xlat" and "ylat" "thermo_style"_thermo_style.html keywords which +converts lattice spacings to distance. Click on the image for a +larger version. + +variable x equal 100 +variable y equal 25 +lattice hex 0.8442 +region box block 0 $x 0 $y -0.5 0.5 +create_box 1 box :pre + +variable xx equal 0.0 +variable yy equal 0.0 +variable v equal "(0.2*v_y*ylat * cos(v_xx/xlat * 2.0*PI*4.0/v_x) + 0.5*v_y*ylat - v_yy) > 0.0" +create_atoms 1 box var v set x xx set y yy :pre + +:c,image(JPG/sinusoid_small.jpg,JPG/sinusoid.jpg) + The {units} keyword determines the meaning of the distance units used to specify the coordinates of the one particle created by the {single} style. A {box} value selects standard distance units as defined by