git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@16053 f3b2605a-c512-4ea7-a41b...
[lammps.git] / doc / src / fix_indent.txt
blobbe13925897934518b488f50386eb1c33b2b146b4
1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
4 :link(ld,Manual.html)
5 :link(lc,Section_commands.html#comm)
7 :line
9 fix indent command :h3
11 [Syntax:]
13 fix ID group-ID indent K keyword values ... :pre
15 ID, group-ID are documented in "fix"_fix.html command :ulb,l
16 indent = style name of this fix command :l
17 K = force constant for indenter surface (force/distance^2 units) :l
18 one or more keyword/value pairs may be appended :l
19 keyword = {sphere} or {cylinder} or {plane} or {side} or {units} :l
20   {sphere} args = x y z R
21     x,y,z = initial position of center of indenter (distance units)
22     R = sphere radius of indenter (distance units)
23     any of x,y,z,R can be a variable (see below)
24   {cylinder} args = dim c1 c2 R
25     dim = {x} or {y} or {z} = axis of cylinder
26     c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
27     R = cylinder radius of indenter (distance units)
28     any of c1,c2,R can be a variable (see below)
29   {plane} args = dim pos side
30     dim = {x} or {y} or {z} = plane perpendicular to this dimension
31     pos = position of plane in dimension x, y, or z (distance units)
32     pos can be a variable (see below)
33     side = {lo} or {hi}
34   {side} value = {in} or {out}
35     {in} = the indenter acts on particles inside the sphere or cylinder
36     {out} = the indenter acts on particles outside the sphere or cylinder
37   {units} value = {lattice} or {box}
38     lattice = the geometry is defined in lattice units
39     box = the geometry is defined in simulation box units :pre
40 :ule
42 [Examples:]
44 fix 1 all indent 10.0 sphere 0.0 0.0 15.0 3.0
45 fix 1 all indent 10.0 sphere v_x v_y 0.0 v_radius side in
46 fix 2 flow indent 10.0 cylinder z 0.0 0.0 10.0 units box :pre
48 [Description:]
50 Insert an indenter within a simulation box.  The indenter repels all
51 atoms in the group that touch it, so it can be used to push into a
52 material or as an obstacle in a flow.  Or it can be used as a
53 constraining wall around a simulation; see the discussion of the
54 {side} keyword below.
56 The indenter can either be spherical or cylindrical or planar.  You
57 must set one of those 3 keywords.
59 A spherical indenter exerts a force of magnitude
61 F(r) = - K (r - R)^2 :pre
63 on each atom where {K} is the specified force constant, {r} is the
64 distance from the atom to the center of the indenter, and {R} is the
65 radius of the indenter.  The force is repulsive and F(r) = 0 for {r} >
66 {R}.
68 A cylindrical indenter exerts the same force, except that {r} is the
69 distance from the atom to the center axis of the cylinder.  The
70 cylinder extends infinitely along its axis.
72 Spherical and cylindrical indenters account for periodic boundaries in
73 two ways.  First, the center point of a spherical indenter (x,y,z) or
74 axis of a cylindrical indenter (c1,c2) is remapped back into the
75 simulation box, if the box is periodic in a particular dimension.
76 This occurs every timestep if the indenter geometry is specified with
77 a variable (see below), e.g. it is moving over time.  Second, the
78 calculation of distance to the indenter center or axis accounts for
79 periodic boundaries.  Both of these mean that an indenter can
80 effectively move through and straddle one or more periodic boundaries.
82 A planar indenter is really an axis-aligned infinite-extent wall
83 exerting the same force on atoms in the system, where {R} is the
84 position of the plane and {r-R} is the distance from the plane.  If
85 the {side} parameter of the plane is specified as {lo} then it will
86 indent from the lo end of the simulation box, meaning that atoms with
87 a coordinate less than the plane's current position will be pushed
88 towards the hi end of the box and atoms with a coordinate higher than
89 the plane's current position will feel no force.  Vice versa if {side}
90 is specified as {hi}.
92 Any of the 4 quantities defining a spherical indenter's geometry can
93 be specified as an equal-style "variable"_variable.html, namely {x},
94 {y}, {z}, or {R}.  Similarly, for a cylindrical indenter, any of {c1},
95 {c2}, or {R}, can be a variable.  For a planar indenter, {pos} can be
96 a variable.  If the value is a variable, it should be specified as
97 v_name, where name is the variable name.  In this case, the variable
98 will be evaluated each timestep, and its value used to define the
99 indenter geometry.
101 Note that equal-style variables can specify formulas with various
102 mathematical functions, and include "thermo_style"_thermo_style.html
103 command keywords for the simulation box parameters and timestep and
104 elapsed time.  Thus it is easy to specify indenter properties that
105 change as a function of time or span consecutive runs in a continuous
106 fashion.  For the latter, see the {start} and {stop} keywords of the
107 "run"_run.html command and the {elaplong} keyword of "thermo_style
108 custom"_thermo_style.html for details.
110 For example, if a spherical indenter's x-position is specfied as v_x,
111 then this variable definition will keep it's center at a relative
112 position in the simulation box, 1/4 of the way from the left edge to
113 the right edge, even if the box size changes:
115 variable x equal "xlo + 0.25*lx" :pre
117 Similarly, either of these variable definitions will move the indenter
118 from an initial position at 2.5 at a constant velocity of 5:
120 variable x equal "2.5 + 5*elaplong*dt"
121 variable x equal vdisplace(2.5,5) :pre
123 If a spherical indenter's radius is specified as v_r, then these
124 variable definitions will grow the size of the indenter at a specfied
125 rate.
127 variable r0 equal 0.0
128 variable rate equal 1.0
129 variable r equal "v_r0 + step*dt*v_rate" :pre
131 If the {side} keyword is specified as {out}, which is the default,
132 then particles outside the indenter are pushded away from its outer
133 surface, as described above.  This only applies to spherical or
134 cylindrical indenters.  If the {side} keyword is specified as {in},
135 the action of the indenter is reversed.  Particles inside the indenter
136 are pushed away from its inner surface.  In other words, the indenter
137 is now a containing wall that traps the particles inside it.  If the
138 radius shrinks over time, it will squeeze the particles.
140 The {units} keyword determines the meaning of the distance units used
141 to define the indenter geometry.  A {box} value selects standard
142 distance units as defined by the "units"_units.html command,
143 e.g. Angstroms for units = real or metal.  A {lattice} value means the
144 distance units are in lattice spacings.  The "lattice"_lattice.html
145 command must have been previously used to define the lattice spacing.
146 The (x,y,z) coords of the indenter position are scaled by the x,y,z
147 lattice spacings respectively.  The radius of a spherical or
148 cylindrical indenter is scaled by the x lattice spacing.
150 Note that the units keyword only affects indenter geometry parameters
151 specified directly with numbers, not those specified as variables.  In
152 the latter case, you should use the {xlat}, {ylat}, {zlat} keywords of
153 the "thermo_style"_thermo_style.html command if you want to include
154 lattice spacings in a variable formula.
156 The force constant {K} is not affected by the {units} keyword.  It is
157 always in force/distance^2 units where force and distance are defined
158 by the "units"_units.html command.  If you wish K to be scaled by the
159 lattice spacing, you can define K with a variable whose formula
160 contains {xlat}, {ylat}, {zlat} keywords of the
161 "thermo_style"_thermo_style.html command, e.g.
163 variable k equal 100.0/xlat/xlat
164 fix 1 all indent $k sphere ... :pre
166 [Restart, fix_modify, output, run start/stop, minimize info:]
168 No information about this fix is written to "binary restart
169 files"_restart.html.
171 The "fix_modify"_fix_modify.html {energy} option is supported by this
172 fix to add the energy of interaction between atoms and the indenter to
173 the system's potential energy as part of "thermodynamic
174 output"_thermo_style.html.  The energy of each particle interacting
175 with the indenter is K/3 (r - R)^3.
177 The "fix_modify"_fix_modify.html {respa} option is supported by this
178 fix. This allows to set at which level of the "r-RESPA"_run_style.html
179 integrator the fix is adding its forces. Default is the outermost level.
181 This fix computes a global scalar energy and a global 3-vector of
182 forces (on the indenter), which can be accessed by various "output
183 commands"_Section_howto.html#howto_15.  The scalar and vector values
184 calculated by this fix are "extensive".
186 The forces due to this fix are imposed during an energy minimization,
187 invoked by the "minimize"_minimize.html command.  Note that if you
188 define the indenter geometry with a variable using a time-dependent
189 formula, LAMMPS uses the iteration count in the minimizer as the
190 timestep.  But it is almost certainly a bad idea to have the indenter
191 change its position or size during a minimization.  LAMMPS does not
192 check if you have done this.
194 NOTE: If you want the atom/indenter interaction energy to be included
195 in the total potential energy of the system (the quantity being
196 minimized), you must enable the "fix_modify"_fix_modify.html {energy}
197 option for this fix.
199 [Restrictions:] none
201 [Related commands:] none
203 [Default:]
205 The option defaults are side = out and units = lattice.