Page MenuHomec4science

dump_image.html
No OneTemporary

File Metadata

Created
Sat, Nov 30, 03:18

dump_image.html

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dump image command &mdash; LAMMPS documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
<link rel="top" title="LAMMPS documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="Manual.html" class="icon icon-home"> LAMMPS
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance &amp; scalability</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying &amp; extending LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="Manual.html">LAMMPS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="Manual.html">Docs</a> &raquo;</li>
<li>dump image command</li>
<li class="wy-breadcrumbs-aside">
<a href="http://lammps.sandia.gov">Website</a>
<a href="Section_commands.html#comm">Commands</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="dump-image-command">
<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>atom</em> or <em>adiam</em> or <em>bond</em> or <em>line</em> or <em>tri</em> or <em>body</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>atom</em> = yes/no = do or do not draw atoms
<em>adiam</em> size = numeric value for atom diameter (distance units)
<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>line</em> = color width
color = <em>type</em>
width = numeric value for line width (distance units)
<em>tri</em> = color tflag width
color = <em>type</em>
tflag = 1 for just triangle, 2 for just tri edges, 3 for both
width = numeric value for tringle edge width (distance units)
<em>body</em> = color bflag1 bflag2
color = <em>type</em>
bflag1,bflag2 = 2 numeric flags to affect how bodies are drawn
<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 = &quot;s&quot; for static, &quot;d&quot; 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 &quot;up&quot; 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 &gt; 1 to enlarge, factor &lt; 1 to shrink
zfactor can be a variable (see below)
<em>persp</em> value = pfactor = amount of &quot;perspective&quot; in image
pfactor = amount of perspective (0 = none, &lt; 1 = some, &gt; 1 = highly skewed)
pfactor can be a variable (see below)
<em>box</em> values = yes/no diam = draw outline of simulation box
yes/no = do or do not draw simulation box lines
diam = diameter of box lines as fraction of shortest box length
<em>axes</em> values = yes/no length diam = draw xyz axes
yes/no = do or do not draw xyz axes lines next to simulation box
length = length of axes lines as fraction of respective box lengths
diam = diameter of axes lines as fraction of shortest box length
<em>subbox</em> values = yes/no diam = draw outline of processor sub-domains
yes/no = do or do not draw sub-domain lines
diam = diameter of sub-domain lines as fraction of shortest box length
<em>shiny</em> value = sfactor = shinyness of spheres and cylinders
sfactor = shinyness of spheres and cylinders from 0.0 to 1.0
<em>ssao</em> value = yes/no seed dfactor = SSAO depth shading
yes/no = turn depth shading on/off
seed = random # seed (positive integer)
dfactor = strength of shading from 0.0 to 1.0
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>dump d0 all image 100 dump.*.jpg type type
dump d1 mobile image 500 snap.*.png element element ssao yes 4539 0.6
dump d2 all image 200 img-*.ppm type type zoom 2.5 adiam 1.5 size 1280 720
dump m0 all movie 1000 movie.mpg type type size 640 480
dump m1 all movie 1000 movie.avi type type size 640 480
dump m2 all movie 100 movie.m4v type type zoom 1.8 adiam v_value size 1280 720
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Dump a high-quality rendered image of the atom configuration every N
timesteps and save the images either as a sequence of JPEG or PNG or
PPM files, or as a single movie file. The options for this command as
well as the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command control what is
included in the image or movie and how it appears. A series of such
images can easily be manually converted into an animated movie of your
simulation or the process can be automated without writing the
intermediate files using the dump movie style; see further details
below. Other dump styles store snapshots of numerical data asociated
with atoms in various formats, as discussed on the <a class="reference internal" href="dump.html"><em>dump</em></a>
doc page.</p>
<p>Note that a set of images or a movie can be made after a simulation
has been run, using the <a class="reference internal" href="rerun.html"><em>rerun</em></a> command to read snapshots
from an existing dump file, and using these dump commands in the rerun
script to generate the images/movie.</p>
<p>Here are two sample images, rendered as 1024x1024 JPEG files. Click
to see the full-size images:</p>
<DIV ALIGN=center><a data-lightbox="group-default"
href="_images/dump1.jpg"
class=""
title=""
data-title=""
><img src="_images/dump1.jpg"
class=""
width="25%"
height="auto"
alt=""/>
</a><a data-lightbox="group-default"
href="_images/dump2.jpg"
class=""
title=""
data-title=""
><img src="_images/dump2.jpg"
class=""
width="25%"
height="auto"
alt=""/>
</a></DIV><p>Only atoms in the specified group are rendered in the image. The
<a class="reference internal" href="dump_modify.html"><em>dump_modify region and thresh</em></a> commands can also
alter what atoms are included in the image.
The filename suffix determines whether a JPEG, PNG, or PPM file is
created with the <em>image</em> dump style. If the suffix is &#8221;.jpg&#8221; or
&#8221;.jpeg&#8221;, then a JPEG format file is created, if the suffix is &#8221;.png&#8221;,
then a PNG format is created, else a PPM (aka NETPBM) format file is
created. The JPEG and PNG files are binary; PPM has a text mode
header followed by binary data. JPEG images have lossy compression;
PNG has lossless compression; and PPM files are uncompressed but can
be compressed with gzip, if LAMMPS has been compiled with
-DLAMMPS_GZIP and a &#8221;.gz&#8221; suffix is used.</p>
<p>Similarly, the format of the resulting movie is chosen with the
<em>movie</em> dump style. This is handled by the underlying FFmpeg converter
and thus details have to be looked up in the FFmpeg documentation.
Typical examples are: .avi, .mpg, .m4v, .mp4, .mkv, .flv, .mov, .gif
Additional settings of the movie compression like bitrate and
framerate can be set using the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command.</p>
<p>To write out JPEG and PNG format files, you must build LAMMPS with
support for the corresponding JPEG or PNG library. To convert images
into movies, LAMMPS has to be compiled with the -DLAMMPS_FFMPEG
flag. See <a class="reference internal" href="Section_start.html#start-2-4"><span>this section</span></a> of the manual
for instructions on how to do this.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Because periodic boundary conditions are enforced only on
timesteps when neighbor lists are rebuilt, the coordinates of an atom
in the image may be slightly outside the simulation box.</p>
</div>
<hr class="docutils" />
<p>Dumps are performed on timesteps that are a multiple of N (including
timestep 0) and on the last timestep of a minimization if the
minimization converges. Note that this means a dump will not be
performed on the initial timestep after the dump command is invoked,
if the current timestep is not a multiple of N. This behavior can be
changed via the <a class="reference internal" href="dump_modify.html"><em>dump_modify first</em></a> command, which
can be useful if the dump command is invoked after a minimization
ended on an arbitrary timestep. N can be changed between runs by
using the <a class="reference internal" href="dump_modify.html"><em>dump_modify every</em></a> command.</p>
<p>Dump <em>image</em> filenames must contain a wildcard character &#8220;*&#8221;, so that
one image file per snapshot is written. The &#8220;*&#8221; character is replaced
with the timestep value. For example, tmp.dump.*.jpg becomes
tmp.dump.0.jpg, tmp.dump.10000.jpg, tmp.dump.20000.jpg, etc. Note
that the <a class="reference internal" href="dump_modify.html"><em>dump_modify pad</em></a> command can be used to
insure all timestep numbers are the same length (e.g. 00010), which
can make it easier to convert a series of images into a movie in the
correct ordering.</p>
<p>Dump <em>movie</em> filenames on the other hand, must not have any wildcard
character since only one file combining all images into a single
movie will be written by the movie encoder.</p>
<hr class="docutils" />
<p>The <em>color</em> and <em>diameter</em> settings determine the color and size of
atoms rendered in the image. They can be any atom attribute defined
for the <a class="reference internal" href="dump.html"><em>dump custom</em></a> command, including <em>type</em> and
<em>element</em>. This includes per-atom quantities calculated by a
<a class="reference internal" href="compute.html"><em>compute</em></a>, <a class="reference internal" href="fix.html"><em>fix</em></a>, or <a class="reference internal" href="variable.html"><em>variable</em></a>,
which are prefixed by &#8220;<a href="#id9"><span class="problematic" id="id10">c_</span></a>&#8221;, &#8220;<a href="#id11"><span class="problematic" id="id12">f_</span></a>&#8221;, or &#8220;<a href="#id13"><span class="problematic" id="id14">v_</span></a>&#8221; respectively. Note that the
<em>diameter</em> setting can be overridden with a numeric value applied to
all atoms by the optional <em>adiam</em> keyword.</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 &gt; 6. This mapping can be changed by the
<a class="reference internal" href="dump_modify.html"><em>dump_modify acolor</em></a> command.</p>
<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 &#8220;dump_modify element&#8221; 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 &#8220;vx&#8221;, 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 &#8220;color map&#8221;, 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 &#8220;red&#8221; and &#8220;blue&#8221;, or
discretely so that the value of -3.2 is &#8220;orange&#8221;.</p>
<p>If &#8220;vx&#8221;, 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 &lt;= 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>atom</em> keyword allow you to turn off the drawing of all atoms, if
the specified value is <em>no</em>. Note that this will not turn off the
drawing of particles that are represented as lines, triangles, or
bodies, as discussed below. These particles can be drawn separately
if the <em>line</em>, <em>tri</em>, or <em>body</em> keywords are used.</p>
<p>The <em>adiam</em> keyword allows you to override the <em>diameter</em> setting to
set a single numeric <em>size</em>. 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>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 &gt; 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>
<p>The <em>line</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style line</em></a>
is used to define particles as line segments, and will draw them as
lines. If this keyword is not used, such particles will be drawn as
spheres, the same as if they were regular atoms. The only setting
currently allowed for the <em>color</em> value is <em>type</em>, which will color
the lines according to the atom type of the particle. 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 &gt; 6. There is not yet an option to
change this via the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command.</p>
<p>The line <em>width</em> can only be a numeric value, which specifies that all
lines 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>The <em>tri</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style tri</em></a> is
used to define particles as triangles, and will draw them as triangles
or edges (3 lines) or both, depending on the setting for <em>tflag</em>. If
edges are drawn, the <em>width</em> setting determines the diameters of the
line segments. If this keyword is not used, triangle particles will
be drawn as spheres, the same as if they were regular atoms. The only
setting currently allowed for the <em>color</em> value is <em>type</em>, which will
color the triangles according to the atom type of the particle. 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 &gt; 6. There is not yet an option to
change this via the <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a> command.</p>
<p>The <em>body</em> keyword can be used when <a class="reference internal" href="atom_style.html"><em>atom_style body</em></a>
is used to define body particles with internal state
(e.g. sub-particles), and will drawn them in a manner specific to the
body style. If this keyword is not used, such particles will be drawn
as spheres, the same as if they were regular atoms.</p>
<p>The <a class="reference internal" href="body.html"><em>body</em></a> doc page descibes the body styles LAMMPS
currently supports, and provides more details as to the kind of body
particles they represent and how they are drawn by this dump image
command. For all the body styles, individual atoms can be either a
body particle or a usual point (non-body) particle. Non-body
particles will be drawn the same way they would be as a regular atom.
The <em>bflag1</em> and <em>bflag2</em> settings are numerical values which are
passed to the body style to affect how the drawing of a body particle
is done. See the <a class="reference internal" href="body.html"><em>body</em></a> doc page for a description of what
these parameters mean for each body style.</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 &#8220;name&#8221; 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 &#8220;s&#8221; for static, then this conversion is done once,
at the time the dump command is issued. If <em>flag</em> is set to &#8220;d&#8221; 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
&#8220;up&#8221; 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>
<div class="highlight-python"><div class="highlight"><pre>up_internal = view cross (up cross view)
</pre></div>
</div>
<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> &gt;
1 will make the simulation box larger; a <em>zfactor</em> &lt; 1 will make it
smaller. <em>Zfactor</em> must be a value &gt; 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 &gt; 1 will create a highly skewed image with a large amount of
perspective.</p>
<div class="admonition note">
<p class="first admonition-title">Note</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 &lt;=
<em>sfactor</em> &lt;= 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
MPEG or other movie file you can use:</p>
<ul class="simple">
<li><ol class="first loweralpha">
<li>Use the ImageMagick convert program.</li>
</ol>
</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre>% convert *.jpg foo.gif
% convert -loop 1 *.ppm foo.mpg
</pre></div>
</div>
<p>Animated GIF files from ImageMagick are unoptimized. You can use a
program like gifsicle to optimize and massively shrink them.
MPEG files created by ImageMagick are in MPEG-1 format with rather
inefficient compression and low quality.</p>
<ul class="simple">
<li><ol class="first loweralpha" start="2">
<li>Use QuickTime.</li>
</ol>
</li>
</ul>
<p>Select &#8220;Open Image Sequence&#8221; under the File menu Load the images into
QuickTime to animate them Select &#8220;Export&#8221; under the File menu Save the
movie as a QuickTime movie (<a href="#id7"><span class="problematic" id="id8">*</span></a>.mov) or in another format. QuickTime
can generate very high quality and efficiently compressed movie
files. Some of the supported formats require to buy a license and some
are not readable on all platforms until specific runtime libraries are
installed.</p>
<ul class="simple">
<li><ol class="first loweralpha" start="3">
<li>Use FFmpeg</li>
</ol>
</li>
</ul>
<p>FFmpeg is a command line tool that is available on many platforms and
allows extremely flexible encoding and decoding of movies.</p>
<div class="highlight-python"><div class="highlight"><pre>cat snap.*.jpg | ffmpeg -y -f image2pipe -c:v mjpeg -i - -b:v 2000k movie.m4v
cat snap.*.ppm | ffmpeg -y -f image2pipe -c:v ppm -i - -b:v 2400k movie.avi
</pre></div>
</div>
<p>Frontends for FFmpeg exist for multiple platforms. For more
information see the <a class="reference external" href="http://www.ffmpeg.org/">FFmpeg homepage</a></p>
<hr class="docutils" />
<p>Play the movie:</p>
<ul class="simple">
<li><ol class="first loweralpha">
<li>Use your browser to view an animated GIF movie.</li>
</ol>
</li>
</ul>
<p>Select &#8220;Open File&#8221; under the File menu
Load the animated GIF file</p>
<ul class="simple">
<li>b) Use the freely available mplayer or ffplay tool to view a
movie. Both are available for multiple OSes and support a large
variety of file formats and decoders.</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre>% mplayer foo.mpg
% ffplay bar.avi
</pre></div>
</div>
<ul class="simple">
<li>c) Use the <a class="reference external" href="http://www.sandia.gov/~sjplimp/pizza.html">Pizza.py</a>
<a class="reference external" href="http://www.sandia.gov/~sjplimp/pizza/doc/animate.html">animate tool</a>,
which works directly on a series of image files.</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre><span class="n">a</span> <span class="o">=</span> <span class="n">animate</span><span class="p">(</span><span class="s">&quot;foo*.jpg&quot;</span><span class="p">)</span>
</pre></div>
</div>
<ul class="simple">
<li>d) QuickTime and other Windows- or MacOS-based media players can
obviously play movie files directly. Similarly for corresponding tools
bundled with Linux desktop environments. However, due to licensing
issues with some file formats, the formats may require installing
additional libraries, purchasing a license, or may not be
supported.</li>
</ul>
<hr class="docutils" />
<p>See <a class="reference internal" href="Section_modify.html"><em>Section_modify</em></a> of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.</p>
</div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>To write JPEG images, you must use the -DLAMMPS_JPEG switch when
building LAMMPS and link with a JPEG library. To write PNG images, you
must use the -DLAMMPS_PNG switch when building LAMMPS and link with a
PNG library.</p>
<p>To write <em>movie</em> dumps, you must use the -DLAMMPS_FFMPEG switch when
building LAMMPS and have the FFmpeg executable available on the
machine where LAMMPS is being run. Typically it&#8217;s name is lowercase,
i.e. ffmpeg.</p>
<p>See the <a class="reference internal" href="Section_start.html#start-2-4"><span>Making LAMMPS</span></a> section of the
documentation for details on how to compile with optional switches.</p>
<p>Note that since FFmpeg is run as an external program via a pipe,
LAMMPS has limited control over its execution and no knowledge about
errors and warnings printed by it. Those warnings and error messages
will be printed to the screen only. Due to the way image data is
communicated to FFmpeg, it will often print the message</p>
<div class="highlight-python"><div class="highlight"><pre>pipe:: Input/output error
</pre></div>
</div>
<p>which can be safely ignored. Other warnings
and errors have to be addressed according to the FFmpeg documentation.
One known issue is that certain movie file formats (e.g. MPEG level 1
and 2 format streams) have video bandwith limits that can be crossed
when rendering too large of image sizes. Typical warnings look like
this:</p>
<div class="highlight-python"><div class="highlight"><pre>[mpeg @ 0x98b5e0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x98b5e0] buffer underflow st=0 bufi=281407 size=285018
[mpeg @ 0x98b5e0] buffer underflow st=0 bufi=283448 size=285018
</pre></div>
</div>
<p>In this case it is recommended to either reduce the size of the image
or encode in a different format that is also supported by your copy of
FFmpeg, and which does not have this limitation (e.g. .avi, .mkv,
mp4).</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="dump.html"><em>dump</em></a>, <a class="reference internal" href="dump_modify.html"><em>dump_modify</em></a>, <a class="reference internal" href="undump.html"><em>undump</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The defaults for the keywords are as follows:</p>
<ul class="simple">
<li>adiam = not specified (use diameter setting)</li>
<li>atom = yes</li>
<li>bond = none none (if no bonds in system)</li>
<li>bond = atom 0.5 (if bonds in system)</li>
<li>size = 512 512</li>
<li>view = 60 30 (for 3d)</li>
<li>view = 0 0 (for 2d)</li>
<li>center = s 0.5 0.5 0.5</li>
<li>up = 0 0 1 (for 3d)</li>
<li>up = 0 1 0 (for 2d)</li>
<li>zoom = 1.0</li>
<li>persp = 0.0</li>
<li>box = yes 0.02</li>
<li>axes = no 0.0 0.0</li>
<li>subbox no 0.0</li>
<li>shiny = 1.0</li>
<li>ssao = no</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2013 Sandia Corporation.
</p>
</div>
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>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>

Event Timeline