how to make a movie using lammps simulation results

Hello Lammps users,

I want to make a movie from my simulation results and below I
described what I manage to do and what not. there a lot of
applications, data formats and options one can use,
so it is not very easy task. I would be very thankful if you answer
some open questions in the text below.
I simulate flow of cells in complex geometries, each cell is
represented using bonds, angles, and dihedrals. What I want to have is
a movie of moving meshes, preferably with geometry of walls.
Applications and data formats I tried:

Applications: Paraview, VMD, OVITO.
Available walls formats: hdf5, vtk (both can be opened in Paraview).
Available lammps output formats: restart, dump, xyz, vtk (can convert
using pizza), data (convert using restart2data).

1. Paraview.
a) Convert dump file in a vtk file using test_vtk.py from pizza.
Problems: The output is file with all points from all frames together
so Paraview can’t make a movie out of it. Dump file doesn’t contain
information about bonds,
thus it is impossible to visualize cells as surfaces.
b) Convert restart files into data files, then data files to vtk using pizza.
Problems: No bonds again. I don’t know how to create frames from many
vtk files using paraview (do you know how to do that?).
c) Use xyz data format, open as XMoL in Paraview.
Problems: It looks like paraview creates bonds automatically, without
using bond information (which is, I suppose, not available in this
format anyway).
d) Open data/dump files in paraview directly.
Problems: this features doesn’t work. I use vtk-5.10, paraview 3.14.
Asked in the paraview mailing list.

2. VMD.
Convert a restart file into a data file, open it in VMD and do pbc,
then save it as a picture.
Problems: Is it possible to automate the process? In case if I have
many data files “my.data.*” and want to apply pbc, then create a
picture for every one using specified view point.

3. OVITO
Can visualize dump files. Only atomic data files are supported, so is
not really useful for my task.

Summarizing, I didn’t find a way to visualise cells represented using
bonds in Paraview;
VMD can visualize meshes but I don’t know how to automate the process
in order to create a movie out of many data files (perhaps, somehow
using pizza, but I couldn't manage to find the right way).

I'm not a Paraview or VMD expert, but here are a few comments.

LAMMPS has a dump local command which can dump bond
info as often as you like. So that info is available if your
post-proecessing can merge it with coordinate info.

LAMMPS has a dump image capability to dump JPG images
which can include bond info. Of course it is not as flexible
as a post-processing visualization package. But if you
can get images you like, then a movie is as simple as concatenating
JPG files.

If you can figure out how to get any of these packages to make
a single image that is what you want with merge atom, bond, wall
info (not sure what you mean by meshes), then it is often simple
to write a Python wrapper that will automate the process for
generating multiple frames. Both VMD and ParaView can be scripted,
using their own scripting language, or driven externally by a Python program.

Ensight is a another program you can look at that handles particles
and FE meshes.

Steve

Hello Lammps users,

I want to make a movie from my simulation results and below I
described what I manage to do and what not. there a lot of
applications, data formats and options one can use,
so it is not very easy task. I would be very thankful if you answer
some open questions in the text below.

i disagree. it *is* an easy task and a *lot* of people
have done it. you must be taking instructions too
literal or having problems to transfer specific instructions
for one simulation software package to another.

[...]

i can only comment on VMD, since i am using
and developing for and with it a lot.

2. VMD.
Convert a restart file into a data file, open it in VMD and do pbc,
then save it as a picture.
Problems: Is it possible to automate the process? In case if I have
many data files “my.data.*” and want to apply pbc, then create a
picture for every one using specified view point.

have you bothered to read the VMD user's guide?
and gone through the tutorials?

data files are not the only way how to feed information to VMD.
since VMD was designed for visualizing classical MD, it is
perfectly suited for many LAMMPS simulations. the typical
way how simulation data in VMD is animated is to use a .psf
file (with the topology information) and one or more .dcd files
(with the coordinate information). LAMMPS can produce the
latter natively and also LAMMPS atom style and custom
style dump files are supported (as are xtc and xyz and everything
else that is supported in the USER-MOLFILE package).

the .psf is a bit trickier, but you have the topology (=bonding)
information already in your data file which can be imported
through topotools and then you can reconstruct a .psf. check out:
http://sites.google.com/site/akohlmey/software/topotools/topotools-tutorial---various-tips-tricks#TOC-Reconstruct-a-.pdb-.psf-files-from-a-LAMMPS-data-file-for-use-with-visualization-programs

on top of the VMD has a movie maker plugin that allows
to use either snapshots or high-quality raytracers to render
high-quality and (if desired and properly scripted) high-resolution
movie files. you can see some examples (all done from LAMMPS
or HOOMD simulations using VMD) here.

http://sites.google.com/site/akohlmey/images-and-movies

axel.

Hello Lammps users,

I want to make a movie from my simulation results and below I
described what I manage to do and what not. there a lot of
applications, data formats and options one can use,
so it is not very easy task. I would be very thankful if you answer
some open questions in the text below.

i disagree. it *is* an easy task and a *lot* of people
have done it. you must be taking instructions too
literal or having problems to transfer specific instructions
for one simulation software package to another.

Indeed. I can back this up. With vmd, topotools (and pbctools), it
is not very hard.

If it helps, I attached some quick notes/instructions I made to remind
myself how to do this. (Shorter than reading the VMD manual, but so
are Axel's tutorials. Warning: This file is not even spell-checked.
I've posted it before. Do check the Axel's tutorials as well.)

I did not include instructions how to use movie-maker to generate the
movies, but hopefully you can figure it out. (From the VMD menu,
select Extensions->Visualization->MovieMaker. In addition to making
movies, movie-maker can also generate individual image files which you
can stitch together using gimp-gap or some other utility.)

Cheers
Andrew

[...]

i can only comment on VMD, since i am using
and developing for and with it a lot.

2. VMD.
Convert a restart file into a data file, open it in VMD and do pbc,
then save it as a picture.
Problems: Is it possible to automate the process? In case if I have
many data files “my.data.*” and want to apply pbc, then create a
picture for every one using specified view point.

have you bothered to read the VMD user's guide?
and gone through the tutorials?

data files are not the only way how to feed information to VMD.
since VMD was designed for visualizing classical MD, it is
perfectly suited for many LAMMPS simulations. the typical
way how simulation data in VMD is animated is to use a .psf
file (with the topology information) and one or more .dcd files
(with the coordinate information). LAMMPS can produce the
latter natively and also LAMMPS atom style and custom
style dump files are supported (as are xtc and xyz and everything
else that is supported in the USER-MOLFILE package).

the .psf is a bit trickier, but you have the topology (=bonding)
information already in your data file which can be imported
through topotools and then you can reconstruct a .psf. check out:
http://sites.google.com/site/akohlmey/software/topotools/topotools-tutorial---various-tips-tricks#TOC-Reconstruct-a-.pdb-.psf-files-from-a-LAMMPS-data-file-for-use-with-visualization-programs

on top of the VMD has a movie maker plugin that allows
to use either snapshots or high-quality raytracers to render
high-quality and (if desired and properly scripted) high-resolution
movie files. you can see some examples (all done from LAMMPS
or HOOMD simulations using VMD) here.

http://sites.google.com/site/akohlmey/images-and-movies

Nice

README_visualise.txt (2.41 KB)

What I want to have is
a movie of moving meshes, preferably with geometry of walls.

i disagree. it *is* an easy task and a *lot* of people
have done it. you must be taking instructions too
literal or having problems to transfer specific instructions
for one simulation software package to another.

I read the initial question to be asking what software
can display both atoms and a "mesh", where the bonds
(e.g. on the surface of a cell model) were visualized as a
triangullar, colored mesh, or ditto for walls in the model.

Thus I thought he was asking for viz packages that can
do both particles and finite-element style meshes.

I don't know if VMD does that, but packages like ParaView
can. They're actually better at mesh data than they
are at particle data.

But you will have to massage LAMMPS output into a format
suitable for both particle and mesh input to such a viz package.

Steve

What I want to have is
a movie of moving meshes, preferably with geometry of walls.

i disagree. it *is* an easy task and a *lot* of people
have done it. you must be taking instructions too
literal or having problems to transfer specific instructions
for one simulation software package to another.

I read the initial question to be asking what software
can display both atoms and a "mesh", where the bonds
(e.g. on the surface of a cell model) were visualized as a
triangullar, colored mesh, or ditto for walls in the model.

Thus I thought he was asking for viz packages that can
do both particles and finite-element style meshes.

based on the description of the procedure for
the various package, it seemed the use of the
word "mesh" was misleading.

I don't know if VMD does that, but packages like ParaView
can. They're actually better at mesh data than they
are at particle data.

at least for the VMD section, the question was how to
automate the procedure of handling multiple frames.
the only option considered was using restart files,
and the complaint was that this was too tedious unless
it can be automated. in fact, it could be automated, but
loading a suitable dump file would solve that problem.

But you will have to massage LAMMPS output into a format
suitable for both particle and mesh input to such a viz package.

yup, and i don't quite see where it would be coming from.
that being said, one can also create arbitrary triangulated
surfaces and meshes in VMD; only one has to use the
corresponding graphics primitives. i have recently written
a small subroutine, which could be used to visualize
ellipsoids, for example...

cheers,
     axel.