<span id="index-0"></span><h1>dump image command<a class="headerlink" href="#dump-image-command" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="dump-movie-command">
<h1>dump movie command<a class="headerlink" href="#dump-movie-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>dump ID group-ID style N file color diameter keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>ID = user-assigned name for the dump</li>
<li>group-ID = ID of the group of atoms to be imaged</li>
<li>style = <em>image</em> or <em>movie</em> = style of dump command (other styles <em>atom</em> or <em>cfg</em> or <em>dcd</em> or <em>xtc</em> or <em>xyz</em> or <em>local</em> or <em>custom</em> are discussed on the <a class="reference internal" href="dump.html"><em>dump</em></a> doc page)</li>
<li>N = dump every this many timesteps</li>
<li>file = name of file to write image to</li>
<li>color = atom attribute that determines color of each atom</li>
<li>diameter = atom attribute that determines size of each atom</li>
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>adiam</em> or <em>atom</em> or <em>bond</em> or <em>size</em> or <em>view</em> or <em>center</em> or <em>up</em> or <em>zoom</em> or <em>persp</em> or <em>box</em> or <em>axes</em> or <em>subbox</em> or <em>shiny</em> or <em>ssao</em></li>
</ul>
<pre class="literal-block">
<em>adiam</em> value = number = numeric value for atom diameter (distance units)
<em>atom</em> = yes/no = do or do not draw atoms
<em>bond</em> values = color width = color and width of bonds
color = <em>atom</em> or <em>type</em> or <em>none</em>
width = number or <em>atom</em> or <em>type</em> or <em>none</em>
number = numeric value for bond width (distance units)
<em>size</em> values = width height = size of images
width = width of image in # of pixels
height = height of image in # of pixels
<em>view</em> values = theta phi = view of simulation box
theta = view angle from +z axis (degrees)
phi = azimuthal view angle (degrees)
theta or phi can be a variable (see below)
<em>center</em> values = flag Cx Cy Cz = center point of image
flag = "s" for static, "d" for dynamic
Cx,Cy,Cz = center point of image as fraction of box dimension (0.5 = center of box)
Cx,Cy,Cz can be variables (see below)
<em>up</em> values = Ux Uy Uz = direction that is "up" in image
Ux,Uy,Uz = components of up vector
Ux,Uy,Uz can be variables (see below)
<em>zoom</em> value = zfactor = size that simulation box appears in image
zfactor = scale image size by factor > 1 to enlarge, factor < 1 to shrink
zfactor can be a variable (see below)
<em>persp</em> value = pfactor = amount of "perspective" in image
which are prefixed by “<a href="#id9"><span class="problematic" id="id10">c_</span></a>”, “<a href="#id11"><span class="problematic" id="id12">f_</span></a>”, or “<a href="#id13"><span class="problematic" id="id14">v_</span></a>” respectively. Note that the
<em>diameter</em> setting can be overridden with a numeric value by the
optional <em>adiam</em> keyword, in which case you can specify the <em>diameter</em>
setting with any valid atom attribute.</p>
<p>If <em>type</em> is specified for the <em>color</em> setting, then the color of each
atom is determined by its atom type. By default the mapping of types
to colors is as follows:</p>
<ul class="simple">
<li>type 1 = red</li>
<li>type 2 = green</li>
<li>type 3 = blue</li>
<li>type 4 = yellow</li>
<li>type 5 = aqua</li>
<li>type 6 = cyan</li>
</ul>
<p>and repeats itself for types > 6. This mapping can be changed by the
<p>If <em>type</em> is specified for the <em>diameter</em> setting then the diameter of
each atom is determined by its atom type. By default all types have
diameter 1.0. This mapping can be changed by the <a class="reference internal" href="dump_modify.html"><em>dump_modify adiam</em></a> command.</p>
<p>If <em>element</em> is specified for the <em>color</em> and/or <em>diameter</em> setting,
then the color and/or diameter of each atom is determined by which
element it is, which in turn is specified by the element-to-type
mapping specified by the “dump_modify element” command. By default
every atom type is C (carbon). Every element has a color and diameter
associated with it, which is the same as the colors and sizes used by
the <a class="reference external" href="http://mt.seas.upenn.edu/Archive/Graphics/A">AtomEye</a> visualization package.</p>
<p>If other atom attributes are used for the <em>color</em> or <em>diameter</em>
settings, they are interpreted in the following way.</p>
<p>If “vx”, for example, is used as the <em>color</em> setting, then the color
of the atom will depend on the x-component of its velocity. The
association of a per-atom value with a specific color is determined by
a “color map”, which can be specified via the
<a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command. The basic idea is that the
atom-attribute will be within a range of values, and every value
within the range is mapped to a specific color. Depending on how the
color map is defined, that mapping can take place via interpolation so
that a value of -3.2 is halfway between “red” and “blue”, or
discretely so that the value of -3.2 is “orange”.</p>
<p>If “vx”, for example, is used as the <em>diameter</em> setting, then the atom
will be rendered using the x-component of its velocity as the
diameter. If the per-atom value <= 0.0, them the atom will not be
drawn. Note that finite-size spherical particles, as defined by
<a class="reference internal" href="atom_style.html"><em>atom_style sphere</em></a> define a per-particle radius or
diameter, which can be used as the <em>diameter</em> setting.</p>
<hr class="docutils" />
<p>The various kewords listed above control how the image is rendered.
As listed below, all of the keywords have defaults, most of which you
will likely not need to change. The <a class="reference internal" href="dump_modify.html"><em>dump modify</em></a>
also has options specific to the dump image style, particularly for
assigning colors to atoms, bonds, and other image features.</p>
<hr class="docutils" />
<p>The <em>adiam</em> keyword allows you to override the <em>diameter</em> setting to a
per-atom attribute with a specified numeric value. All atoms will be
drawn with that diameter, e.g. 1.5, which is in whatever distance
<a class="reference internal" href="units.html"><em>units</em></a> the input script defines, e.g. Angstroms.</p>
<p>The <em>atom</em> keyword allow you to turn off the drawing of all atoms,
if the specified value is <em>no</em>.</p>
<p>The <em>bond</em> keyword allows to you to alter how bonds are drawn. A bond
is only drawn if both atoms in the bond are being drawn due to being
in the specified group and due to other selection criteria
(e.g. region, threshhold settings of the
<a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command). By default, bonds are drawn
if they are defined in the input data file as read by the
<a class="reference internal" href="read_data.html"><em>read_data</em></a> command. Using <em>none</em> for both the bond
<em>color</em> and <em>width</em> value will turn off the drawing of all bonds.</p>
<p>If <em>atom</em> is specified for the bond <em>color</em> value, then each bond is
drawn in 2 halves, with the color of each half being the color of the
atom at that end of the bond.</p>
<p>If <em>type</em> is specified for the <em>color</em> value, then the color of each
bond is determined by its bond type. By default the mapping of bond
types to colors is as follows:</p>
<ul class="simple">
<li>type 1 = red</li>
<li>type 2 = green</li>
<li>type 3 = blue</li>
<li>type 4 = yellow</li>
<li>type 5 = aqua</li>
<li>type 6 = cyan</li>
</ul>
<p>and repeats itself for bond types > 6. This mapping can be changed by
the <a class="reference internal" href="dump_modify.html"><em>dump_modify bcolor</em></a> command.</p>
<p>The bond <em>width</em> value can be a numeric value or <em>atom</em> or <em>type</em> (or
<em>none</em> as indicated above).</p>
<p>If a numeric value is specified, then all bonds will be drawn as
cylinders with that diameter, e.g. 1.0, which is in whatever distance
<a class="reference internal" href="units.html"><em>units</em></a> the input script defines, e.g. Angstroms.</p>
<p>If <em>atom</em> is specified for the <em>width</em> value, then each bond
will be drawn with a width corresponding to the minimum diameter
of the 2 atoms in the bond.</p>
<p>If <em>type</em> is specified for the <em>width</em> value then the diameter of each
bond is determined by its bond type. By default all types have
diameter 0.5. This mapping can be changed by the <a class="reference internal" href="dump_modify.html"><em>dump_modify bdiam</em></a> command.</p>
<hr class="docutils" />
<p>The <em>size</em> keyword sets the width and height of the created images,
i.e. the number of pixels in each direction.</p>
<hr class="docutils" />
<p>The <em>view</em>, <em>center</em>, <em>up</em>, <em>zoom</em>, and <em>persp</em> values determine how
3d simulation space is mapped to the 2d plane of the image. Basically
they control how the simulation box appears in the image.</p>
<p>All of the <em>view</em>, <em>center</em>, <em>up</em>, <em>zoom</em>, and <em>persp</em> values can be
specified as numeric quantities, whose meaning is explained below.
Any of them can also be specified as an <a class="reference internal" href="variable.html"><em>equal-style variable</em></a>, by using v_name as the value, where “name” is
the variable name. In this case the variable will be evaluated on the
timestep each image is created to create a new value. If the
equal-style variable is time-dependent, this is a means of changing
the way the simulation box appears from image to image, effectively
doing a pan or fly-by view of your simulation.</p>
<p>The <em>view</em> keyword determines the viewpoint from which the simulation
box is viewed, looking towards the <em>center</em> point. The <em>theta</em> value
is the vertical angle from the +z axis, and must be an angle from 0 to
180 degrees. The <em>phi</em> value is an azimuthal angle around the z axis
and can be positive or negative. A value of 0.0 is a view along the
+x axis, towards the <em>center</em> point. If <em>theta</em> or <em>phi</em> are
specified via variables, then the variable values should be in
degrees.</p>
<p>The <em>center</em> keyword determines the point in simulation space that
will be at the center of the image. <em>Cx</em>, <em>Cy</em>, and <em>Cz</em> are
speficied as fractions of the box dimensions, so that (0.5,0.5,0.5) is
the center of the simulation box. These values do not have to be
between 0.0 and 1.0, if you want the simulation box to be offset from
the center of the image. Note, however, that if you choose strange
values for <em>Cx</em>, <em>Cy</em>, or <em>Cz</em> you may get a blank image. Internally,
<em>Cx</em>, <em>Cy</em>, and <em>Cz</em> are converted into a point in simulation space.
If <em>flag</em> is set to “s” for static, then this conversion is done once,
at the time the dump command is issued. If <em>flag</em> is set to “d” for
dynamic then the conversion is performed every time a new image is
created. If the box size or shape is changing, this will adjust the
center point in simulation space.</p>
<p>The <em>up</em> keyword determines what direction in simulation space will be
“up” in the image. Internally it is stored as a vector that is in the
plane perpendicular to the view vector implied by the <em>theta</em> and
<em>pni</em> values, and which is also in the plane defined by the view
vector and user-specified up vector. Thus this internal vector is
computed from the user-specified <em>up</em> vector as</p>
<p>This means the only restriction on the specified <em>up</em> vector is that
it cannot be parallel to the <em>view</em> vector, implied by the <em>theta</em> and
<em>phi</em> values.</p>
<p>The <em>zoom</em> keyword scales the size of the simulation box as it appears
in the image. The default <em>zfactor</em> value of 1 should display an
image mostly filled by the atoms in the simulation box. A <em>zfactor</em> >
1 will make the simulation box larger; a <em>zfactor</em> < 1 will make it
smaller. <em>Zfactor</em> must be a value > 0.0.</p>
<p>The <em>persp</em> keyword determines how much depth perspective is present
in the image. Depth perspective makes lines that are parallel in
simulation space appear non-parallel in the image. A <em>pfactor</em> value
of 0.0 means that parallel lines will meet at infininty (1.0/pfactor),
which is an orthographic rendering with no persepctive. A <em>pfactor</em>
value between 0.0 and 1.0 will introduce more perspective. A <em>pfactor</em>
value > 1 will create a highly skewed image with a large amount of
perspective.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The <em>persp</em> keyword is not yet supported as an option.</p>
</div>
<hr class="docutils" />
<p>The <em>box</em> keyword determines if and how the simulation box boundaries
are rendered as thin cylinders in the image. If <em>no</em> is set, then the
box boundaries are not drawn and the <em>diam</em> setting is ignored. If
<em>yes</em> is set, the 12 edges of the box are drawn, with a diameter that
is a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
2d). The color of the box boundaries can be set with the <a class="reference internal" href="dump_modify.html"><em>dump_modify boxcolor</em></a> command.</p>
<p>The <em>axes</em> keyword determines if and how the coordinate axes are
rendered as thin cylinders in the image. If <em>no</em> is set, then the
axes are not drawn and the <em>length</em> and <em>diam</em> settings are ignored.
If <em>yes</em> is set, 3 thin cylinders are drawn to represent the x,y,z
axes in colors red,green,blue. The origin of these cylinders will be
offset from the lower left corner of the box by 10%. The <em>length</em>
setting determines how long the cylinders will be as a fraction of the
respective box lengths. The <em>diam</em> setting determines their thickness
as a fraction of the shortest box length in x,y,z (for 3d) or x,y (for
2d).</p>
<p>The <em>subbox</em> keyword determines if and how processor sub-domain
boundaries are rendered as thin cylinders in the image. If <em>no</em> is
set (default), then the sub-domain boundaries are not drawn and the
<em>diam</em> setting is ignored. If <em>yes</em> is set, the 12 edges of each
processor sub-domain are drawn, with a diameter that is a fraction of
the shortest box length in x,y,z (for 3d) or x,y (for 2d). The color
of the sub-domain boundaries can be set with the <a class="reference internal" href="dump_modify.html"><em>dump_modify boxcolor</em></a> command.</p>
<hr class="docutils" />
<p>The <em>shiny</em> keyword determines how shiny the objects rendered in the
image will appear. The <em>sfactor</em> value must be a value 0.0 <=
<em>sfactor</em> <= 1.0, where <em>sfactor</em> = 1 is a highly reflective surface
and <em>sfactor</em> = 0 is a rough non-shiny surface.</p>
<p>The <em>ssao</em> keyword turns on/off a screen space ambient occlusion
(SSAO) model for depth shading. If <em>yes</em> is set, then atoms further
away from the viewer are darkened via a randomized process, which is
perceived as depth. The calculation of this effect can increase the
cost of computing the image by roughly 2x. The strength of the effect
can be scaled by the <em>dfactor</em> parameter. If <em>no</em> is set, no depth
shading is performed.</p>
<hr class="docutils" />
<p>A series of JPEG, PNG, or PPM images can be converted into a movie
file and then played as a movie using commonly available tools. Using
dump style <em>movie</em> automates this step and avoids the intermediate
step of writing (many) image snapshot file. But LAMMPS has to be
compiled with -DLAMMPS_FFMPEG and an FFmpeg executable have to be
installed.</p>
<p>To manually convert JPEG, PNG or PPM files into an animated GIF or
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.