2006-09-22 00:22:34 +08:00
|
|
|
<HTML>
|
|
|
|
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
|
|
|
|
</CENTER>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H3>fix gravity command
|
|
|
|
</H3>
|
2011-06-09 05:46:03 +08:00
|
|
|
<H3>fix gravity/cuda command
|
|
|
|
</H3>
|
2011-10-07 01:32:51 +08:00
|
|
|
<H3>fix gravity/omp command
|
|
|
|
</H3>
|
2006-09-22 00:22:34 +08:00
|
|
|
<P><B>Syntax:</B>
|
|
|
|
</P>
|
2013-07-08 22:42:04 +08:00
|
|
|
<PRE>fix ID group gravity magnitude style args
|
2006-09-22 00:22:34 +08:00
|
|
|
</PRE>
|
|
|
|
<UL><LI>ID, group are documented in <A HREF = "fix.html">fix</A> command
|
|
|
|
|
|
|
|
<LI>gravity = style name of this fix command
|
|
|
|
|
2007-07-09 22:09:39 +08:00
|
|
|
<LI>magnitude = size of acceleration (force/mass units)
|
|
|
|
|
2012-06-02 06:23:58 +08:00
|
|
|
<LI>magnitude can be a variable (see below)
|
|
|
|
|
2006-09-22 00:22:34 +08:00
|
|
|
<LI>style = <I>chute</I> or <I>spherical</I> or <I>gradient</I> or <I>vector</I>
|
|
|
|
|
|
|
|
<PRE> <I>chute</I> args = angle
|
2007-07-09 22:09:39 +08:00
|
|
|
angle = angle in +x away from -z or -y axis in 3d/2d (in degrees)
|
2012-06-02 06:23:58 +08:00
|
|
|
angle can be a variable (see below)
|
2006-09-22 00:22:34 +08:00
|
|
|
<I>spherical</I> args = phi theta
|
|
|
|
phi = azimuthal angle from +x axis (in degrees)
|
2007-07-09 22:09:39 +08:00
|
|
|
theta = angle from +z or +y axis in 3d/2d (in degrees)
|
2012-06-02 06:23:58 +08:00
|
|
|
phi or theta can be a variable (see below)
|
2007-07-09 22:09:39 +08:00
|
|
|
<I>vector</I> args = x y z
|
2012-06-02 06:23:58 +08:00
|
|
|
x y z = vector direction to apply the acceleration
|
|
|
|
x or y or z can be a variable (see below)
|
2006-09-22 00:22:34 +08:00
|
|
|
</PRE>
|
|
|
|
|
|
|
|
</UL>
|
|
|
|
<P><B>Examples:</B>
|
|
|
|
</P>
|
2007-07-09 22:09:39 +08:00
|
|
|
<PRE>fix 1 all gravity 1.0 chute 24.0
|
2012-06-02 06:23:58 +08:00
|
|
|
fix 1 all gravity v_increase chute 24.0
|
2007-07-09 22:09:39 +08:00
|
|
|
fix 1 all gravity 1.0 spherical 0.0 -180.0
|
2012-06-02 06:23:58 +08:00
|
|
|
fix 1 all gravity 10.0 spherical v_phi v_theta
|
2007-07-09 22:09:39 +08:00
|
|
|
fix 1 all gravity 100.0 vector 1 1 0
|
2006-09-22 00:22:34 +08:00
|
|
|
</PRE>
|
|
|
|
<P><B>Description:</B>
|
|
|
|
</P>
|
2007-07-09 22:09:39 +08:00
|
|
|
<P>Impose an additional acceleration on each particle in the group. This
|
|
|
|
fix is typically used with granular systems to include a "gravity"
|
|
|
|
term acting on the macroscopic particles. More generally, it can
|
|
|
|
represent any kind of driving field, e.g. a pressure gradient inducing
|
2008-03-01 09:13:20 +08:00
|
|
|
a Poiseuille flow in a fluid. Note that this fix operates differently
|
2007-07-09 22:09:39 +08:00
|
|
|
than the <A HREF = "fix_addforce.html">fix addforce</A> command. The addforce fix
|
|
|
|
adds the same force to each atom, independent of its mass. This
|
|
|
|
command imparts the same acceleration to each atom (force/mass).
|
|
|
|
</P>
|
|
|
|
<P>The <I>magnitude</I> of the acceleration is specified in force/mass units.
|
|
|
|
For granular systems (LJ units) this is typically 1.0. See the
|
|
|
|
<A HREF = "units.html">units</A> command for details.
|
2006-09-22 00:22:34 +08:00
|
|
|
</P>
|
2007-07-09 22:09:39 +08:00
|
|
|
<P>Style <I>chute</I> is typically used for simulations of chute flow where
|
2012-06-02 06:23:58 +08:00
|
|
|
the specified <I>angle</I> is the chute angle, with flow occurring in the +x
|
2007-07-09 22:09:39 +08:00
|
|
|
direction. For 3d systems, the tilt is away from the z axis; for 2d
|
|
|
|
systems, the tilt is away from the y axis.
|
2006-09-22 00:22:34 +08:00
|
|
|
</P>
|
2007-07-09 22:09:39 +08:00
|
|
|
<P>Style <I>spherical</I> allows an arbitrary 3d direction to be specified for
|
2012-06-02 06:23:58 +08:00
|
|
|
the acceleration vector. <I>Phi</I> and <I>theta</I> are defined in the usual
|
2007-07-09 22:09:39 +08:00
|
|
|
spherical coordinates. Thus for acceleration acting in the -z
|
2012-06-02 06:23:58 +08:00
|
|
|
direction, <I>theta</I> would be 180.0 (or -180.0). <I>Theta</I> = 90.0 and
|
|
|
|
<I>phi</I> = -90.0 would mean acceleration acts in the -y direction. For
|
|
|
|
2d systems, <I>phi</I> is ignored and <I>theta</I> is an angle in the xy plane
|
|
|
|
where <I>theta</I> = 0.0 is the y-axis.
|
2006-09-22 00:22:34 +08:00
|
|
|
</P>
|
2007-07-09 22:09:39 +08:00
|
|
|
<P>Style <I>vector</I> imposes an acceleration in the vector direction given
|
2012-06-02 06:23:58 +08:00
|
|
|
by (x,y,z). Only the direction of the vector is important; it's
|
|
|
|
length is ignored. For 2d systems, the <I>z</I> component is ignored.
|
|
|
|
</P>
|
|
|
|
<P>Any of the quantities <I>magnitude</I>, <I>angle</I>, <I>phi</I>, <I>theta</I>, <I>x</I>, <I>y</I>,
|
|
|
|
<I>z</I> which define the gravitational magnitude and direction, can be
|
|
|
|
specified as an equal-style <A HREF = "variable.html">variable</A>. If the value is
|
|
|
|
a variable, it should be specified as v_name, where name is the
|
|
|
|
variable name. In this case, the variable will be evaluated each
|
|
|
|
timestep, and its value used to determine the quantity. You should
|
|
|
|
insure that the variable calculates a result in the approriate units,
|
|
|
|
e.g. force/mass or degrees.
|
|
|
|
</P>
|
|
|
|
<P>Equal-style variables can specify formulas with various mathematical
|
|
|
|
functions, and include <A HREF = "thermo_style.html">thermo_style</A> command
|
|
|
|
keywords for the simulation box parameters and timestep and elapsed
|
|
|
|
time. Thus it is easy to specify a time-dependent gravitational
|
|
|
|
field.
|
2006-09-22 00:22:34 +08:00
|
|
|
</P>
|
2011-06-09 05:46:03 +08:00
|
|
|
<HR>
|
|
|
|
|
2014-08-15 00:30:25 +08:00
|
|
|
<P>Styles with a <I>cuda</I>, <I>gpu</I>, <I>intel</I>, <I>kk</I>, <I>omp</I>, or <I>opt</I> suffix are
|
|
|
|
functionally the same as the corresponding style without the suffix.
|
|
|
|
They have been optimized to run faster, depending on your available
|
|
|
|
hardware, as discussed in <A HREF = "Section_accelerate.html">Section_accelerate</A>
|
|
|
|
of the manual. The accelerated styles take the same arguments and
|
|
|
|
should produce the same results, except for round-off and precision
|
|
|
|
issues.
|
|
|
|
</P>
|
|
|
|
<P>These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL,
|
|
|
|
KOKKOS, USER-OMP and OPT packages, respectively. They are only
|
|
|
|
enabled if LAMMPS was built with those packages. See the <A HREF = "Section_start.html#start_3">Making
|
|
|
|
LAMMPS</A> section for more info.
|
2011-06-09 05:46:03 +08:00
|
|
|
</P>
|
|
|
|
<P>You can specify the accelerated styles explicitly in your input script
|
2012-01-28 07:39:14 +08:00
|
|
|
by including their suffix, or you can use the <A HREF = "Section_start.html#start_7">-suffix command-line
|
2011-08-26 00:46:23 +08:00
|
|
|
switch</A> when you invoke LAMMPS, or you can
|
|
|
|
use the <A HREF = "suffix.html">suffix</A> command in your input script.
|
2011-06-09 05:46:03 +08:00
|
|
|
</P>
|
2011-12-14 04:35:35 +08:00
|
|
|
<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
|
|
|
|
more instructions on how to use the accelerated styles effectively.
|
2011-06-09 05:46:03 +08:00
|
|
|
</P>
|
|
|
|
<HR>
|
|
|
|
|
2007-10-11 06:28:11 +08:00
|
|
|
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
|
2007-06-26 08:03:39 +08:00
|
|
|
</P>
|
|
|
|
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
|
2011-08-28 04:35:24 +08:00
|
|
|
files</A>.
|
|
|
|
</P>
|
|
|
|
<P>The <A HREF = "fix_modify.html">fix_modify</A> <I>energy</I> option is supported by this
|
|
|
|
fix to add the gravitational potential energy of the system to the
|
|
|
|
system's potential energy as part of <A HREF = "thermo_style.html">thermodynamic
|
|
|
|
output</A>.
|
|
|
|
</P>
|
|
|
|
<P>This fix computes a global scalar which can be accessed by various
|
|
|
|
<A HREF = "Section_howto.html#howto_15">output commands</A>. This scalar is the
|
|
|
|
gravitational potential energy of the particles in the defined field,
|
|
|
|
namely mass * (g dot x) for each particles, where x and mass are the
|
|
|
|
particles position and mass, and g is the gravitational field. The
|
|
|
|
scalar value calculated by this fix is "extensive".
|
|
|
|
</P>
|
|
|
|
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
|
|
|
|
the <A HREF = "run.html">run</A> command. This fix is not invoked during <A HREF = "minimize.html">energy
|
|
|
|
minimization</A>.
|
2007-06-26 08:03:39 +08:00
|
|
|
</P>
|
2007-07-09 22:09:39 +08:00
|
|
|
<P><B>Restrictions:</B> none
|
2006-09-22 00:22:34 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Related commands:</B>
|
|
|
|
</P>
|
2011-04-14 05:39:34 +08:00
|
|
|
<P><A HREF = "atom_style.html">atom_style sphere</A>, <A HREF = "fix_addforce.html">fix addforce</A>
|
2006-09-22 00:22:34 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Default:</B> none
|
|
|
|
</P>
|
|
|
|
</HTML>
|