git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3871 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2010-03-03 18:40:02 +00:00
parent 41a9d99877
commit e00095d335
10 changed files with 447 additions and 238 deletions

View File

@ -13,13 +13,13 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>fix ID group-ID indent k keyword values ... <PRE>fix ID group-ID indent K keyword values ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command <UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
<LI>indent = style name of this fix command <LI>indent = style name of this fix command
<LI>k = force constant for indenter surface (force/distance^2 units) <LI>K = force constant for indenter surface (force/distance^2 units)
<LI>one or more keyword/value pairs may be appended <LI>one or more keyword/value pairs may be appended
@ -28,19 +28,17 @@
<PRE> <I>sphere</I> args = x y z R <PRE> <I>sphere</I> args = x y z R
x,y,z = initial position of center of indenter (distance units) x,y,z = initial position of center of indenter (distance units)
R = sphere radius of indenter (distance units) R = sphere radius of indenter (distance units)
any of x,y,z,R can be a variable (see below)
<I>cylinder</I> args = dim c1 c2 R <I>cylinder</I> args = dim c1 c2 R
dim = <I>x</I> or <I>y</I> or <I>z</I> = axis of cylinder dim = <I>x</I> or <I>y</I> or <I>z</I> = axis of cylinder
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units) c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
R = cylinder radius of indenter (distance units) R = cylinder radius of indenter (distance units)
any of c1,c2,R can be a variable (see below)
<I>plane</I> args = dim pos side <I>plane</I> args = dim pos side
dim = <I>x</I> or <I>y</I> or <I>z</I> = plane perpendicular to this dimension dim = <I>x</I> or <I>y</I> or <I>z</I> = plane perpendicular to this dimension
pos = position of plane in dimension x, y, or z (distance units) pos = position of plane in dimension x, y, or z (distance units)
pos can be a variable (see below)
side = <I>lo</I> or <I>hi</I> side = <I>lo</I> or <I>hi</I>
<I>vel</I> args = vx vy vz
vx,vy,vz = velocity of center of indenter (velocity units)
<I>rstart</I> value = R0
R0 = sphere or cylinder radius at start of run (distance units)
R is value at end of run, so indenter expands/contracts over time
<I>side</I> value = <I>in</I> or <I>out</I> <I>side</I> value = <I>in</I> or <I>out</I>
<I>in</I> = the indenter acts on particles inside the sphere or cylinder <I>in</I> = the indenter acts on particles inside the sphere or cylinder
<I>out</I> = the indenter acts on particles outside the sphere or cylinder <I>out</I> = the indenter acts on particles outside the sphere or cylinder
@ -52,7 +50,8 @@
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>fix 1 all indent 10.0 sphere 0.0 0.0 15.0 3.0 vel 0.0 0.0 -1.0 <PRE>fix 1 all indent 10.0 sphere 0.0 0.0 15.0 3.0
fix 1 all indent 10.0 sphere v_x v_y 0.0 v_radius side in
fix 2 flow indent 10.0 cylinder z 0.0 0.0 10.0 units box fix 2 flow indent 10.0 cylinder z 0.0 0.0 10.0 units box
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
@ -67,21 +66,26 @@ must set one of those 3 keywords.
</P> </P>
<P>A spherical indenter exerts a force of magnitude <P>A spherical indenter exerts a force of magnitude
</P> </P>
<PRE>F(r) = - k (r - R)^2 <PRE>F(r) = - K (r - R)^2
</PRE> </PRE>
<P>on each atom where <I>k</I> is the specified force constant, <I>r</I> is the <P>on each atom where <I>K</I> is the specified force constant, <I>r</I> is the
distance from the atom to the center of the indenter, and <I>R</I> is the distance from the atom to the center of the indenter, and <I>R</I> is the
radius of the indenter. The force is repulsive and F(r) = 0 for <I>r</I> > radius of the indenter. The force is repulsive and F(r) = 0 for <I>r</I> >
<I>R</I>. The calculation of distance to the indenter center accounts <I>R</I>.
for periodic boundaries, which means the indenter can effectively
straddle one or more periodic boundaries.
</P> </P>
<P>A cylindrical indenter exerts the same force, except that <I>r</I> is the <P>A cylindrical indenter exerts the same force, except that <I>r</I> is the
distance from the atom to the center axis of the cylinder. The distance from the atom to the center axis of the cylinder. The
cylinder extends infinitely along its axis. The calculation of cylinder extends infinitely along its axis.
distance to the indenter axis accounts for periodic boundaries, which </P>
means the indenter can effectively straddle one or more periodic <P>Spherical and cylindrical indenters account for periodic boundaries in
boundaries. two ways. First, the center point of a spherical indenter (x,y,z) or
axis of a cylindrical indenter (c1,c2) is remapped back into the
simulation box, if the box is periodic in a particular dimension.
This occurs every timestep if the indenter geometry is specified with
a variable (see below), e.g. it is moving over time. Second, the
calculation of distance to the indenter center or axis accounts for
periodic boundaries. Both of these mean that an indenter can
effectively move through and straddle one or more periodic boundaries.
</P> </P>
<P>A planar indenter is really an axis-aligned infinite-extent wall <P>A planar indenter is really an axis-aligned infinite-extent wall
exerting the same force on atoms in the system, where <I>R</I> is the exerting the same force on atoms in the system, where <I>R</I> is the
@ -93,24 +97,46 @@ towards the hi end of the box and atoms with a coordinate higher than
the plane's current position will feel no force. Vice versa if <I>side</I> the plane's current position will feel no force. Vice versa if <I>side</I>
is specified as <I>hi</I>. is specified as <I>hi</I>.
</P> </P>
<P>If the <I>vel</I> keyword is specified, the center (or axis or position) of <P>Any of the 4 quantities defining a spherical indenter's geometry can
the spherical (or cylindrical or planar) indenter will move during the be specified as an equal-style <A HREF = "variable">variable</A>, namely <I>x</I>, <I>y</I>,
simulation, based on its initial position (x,y,z), the specified <I>z</I>, or <I>R</I>. Similarly, for a cylindrical indenter, any of <I>c1</I>,
(vx,vy,vz), and the time elapsed since the beginning of the <I>c2</I>, or <I>R</I>, can be a variable. For a planar indenter, <I>pos</I> can be
simulation. For periodic systems and spherical or cylindrical a variable. If the value is a variable, it should be specified as
indenters, the new position of the center or axis is wrapped back into v_ID, where ID is the variable ID. In this case, the variable will be
the periodic box as needed. See the note below about making the evaluated each timestep, and its value used to define the indenter
indenter move continuously across multiple runs. geometry.
</P> </P>
<P>If the <I>rstart</I> keyword is specified, then the radius of the indenter <P>Note that equal-style variables can specify formulas with various
is a time-dependent quantity. This only applies to spherical or mathematical functions, and include <A HREF = "thermo_style.html">thermo_style</A>
cylindrical indenters. R0 is the value assigned at the start of the command keywords for the simulation box parameters and timestep and
run; R is the value at the end. At intermediate times, the radius is elapsed time. Thus it is easy to specify indenter properties that
linearly interpolated between these two values. This option can be change as a function of time or span consecutive runs in a continuous
used, for example, to grow/shrink a void within the simulation box. fashion. For the latter, see the <I>start</I> and <I>stop</I> keywords of the
See the note below about making the radius change continuously across <A HREF = "run.html">run</A> command and the <I>elaplong</I> keyword of <A HREF = "thermo_style.html">thermo_style
multiple runs. custom</A> for details.
</P> </P>
<P>For example, if a spherical indenter's x-position is specfied as v_x,
then this variable definition will keep it's center at a relative
position in the simulation box, 1/4 of the way from the left edge to
the right edge, even if the box size changes:
</P>
<PRE>variable x equal "xlo + 0.25*lx"
</PRE>
<P>Similarly, these variable definitions will move the indenter at a
constant velocity:
</P>
<PRE>variable x0 equal 2.5
variable vx equal 5.0
variable x equal "v_x0 + step*dt*v_vx"
</PRE>
<P>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
rate.
</P>
<PRE>variable r0 equal 0.0
variable rate equal 1.0
variable r equal "v_r0 + step*dt*v_rate"
</PRE>
<P>If the <I>side</I> keyword is specified as <I>out</I>, which is the default, <P>If the <I>side</I> keyword is specified as <I>out</I>, which is the default,
then particles outside the indenter are pushded away from its outer then particles outside the indenter are pushded away from its outer
surface, as described above. This only applies to spherical or surface, as described above. This only applies to spherical or
@ -121,15 +147,27 @@ is now a containing wall that traps the particles inside it. If the
radius shrinks over time, it will squeeze the particles. radius shrinks over time, it will squeeze the particles.
</P> </P>
<P>The <I>units</I> keyword determines the meaning of the distance units used <P>The <I>units</I> keyword determines the meaning of the distance units used
to define the indenter. A <I>box</I> value selects standard distance units to define the indenter geometry. A <I>box</I> value selects standard
as defined by the <A HREF = "units.html">units</A> command, e.g. Angstroms for units distance units as defined by the <A HREF = "units.html">units</A> command,
= real or metal. A <I>lattice</I> value means the distance units are in e.g. Angstroms for units = real or metal. A <I>lattice</I> value means the
lattice spacings. The <A HREF = "lattice.html">lattice</A> command must have been distance units are in lattice spacings. The <A HREF = "lattice.html">lattice</A>
previously used to define the lattice spacing. Note that the units command must have been previously used to define the lattice spacing.
choice affects not only the indenter's physical geometry, but also its Note that the units keyword only affects indenter geometry parameters
velocity and force constant since they are defined in terms of specified directly with numbers, not those specified as variables. In
distance as well. the latter case, you should use the <I>xlat</I>, <I>ylat</I>, <I>zlat</I> keywords of
the <A HREF = "thermo_style.html">thermo_style</A> command if you want to include
lattice spacings in a variable formula.
</P> </P>
<P>The force constant <I>K</I> is not affected by the <I>units</I> keyword. It is
always in force/distance^2 units where force and distance are defined
by the <A HREF = "units.html">units</A> command. If you wish K to be scaled by the
lattice spacing, you can define K with a variable whose formula
contains <I>xlat</I>, <I>ylat</I>, <I>zlat</I> keywords of the
<A HREF = "thermo_style.html">thermo_style</A> command, e.g.
</P>
<PRE>variable k equal 100.0/xlat/xlat
fix 1 all indent $k sphere ...
</PRE>
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B> <P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
</P> </P>
<P>No information about this fix is written to <A HREF = "restart.html">binary restart <P>No information about this fix is written to <A HREF = "restart.html">binary restart
@ -146,17 +184,13 @@ indenter), which can be accessed by various <A HREF = "Section_howto.html#4_15">
commands</A>. The scalar and vector values commands</A>. The scalar and vector values
calculated by this fix are "extensive". calculated by this fix are "extensive".
</P> </P>
<P>This fix can adjust the indenter position and radius over multiple
runs, using the <I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A>
command. See the <A HREF = "run.html">run</A> command for details of how to do
this. If you do not do this, the indenter position and readius will
be reset to their specified initial values at the beginning of each
run.
</P>
<P>The forces due to this fix are imposed during an energy minimization, <P>The forces due to this fix are imposed during an energy minimization,
invoked by the <A HREF = "minimize.html">minimize</A> command. The <I>rstart</I> keyword invoked by the <A HREF = "minimize.html">minimize</A> command. Note that if you
does not change the indenter radius during an energy minimization; the define the indenter geometry with a variable using a time-dependent
indenter always has a radius of its final value R in that case. formula, LAMMPS uses the iteration count in the minimizer as the
timestep. But it is almost certainly a bad idea to have the indenter
change its position or size during a minimization. LAMMPS does not
check if you have done this.
</P> </P>
<P>IMPORTANT NOTE: If you want the atom/indenter interaction energy to be <P>IMPORTANT NOTE: If you want the atom/indenter interaction energy to be
included in the total potential energy of the system (the quantity included in the total potential energy of the system (the quantity
@ -169,6 +203,6 @@ being minimized), you must enable the <A HREF = "fix_modify.html">fix_modify</A>
</P> </P>
<P><B>Default:</B> <P><B>Default:</B>
</P> </P>
<P>The option defaults are vel = 0,0,0, side = out, and units = lattice. <P>The option defaults are side = out and units = lattice.
</P> </P>
</HTML> </HTML>

View File

@ -10,29 +10,27 @@ fix indent command :h3
[Syntax:] [Syntax:]
fix ID group-ID indent k keyword values ... :pre fix ID group-ID indent K keyword values ... :pre
ID, group-ID are documented in "fix"_fix.html command :ulb,l ID, group-ID are documented in "fix"_fix.html command :ulb,l
indent = style name of this fix command :l indent = style name of this fix command :l
k = force constant for indenter surface (force/distance^2 units) :l K = force constant for indenter surface (force/distance^2 units) :l
one or more keyword/value pairs may be appended :l one or more keyword/value pairs may be appended :l
keyword = {sphere} or {cylinder} or {plane} or {vel} or {rstart} or {side} or {units} :l keyword = {sphere} or {cylinder} or {plane} or {vel} or {rstart} or {side} or {units} :l
{sphere} args = x y z R {sphere} args = x y z R
x,y,z = initial position of center of indenter (distance units) x,y,z = initial position of center of indenter (distance units)
R = sphere radius of indenter (distance units) R = sphere radius of indenter (distance units)
any of x,y,z,R can be a variable (see below)
{cylinder} args = dim c1 c2 R {cylinder} args = dim c1 c2 R
dim = {x} or {y} or {z} = axis of cylinder dim = {x} or {y} or {z} = axis of cylinder
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units) c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
R = cylinder radius of indenter (distance units) R = cylinder radius of indenter (distance units)
any of c1,c2,R can be a variable (see below)
{plane} args = dim pos side {plane} args = dim pos side
dim = {x} or {y} or {z} = plane perpendicular to this dimension dim = {x} or {y} or {z} = plane perpendicular to this dimension
pos = position of plane in dimension x, y, or z (distance units) pos = position of plane in dimension x, y, or z (distance units)
pos can be a variable (see below)
side = {lo} or {hi} side = {lo} or {hi}
{vel} args = vx vy vz
vx,vy,vz = velocity of center of indenter (velocity units)
{rstart} value = R0
R0 = sphere or cylinder radius at start of run (distance units)
R is value at end of run, so indenter expands/contracts over time
{side} value = {in} or {out} {side} value = {in} or {out}
{in} = the indenter acts on particles inside the sphere or cylinder {in} = the indenter acts on particles inside the sphere or cylinder
{out} = the indenter acts on particles outside the sphere or cylinder {out} = the indenter acts on particles outside the sphere or cylinder
@ -43,7 +41,8 @@ keyword = {sphere} or {cylinder} or {plane} or {vel} or {rstart} or {side} or {u
[Examples:] [Examples:]
fix 1 all indent 10.0 sphere 0.0 0.0 15.0 3.0 vel 0.0 0.0 -1.0 fix 1 all indent 10.0 sphere 0.0 0.0 15.0 3.0
fix 1 all indent 10.0 sphere v_x v_y 0.0 v_radius side in
fix 2 flow indent 10.0 cylinder z 0.0 0.0 10.0 units box :pre fix 2 flow indent 10.0 cylinder z 0.0 0.0 10.0 units box :pre
[Description:] [Description:]
@ -58,21 +57,26 @@ must set one of those 3 keywords.
A spherical indenter exerts a force of magnitude A spherical indenter exerts a force of magnitude
F(r) = - k (r - R)^2 :pre F(r) = - K (r - R)^2 :pre
on each atom where {k} is the specified force constant, {r} is the on each atom where {K} is the specified force constant, {r} is the
distance from the atom to the center of the indenter, and {R} is the distance from the atom to the center of the indenter, and {R} is the
radius of the indenter. The force is repulsive and F(r) = 0 for {r} > radius of the indenter. The force is repulsive and F(r) = 0 for {r} >
{R}. The calculation of distance to the indenter center accounts {R}.
for periodic boundaries, which means the indenter can effectively
straddle one or more periodic boundaries.
A cylindrical indenter exerts the same force, except that {r} is the A cylindrical indenter exerts the same force, except that {r} is the
distance from the atom to the center axis of the cylinder. The distance from the atom to the center axis of the cylinder. The
cylinder extends infinitely along its axis. The calculation of cylinder extends infinitely along its axis.
distance to the indenter axis accounts for periodic boundaries, which
means the indenter can effectively straddle one or more periodic Spherical and cylindrical indenters account for periodic boundaries in
boundaries. two ways. First, the center point of a spherical indenter (x,y,z) or
axis of a cylindrical indenter (c1,c2) is remapped back into the
simulation box, if the box is periodic in a particular dimension.
This occurs every timestep if the indenter geometry is specified with
a variable (see below), e.g. it is moving over time. Second, the
calculation of distance to the indenter center or axis accounts for
periodic boundaries. Both of these mean that an indenter can
effectively move through and straddle one or more periodic boundaries.
A planar indenter is really an axis-aligned infinite-extent wall A planar indenter is really an axis-aligned infinite-extent wall
exerting the same force on atoms in the system, where {R} is the exerting the same force on atoms in the system, where {R} is the
@ -84,23 +88,45 @@ towards the hi end of the box and atoms with a coordinate higher than
the plane's current position will feel no force. Vice versa if {side} the plane's current position will feel no force. Vice versa if {side}
is specified as {hi}. is specified as {hi}.
If the {vel} keyword is specified, the center (or axis or position) of Any of the 4 quantities defining a spherical indenter's geometry can
the spherical (or cylindrical or planar) indenter will move during the be specified as an equal-style "variable"_variable, namely {x}, {y},
simulation, based on its initial position (x,y,z), the specified {z}, or {R}. Similarly, for a cylindrical indenter, any of {c1},
(vx,vy,vz), and the time elapsed since the beginning of the {c2}, or {R}, can be a variable. For a planar indenter, {pos} can be
simulation. For periodic systems and spherical or cylindrical a variable. If the value is a variable, it should be specified as
indenters, the new position of the center or axis is wrapped back into v_ID, where ID is the variable ID. In this case, the variable will be
the periodic box as needed. See the note below about making the evaluated each timestep, and its value used to define the indenter
indenter move continuously across multiple runs. geometry.
If the {rstart} keyword is specified, then the radius of the indenter Note that equal-style variables can specify formulas with various
is a time-dependent quantity. This only applies to spherical or mathematical functions, and include "thermo_style"_thermo_style.html
cylindrical indenters. R0 is the value assigned at the start of the command keywords for the simulation box parameters and timestep and
run; R is the value at the end. At intermediate times, the radius is elapsed time. Thus it is easy to specify indenter properties that
linearly interpolated between these two values. This option can be change as a function of time or span consecutive runs in a continuous
used, for example, to grow/shrink a void within the simulation box. fashion. For the latter, see the {start} and {stop} keywords of the
See the note below about making the radius change continuously across "run"_run.html command and the {elaplong} keyword of "thermo_style
multiple runs. custom"_thermo_style.html for details.
For example, if a spherical indenter's x-position is specfied as v_x,
then this variable definition will keep it's center at a relative
position in the simulation box, 1/4 of the way from the left edge to
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:
variable x0 equal 2.5
variable vx equal 5.0
variable x equal "v_x0 + step*dt*v_vx" :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
rate.
variable r0 equal 0.0
variable rate equal 1.0
variable r equal "v_r0 + step*dt*v_rate" :pre
If the {side} keyword is specified as {out}, which is the default, If the {side} keyword is specified as {out}, which is the default,
then particles outside the indenter are pushded away from its outer then particles outside the indenter are pushded away from its outer
@ -112,14 +138,26 @@ is now a containing wall that traps the particles inside it. If the
radius shrinks over time, it will squeeze the particles. radius shrinks over time, it will squeeze the particles.
The {units} keyword determines the meaning of the distance units used The {units} keyword determines the meaning of the distance units used
to define the indenter. A {box} value selects standard distance units to define the indenter geometry. A {box} value selects standard
as defined by the "units"_units.html command, e.g. Angstroms for units distance units as defined by the "units"_units.html command,
= real or metal. A {lattice} value means the distance units are in e.g. Angstroms for units = real or metal. A {lattice} value means the
lattice spacings. The "lattice"_lattice.html command must have been distance units are in lattice spacings. The "lattice"_lattice.html
previously used to define the lattice spacing. Note that the units command must have been previously used to define the lattice spacing.
choice affects not only the indenter's physical geometry, but also its Note that the units keyword only affects indenter geometry parameters
velocity and force constant since they are defined in terms of specified directly with numbers, not those specified as variables. In
distance as well. the latter case, you should use the {xlat}, {ylat}, {zlat} keywords of
the "thermo_style"_thermo_style.html command if you want to include
lattice spacings in a variable formula.
The force constant {K} is not affected by the {units} keyword. It is
always in force/distance^2 units where force and distance are defined
by the "units"_units.html command. If you wish K to be scaled by the
lattice spacing, you can define K with a variable whose formula
contains {xlat}, {ylat}, {zlat} keywords of the
"thermo_style"_thermo_style.html command, e.g.
variable k equal 100.0/xlat/xlat
fix 1 all indent $k sphere ... :pre
[Restart, fix_modify, output, run start/stop, minimize info:] [Restart, fix_modify, output, run start/stop, minimize info:]
@ -137,17 +175,13 @@ indenter), which can be accessed by various "output
commands"_Section_howto.html#4_15. The scalar and vector values commands"_Section_howto.html#4_15. The scalar and vector values
calculated by this fix are "extensive". calculated by this fix are "extensive".
This fix can adjust the indenter position and radius over multiple
runs, using the {start} and {stop} keywords of the "run"_run.html
command. See the "run"_run.html command for details of how to do
this. If you do not do this, the indenter position and readius will
be reset to their specified initial values at the beginning of each
run.
The forces due to this fix are imposed during an energy minimization, The forces due to this fix are imposed during an energy minimization,
invoked by the "minimize"_minimize.html command. The {rstart} keyword invoked by the "minimize"_minimize.html command. Note that if you
does not change the indenter radius during an energy minimization; the define the indenter geometry with a variable using a time-dependent
indenter always has a radius of its final value R in that case. formula, LAMMPS uses the iteration count in the minimizer as the
timestep. But it is almost certainly a bad idea to have the indenter
change its position or size during a minimization. LAMMPS does not
check if you have done this.
IMPORTANT NOTE: If you want the atom/indenter interaction energy to be IMPORTANT NOTE: If you want the atom/indenter interaction energy to be
included in the total potential energy of the system (the quantity included in the total potential energy of the system (the quantity
@ -160,4 +194,4 @@ being minimized), you must enable the "fix_modify"_fix_modify.html
[Default:] [Default:]
The option defaults are vel = 0,0,0, side = out, and units = lattice. The option defaults are side = out and units = lattice.

View File

@ -22,8 +22,8 @@
<PRE> <I>one</I> args = none <PRE> <I>one</I> args = none
<I>multi</I> args = none <I>multi</I> args = none
<I>custom</I> args = list of attributes <I>custom</I> args = list of attributes
possible attributes = step, atoms, cpu, temp, press, possible attributes = step, elapsed, elaplong, dt, cpu,
pe, ke, etotal, enthalpy, atoms, temp, press, pe, ke, etotal, enthalpy,
evdwl, ecoul, epair, ebond, eangle, edihed, eimp, evdwl, ecoul, epair, ebond, eangle, edihed, eimp,
emol, elong, etail, emol, elong, etail,
vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi,
@ -33,8 +33,11 @@
f_ID, f_ID[I], f_ID[I][J], f_ID, f_ID[I], f_ID[I][J],
v_name v_name
step = timestep step = timestep
atoms = # of atoms elapsed = timesteps since start of this run
elaplong = timesteps since start of initial run in a series of runs
dt = timestep size
cpu = elapsed CPU time cpu = elapsed CPU time
atoms = # of atoms
temp = temperature temp = temperature
press = pressure press = pressure
pe = total potential energy pe = total potential energy
@ -192,6 +195,16 @@ etc.
</P> </P>
<HR> <HR>
<P>The <I>step</I>, <I>elapsed</I>, and <I>elaplong</I> keywords refer to timestep
count. <I>Step</I> is the current timestep, or iteration count when a
<A HREF = "minimize.html">minimization</A> is being performed. <I>Elapsed</I> is the
number of timesteps elapsed since the beginning of this run.
<I>Elaplong</I> is the number of timesteps elapsed since the beginning of
an initial run in a series of runs. See the <I>start</I> and <I>stop</I>
keywords for the <A HREF = "run.html">run</A> for info on how to invoke a series of
runs that keep track of an initial starting time. If these keywords
are not used, then <I>elapsed</I> and <I>elaplong</I> are the same value.
</P>
<P>The <I>c_ID</I> and <I>c_ID[I]</I> and <I>c_ID[I][J]</I> keywords allow global <P>The <I>c_ID</I> and <I>c_ID[I]</I> and <I>c_ID[I][J]</I> keywords allow global
values calculated by a compute to be output. As discussed on the values calculated by a compute to be output. As discussed on the
<A HREF = "compute.html">compute</A> doc page, computes can calculate global, <A HREF = "compute.html">compute</A> doc page, computes can calculate global,

View File

@ -17,8 +17,8 @@ args = list of arguments for a particular style :l
{one} args = none {one} args = none
{multi} args = none {multi} args = none
{custom} args = list of attributes {custom} args = list of attributes
possible attributes = step, atoms, cpu, temp, press, possible attributes = step, elapsed, elaplong, dt, cpu,
pe, ke, etotal, enthalpy, atoms, temp, press, pe, ke, etotal, enthalpy,
evdwl, ecoul, epair, ebond, eangle, edihed, eimp, evdwl, ecoul, epair, ebond, eangle, edihed, eimp,
emol, elong, etail, emol, elong, etail,
vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi,
@ -28,8 +28,11 @@ args = list of arguments for a particular style :l
f_ID, f_ID\[I\], f_ID\[I\]\[J\], f_ID, f_ID\[I\], f_ID\[I\]\[J\],
v_name v_name
step = timestep step = timestep
atoms = # of atoms elapsed = timesteps since start of this run
elaplong = timesteps since start of initial run in a series of runs
dt = timestep size
cpu = elapsed CPU time cpu = elapsed CPU time
atoms = # of atoms
temp = temperature temp = temperature
press = pressure press = pressure
pe = total potential energy pe = total potential energy
@ -186,6 +189,16 @@ etc.
:line :line
The {step}, {elapsed}, and {elaplong} keywords refer to timestep
count. {Step} is the current timestep, or iteration count when a
"minimization"_minimize.html is being performed. {Elapsed} is the
number of timesteps elapsed since the beginning of this run.
{Elaplong} is the number of timesteps elapsed since the beginning of
an initial run in a series of runs. See the {start} and {stop}
keywords for the "run"_run.html for info on how to invoke a series of
runs that keep track of an initial starting time. If these keywords
are not used, then {elapsed} and {elaplong} are the same value.
The {c_ID} and {c_ID\[I\]} and {c_ID\[I\]\[J\]} keywords allow global The {c_ID} and {c_ID\[I\]} and {c_ID\[I\]\[J\]} keywords allow global
values calculated by a compute to be output. As discussed on the values calculated by a compute to be output. As discussed on the
"compute"_compute.html doc page, computes can calculate global, "compute"_compute.html doc page, computes can calculate global,

View File

@ -37,21 +37,22 @@ fix 1 all nve
fix 2 lower setforce 0.0 0.0 0.0 fix 2 lower setforce 0.0 0.0 0.0
fix 3 all temp/rescale 100 0.1 0.1 0.01 1.0 fix 3 all temp/rescale 100 0.1 0.1 0.01 1.0
# indenter # run with indenter
fix 4 all indent 1000.0 sphere 10 13 0 5.0 vel 0.0 -0.02 0.0
fix 5 all enforce2d
# Run with indenter
timestep 0.003 timestep 0.003
variable k equal 1000.0/xlat
variable y equal "13.0*ylat - step*dt*0.02*ylat"
fix 4 all indent $k sphere 10 v_y 0 5.0
fix 5 all enforce2d
thermo 1000 thermo 1000
thermo_modify temp new thermo_modify temp new
dump 1 all atom 250 dump.indent dump 1 all atom 250 dump.indent
run 30000 run 30000
# Run without indenter # run without indenter
unfix 4 unfix 4
run 30000 run 30000

View File

@ -45,26 +45,29 @@ dump_modify 1 scale no
minimize 1.0e-6 1.0e-6 1000 1000 minimize 1.0e-6 1.0e-6 1000 1000
fix 4 all indent 5000.0 sphere 10 13.0 0 6.0 variable k equal 5000.0/xlat
variable k1 equal 1000.0/xlat
fix 4 all indent $k sphere 10 13.0 0 6.0
fix_modify 4 energy yes fix_modify 4 energy yes
minimize 1.0e-6 1.0e-6 1000 1000 minimize 1.0e-6 1.0e-6 1000 1000
fix 4 all indent 1000.0 sphere 10 12.5 0 6.0 fix 4 all indent ${k1} sphere 10 12.5 0 6.0
fix_modify 4 energy yes fix_modify 4 energy yes
minimize 1.0e-6 1.0e-6 1000 1000 minimize 1.0e-6 1.0e-6 1000 1000
fix 4 all indent 1000.0 sphere 10 12.0 0 6.0 fix 4 all indent ${k1} sphere 10 12.0 0 6.0
fix_modify 4 energy yes fix_modify 4 energy yes
minimize 1.0e-6 1.0e-6 1000 1000 minimize 1.0e-6 1.0e-6 1000 1000
fix 4 all indent 1000.0 sphere 10 11.4 0 6.0 fix 4 all indent ${k1} sphere 10 11.4 0 6.0
fix_modify 4 energy yes fix_modify 4 energy yes
minimize 1.0e-6 1.0e-6 1000 1000 minimize 1.0e-6 1.0e-6 1000 1000
fix 4 all indent 1000.0 sphere 10 11.2 0 6.0 fix 4 all indent ${k1} sphere 10 11.2 0 6.0
fix_modify 4 energy yes fix_modify 4 energy yes
minimize 1.0e-6 1.0e-6 1000 1000 minimize 1.0e-6 1.0e-6 1000 1000
fix 4 all indent 1000.0 sphere 10 11.0 0 6.0 fix 4 all indent ${k1} sphere 10 11.0 0 6.0
fix_modify 4 energy yes fix_modify 4 energy yes
minimize 1.0e-6 1.0e-6 1000 1000 minimize 1.0e-6 1.0e-6 1000 1000

View File

@ -20,6 +20,8 @@
#include "stdlib.h" #include "stdlib.h"
#include "fix_indent.h" #include "fix_indent.h"
#include "atom.h" #include "atom.h"
#include "input.h"
#include "variable.h"
#include "domain.h" #include "domain.h"
#include "lattice.h" #include "lattice.h"
#include "update.h" #include "update.h"
@ -47,6 +49,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
extvector = 1; extvector = 1;
k = atof(arg[3]); k = atof(arg[3]);
k3 = k/3.0;
// read options from end of input line // read options from end of input line
@ -65,41 +68,17 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
} }
else xscale = yscale = zscale = 1.0; else xscale = yscale = zscale = 1.0;
// apply scaling factors to force constant, velocity, and geometry // apply scaling factors to geometry
k /= xscale; if (istyle == SPHERE || istyle == CYLINDER) {
k3 = k/3.0; if (!xstr) xvalue *= xscale;
vx *= xscale; if (!ystr) yvalue *= yscale;
vy *= yscale; if (!zstr) zvalue *= zscale;
vz *= zscale; if (!rstr) rvalue *= xscale;
if (istyle == SPHERE) {
x0 *= xscale;
y0 *= yscale;
z0 *= zscale;
r0_stop *= xscale;
r0_start *= xscale;
} else if (istyle == CYLINDER) {
if (cdim == 0) {
c1 *= yscale;
c2 *= zscale;
r0_stop *= xscale;
r0_start *= xscale;
} else if (cdim == 1) {
c1 *= xscale;
c2 *= zscale;
r0_stop *= yscale;
r0_start *= yscale;
} else if (cdim == 2) {
c1 *= xscale;
c2 *= yscale;
r0_stop *= zscale;
r0_start *= zscale;
}
} else if (istyle == PLANE) { } else if (istyle == PLANE) {
if (cdim == 0) planepos *= xscale; if (cdim == 0 && !pstr) pvalue *= xscale;
else if (cdim == 1) planepos *= yscale; else if (cdim == 1 && !pstr) pvalue *= yscale;
else if (cdim == 2) planepos *= zscale; else if (cdim == 2 && !pstr) pvalue *= zscale;
} else error->all("Illegal fix indent command"); } else error->all("Illegal fix indent command");
indenter_flag = 0; indenter_flag = 0;
@ -108,6 +87,17 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
FixIndent::~FixIndent()
{
delete [] xstr;
delete [] ystr;
delete [] zstr;
delete [] rstr;
delete [] pstr;
}
/* ---------------------------------------------------------------------- */
int FixIndent::setmask() int FixIndent::setmask()
{ {
int mask = 0; int mask = 0;
@ -122,6 +112,37 @@ int FixIndent::setmask()
void FixIndent::init() void FixIndent::init()
{ {
if (xstr) {
xvar = input->variable->find(xstr);
if (xvar < 0) error->all("Variable name for fix indent does not exist");
if (!input->variable->equalstyle(xvar))
error->all("Variable for fix indent is not equal style");
}
if (ystr) {
yvar = input->variable->find(ystr);
if (yvar < 0) error->all("Variable name for fix indent does not exist");
if (!input->variable->equalstyle(yvar))
error->all("Variable for fix indent is not equal style");
}
if (zstr) {
zvar = input->variable->find(zstr);
if (zvar < 0) error->all("Variable name for fix indent does not exist");
if (!input->variable->equalstyle(zvar))
error->all("Variable for fix indent is not equal style");
}
if (rstr) {
rvar = input->variable->find(rstr);
if (rvar < 0) error->all("Variable name for fix indent does not exist");
if (!input->variable->equalstyle(rvar))
error->all("Variable for fix indent is not equal style");
}
if (pstr) {
pvar = input->variable->find(pstr);
if (pvar < 0) error->all("Variable name for fix indent does not exist");
if (!input->variable->equalstyle(pvar))
error->all("Variable for fix indent is not equal style");
}
if (strcmp(update->integrate_style,"respa") == 0) if (strcmp(update->integrate_style,"respa") == 0)
nlevels_respa = ((Respa *) update->integrate)->nlevels; nlevels_respa = ((Respa *) update->integrate)->nlevels;
} }
@ -150,17 +171,6 @@ void FixIndent::min_setup(int vflag)
void FixIndent::post_force(int vflag) void FixIndent::post_force(int vflag)
{ {
// set current r0
// for minimization, always set to r0_stop
double r0;
if (!radflag || update->whichflag == 2) r0 = r0_stop;
else {
double delta = update->ntimestep - update->beginstep;
delta /= update->endstep - update->beginstep;
r0 = r0_start + delta * (r0_stop-r0_start);
}
// indenter values, 0 = energy, 1-3 = force components // indenter values, 0 = energy, 1-3 = force components
indenter_flag = 0; indenter_flag = 0;
@ -170,16 +180,22 @@ void FixIndent::post_force(int vflag)
if (istyle == SPHERE) { if (istyle == SPHERE) {
// ctr = current indenter center from original x0,y0,z0 // ctr = current indenter center
// remap into periodic box // remap into periodic box
double ctr[3]; double ctr[3];
double delta = (update->ntimestep - update->beginstep) * update->dt; if (xstr) ctr[0] = input->variable->compute_equal(xvar);
ctr[0] = x0 + delta*vx; else ctr[0] = xvalue;
ctr[1] = y0 + delta*vy; if (ystr) ctr[1] = input->variable->compute_equal(yvar);
ctr[2] = z0 + delta*vz; else ctr[1] = yvalue;
if (zstr) ctr[2] = input->variable->compute_equal(zvar);
else ctr[2] = zvalue;
domain->remap(ctr); domain->remap(ctr);
double radius;
if (rstr) radius = input->variable->compute_equal(zvar);
else radius = rvalue;
double **x = atom->x; double **x = atom->x;
double **f = atom->f; double **f = atom->f;
int *mask = atom->mask; int *mask = atom->mask;
@ -195,10 +211,10 @@ void FixIndent::post_force(int vflag)
domain->minimum_image(delx,dely,delz); domain->minimum_image(delx,dely,delz);
r = sqrt(delx*delx + dely*dely + delz*delz); r = sqrt(delx*delx + dely*dely + delz*delz);
if (side == OUTSIDE) { if (side == OUTSIDE) {
dr = r - r0; dr = r - radius;
fmag = k*dr*dr; fmag = k*dr*dr;
} else { } else {
dr = r0 - r; dr = radius - r;
fmag = -k*dr*dr; fmag = -k*dr*dr;
} }
if (dr >= 0.0) continue; if (dr >= 0.0) continue;
@ -218,27 +234,36 @@ void FixIndent::post_force(int vflag)
} else if (istyle == CYLINDER) { } else if (istyle == CYLINDER) {
// ctr = current indenter axis from original c1,c2 // ctr = current indenter axis
// remap into periodic box // remap into periodic box
// 3rd coord is just near box for remap(), since isn't used // 3rd coord is just near box for remap(), since isn't used
double ctr[3]; double ctr[3];
double delta = (update->ntimestep - update->beginstep) * update->dt;
if (cdim == 0) { if (cdim == 0) {
ctr[0] = domain->boxlo[0]; ctr[0] = domain->boxlo[0];
ctr[1] = c1 + delta*vy; if (ystr) ctr[1] = input->variable->compute_equal(yvar);
ctr[2] = c2 + delta*vz; else ctr[1] = yvalue;
if (zstr) ctr[2] = input->variable->compute_equal(zvar);
else ctr[2] = zvalue;
} else if (cdim == 1) { } else if (cdim == 1) {
ctr[0] = c1 + delta*vx; if (xstr) ctr[0] = input->variable->compute_equal(xvar);
else ctr[0] = xvalue;
ctr[1] = domain->boxlo[1]; ctr[1] = domain->boxlo[1];
ctr[2] = c2 + delta*vz; if (zstr) ctr[2] = input->variable->compute_equal(zvar);
else ctr[2] = zvalue;
} else { } else {
ctr[0] = c1 + delta*vx; if (xstr) ctr[0] = input->variable->compute_equal(xvar);
ctr[1] = c2 + delta*vy; else ctr[0] = xvalue;
if (ystr) ctr[1] = input->variable->compute_equal(yvar);
else ctr[1] = yvalue;
ctr[2] = domain->boxlo[2]; ctr[2] = domain->boxlo[2];
} }
domain->remap(ctr); domain->remap(ctr);
double radius;
if (rstr) radius = input->variable->compute_equal(zvar);
else radius = rvalue;
double **x = atom->x; double **x = atom->x;
double **f = atom->f; double **f = atom->f;
int *mask = atom->mask; int *mask = atom->mask;
@ -264,10 +289,10 @@ void FixIndent::post_force(int vflag)
domain->minimum_image(delx,dely,delz); domain->minimum_image(delx,dely,delz);
r = sqrt(delx*delx + dely*dely + delz*delz); r = sqrt(delx*delx + dely*dely + delz*delz);
if (side == OUTSIDE) { if (side == OUTSIDE) {
dr = r - r0; dr = r - radius;
fmag = k*dr*dr; fmag = k*dr*dr;
} else { } else {
dr = r0 - r; dr = radius - r;
fmag = -k*dr*dr; fmag = -k*dr*dr;
} }
if (dr >= 0.0) continue; if (dr >= 0.0) continue;
@ -287,13 +312,11 @@ void FixIndent::post_force(int vflag)
} else { } else {
// posnew = current coord of plane from original planepos // plane = current plane position
double delta = (update->ntimestep - update->beginstep) * update->dt; double plane;
double posnew; if (pstr) plane = input->variable->compute_equal(pvar);
if (cdim == 0) posnew = planepos + delta*vx; else plane = pvalue;
else if (cdim == 1) posnew = planepos + delta*vy;
else if (cdim == 2) posnew = planepos + delta*vz;
double **x = atom->x; double **x = atom->x;
double **f = atom->f; double **f = atom->f;
@ -304,7 +327,7 @@ void FixIndent::post_force(int vflag)
for (int i = 0; i < nlocal; i++) for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) { if (mask[i] & groupbit) {
dr = planeside * (posnew - x[i][cdim]); dr = planeside * (plane - x[i][cdim]);
if (dr >= 0.0) continue; if (dr >= 0.0) continue;
fatom = -planeside * k*dr*dr; fatom = -planeside * k*dr*dr;
f[i][cdim] += fatom; f[i][cdim] += fatom;
@ -367,9 +390,8 @@ void FixIndent::options(int narg, char **arg)
if (narg < 0) error->all("Illegal fix indent command"); if (narg < 0) error->all("Illegal fix indent command");
istyle = NONE; istyle = NONE;
vx = vy = vz = 0.0; xstr = ystr = zstr = rstr = pstr = NULL;
radflag = 0; xvalue = yvalue = zvalue = rvalue = pvalue = 0.0;
r0_start = 0.0;
scaleflag = 1; scaleflag = 1;
side = OUTSIDE; side = OUTSIDE;
@ -377,52 +399,107 @@ void FixIndent::options(int narg, char **arg)
while (iarg < narg) { while (iarg < narg) {
if (strcmp(arg[iarg],"sphere") == 0) { if (strcmp(arg[iarg],"sphere") == 0) {
if (iarg+5 > narg) error->all("Illegal fix indent command"); if (iarg+5 > narg) error->all("Illegal fix indent command");
x0 = atof(arg[iarg+1]);
y0 = atof(arg[iarg+2]); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
z0 = atof(arg[iarg+3]); int n = strlen(&arg[iarg+1][2]) + 1;
r0_stop = atof(arg[iarg+4]); xstr = new char[n];
strcpy(xstr,&arg[iarg+1][2]);
} else xvalue = atof(arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+2][2]);
} else yvalue = atof(arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = atof(arg[iarg+3]);
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
int n = strlen(&arg[iarg+4][2]) + 1;
rstr = new char[n];
strcpy(rstr,&arg[iarg+4][2]);
} else rvalue = atof(arg[iarg+4]);
istyle = SPHERE; istyle = SPHERE;
iarg += 5; iarg += 5;
} else if (strcmp(arg[iarg],"cylinder") == 0) { } else if (strcmp(arg[iarg],"cylinder") == 0) {
if (iarg+5 > narg) error->all("Illegal fix indent command"); if (iarg+5 > narg) error->all("Illegal fix indent command");
if (strcmp(arg[iarg+1],"x") == 0) cdim = 0;
else if (strcmp(arg[iarg+1],"y") == 0) cdim = 1; if (strcmp(arg[iarg+1],"x") == 0) {
else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2; cdim = 0;
else error->all("Illegal fix indent command"); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
c1 = atof(arg[iarg+2]); int n = strlen(&arg[iarg+2][2]) + 1;
c2 = atof(arg[iarg+3]); ystr = new char[n];
r0_stop = atof(arg[iarg+4]); strcpy(ystr,&arg[iarg+2][2]);
} else yvalue = atof(arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = atof(arg[iarg+3]);
} else if (strcmp(arg[iarg+1],"y") == 0) {
cdim = 1;
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+2][2]);
} else xvalue = atof(arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = atof(arg[iarg+3]);
} else if (strcmp(arg[iarg+1],"z") == 0) {
cdim = 2;
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+2][2]);
} else xvalue = atof(arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+3][2]);
} else yvalue = atof(arg[iarg+3]);
} else error->all("Illegal fix indent command");
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
int n = strlen(&arg[iarg+4][2]) + 1;
rstr = new char[n];
strcpy(rstr,&arg[iarg+4][2]);
} else rvalue = atof(arg[iarg+4]);
istyle = CYLINDER; istyle = CYLINDER;
iarg += 5; iarg += 5;
} else if (strcmp(arg[iarg],"plane") == 0) { } else if (strcmp(arg[iarg],"plane") == 0) {
if (iarg+4 > narg) error->all("Illegal fix indent command"); if (iarg+4 > narg) error->all("Illegal fix indent command");
if (strcmp(arg[iarg+1],"x") == 0) cdim = 0; if (strcmp(arg[iarg+1],"x") == 0) cdim = 0;
else if (strcmp(arg[iarg+1],"y") == 0) cdim = 1; else if (strcmp(arg[iarg+1],"y") == 0) cdim = 1;
else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2; else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2;
else error->all("Illegal fix indent command"); else error->all("Illegal fix indent command");
planepos = atof(arg[iarg+2]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
pstr = new char[n];
strcpy(pstr,&arg[iarg+2][2]);
} else pvalue = atof(arg[iarg+2]);
if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1; if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1;
else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1; else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1;
else error->all("Illegal fix indent command"); else error->all("Illegal fix indent command");
istyle = PLANE; istyle = PLANE;
iarg += 4; iarg += 4;
} else if (strcmp(arg[iarg],"vel") == 0) {
if (iarg+4 > narg) error->all("Illegal fix indent command");
vx = atof(arg[iarg+1]);
vy = atof(arg[iarg+2]);
vz = atof(arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"rstart") == 0) {
if (iarg+2 > narg) error->all("Illegal fix indent command");
radflag = 1;
r0_start = atof(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"units") == 0) { } else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all("Illegal fix indent command"); if (iarg+2 > narg) error->all("Illegal fix indent command");
if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0; if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1; else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
else error->all("Illegal fix indent command"); else error->all("Illegal fix indent command");
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"side") == 0) { } else if (strcmp(arg[iarg],"side") == 0) {
if (iarg+2 > narg) error->all("Illegal fix indent command"); if (iarg+2 > narg) error->all("Illegal fix indent command");
if (strcmp(arg[iarg+1],"in") == 0) side = INSIDE; if (strcmp(arg[iarg+1],"in") == 0) side = INSIDE;

View File

@ -27,6 +27,7 @@ namespace LAMMPS_NS {
class FixIndent : public Fix { class FixIndent : public Fix {
public: public:
FixIndent(class LAMMPS *, int, char **); FixIndent(class LAMMPS *, int, char **);
~FixIndent();
int setmask(); int setmask();
void init(); void init();
void setup(int); void setup(int);
@ -38,14 +39,14 @@ class FixIndent : public Fix {
double compute_vector(int); double compute_vector(int);
private: private:
int istyle,scaleflag,radflag,thermo_flag,eflag_enable,side; int istyle,scaleflag,thermo_flag,eflag_enable,side;
double k,k3; double k,k3;
double x0,y0,z0,r0_stop,r0_start,planepos; char *xstr,*ystr,*zstr,*rstr,*pstr;
int xvar,yvar,zvar,rvar,pvar;
double xvalue,yvalue,zvalue,rvalue,pvalue;
int indenter_flag,planeside; int indenter_flag,planeside;
double indenter[4],indenter_all[4]; double indenter[4],indenter_all[4];
int cdim; int cdim;
double c1,c2;
double vx,vy,vz;
int nlevels_respa; int nlevels_respa;
void options(int, char **); void options(int, char **);

View File

@ -41,7 +41,8 @@ using namespace LAMMPS_NS;
// customize a new keyword by adding to this list: // customize a new keyword by adding to this list:
// step, atoms, cpu, dt, temp, press, pe, ke, etotal, enthalpy // step, elapsed, elaplong, dt, cpu
// atoms, temp, press, pe, ke, etotal, enthalpy
// evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail // evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail
// vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, xlat, ylat, zlat // vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, xlat, ylat, zlat
// pxx, pyy, pzz, pxy, pxz, pyz // pxx, pyy, pzz, pxy, pxz, pyz
@ -60,7 +61,7 @@ enum{SCALAR,VECTOR,ARRAY};
#define INVOKED_VECTOR 2 #define INVOKED_VECTOR 2
#define INVOKED_ARRAY 4 #define INVOKED_ARRAY 4
#define MAXLINE 1024 #define MAXLINE 8192 // make this 4x longer than Input::MAXLINE
#define DELTA 8 #define DELTA 8
#define MIN(A,B) ((A) < (B)) ? (A) : (B) #define MIN(A,B) ((A) < (B)) ? (A) : (B)
@ -583,13 +584,17 @@ void Thermo::parse_fields(char *str)
if (strcmp(word,"step") == 0) { if (strcmp(word,"step") == 0) {
addfield("Step",&Thermo::compute_step,INT); addfield("Step",&Thermo::compute_step,INT);
} else if (strcmp(word,"atoms") == 0) { } else if (strcmp(word,"elapsed") == 0) {
addfield("Atoms",&Thermo::compute_atoms,INT); addfield("Elapsed",&Thermo::compute_elapsed,INT);
} else if (strcmp(word,"cpu") == 0) { } else if (strcmp(word,"elaplong") == 0) {
addfield("CPU",&Thermo::compute_cpu,FLOAT); addfield("Elaplong",&Thermo::compute_elapsed_long,INT);
} else if (strcmp(word,"dt") == 0) { } else if (strcmp(word,"dt") == 0) {
addfield("Dt",&Thermo::compute_dt,FLOAT); addfield("Dt",&Thermo::compute_dt,FLOAT);
} else if (strcmp(word,"cpu") == 0) {
addfield("CPU",&Thermo::compute_cpu,FLOAT);
} else if (strcmp(word,"atoms") == 0) {
addfield("Atoms",&Thermo::compute_atoms,INT);
} else if (strcmp(word,"temp") == 0) { } else if (strcmp(word,"temp") == 0) {
addfield("Temp",&Thermo::compute_temp,FLOAT); addfield("Temp",&Thermo::compute_temp,FLOAT);
index_temp = add_compute(id_temp,SCALAR); index_temp = add_compute(id_temp,SCALAR);
@ -884,16 +889,28 @@ int Thermo::evaluate_keyword(char *word, double *answer)
compute_step(); compute_step();
dvalue = ivalue; dvalue = ivalue;
} else if (strcmp(word,"atoms") == 0) { } else if (strcmp(word,"elapsed") == 0) {
compute_atoms(); if (update->whichflag == 0)
error->all("This variable thermo keyword cannot be used between runs");
compute_elapsed();
dvalue = ivalue; dvalue = ivalue;
} else if (strcmp(word,"elaplong") == 0) {
if (update->whichflag == 0)
error->all("This variable thermo keyword cannot be used between runs");
compute_elapsed_long();
dvalue = ivalue;
} else if (strcmp(word,"dt") == 0) {
compute_dt();
} else if (strcmp(word,"cpu") == 0) { } else if (strcmp(word,"cpu") == 0) {
if (update->whichflag == 0) firststep = 0; if (update->whichflag == 0) firststep = 0;
compute_cpu(); compute_cpu();
} else if (strcmp(word,"dt") == 0) { } else if (strcmp(word,"atoms") == 0) {
compute_dt(); compute_atoms();
dvalue = ivalue;
} else if (strcmp(word,"temp") == 0) { } else if (strcmp(word,"temp") == 0) {
if (!temperature) if (!temperature)
@ -1282,9 +1299,23 @@ void Thermo::compute_step()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void Thermo::compute_atoms() void Thermo::compute_elapsed()
{ {
ivalue = static_cast<int> (natoms); ivalue = update->ntimestep - update->firststep;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_elapsed_long()
{
ivalue = update->ntimestep - update->beginstep;
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_dt()
{
dvalue = update->dt;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -1297,9 +1328,9 @@ void Thermo::compute_cpu()
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void Thermo::compute_dt() void Thermo::compute_atoms()
{ {
dvalue = update->dt; ivalue = static_cast<int> (natoms);
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -106,11 +106,13 @@ class Thermo : protected Pointers {
// functions that compute a single value // functions that compute a single value
// customize a new keyword by adding a method prototype // customize a new keyword by adding a method prototype
void compute_step(); void compute_step();
void compute_atoms(); void compute_elapsed();
void compute_cpu(); void compute_elapsed_long();
void compute_dt(); void compute_dt();
void compute_cpu();
void compute_atoms();
void compute_temp(); void compute_temp();
void compute_press(); void compute_press();
void compute_pe(); void compute_pe();