Making Atomistic Movies using AtomEye
This example shows how to use output from the molecular dynamics code LAMMPS with AtomEye and ImageJ in order to create an animated movie. This example will reference the scripts and data of the Uniaxial Compression in Single Crystal Aluminum example. This assumes that AtomEye and ImageJ are already downloaded.
Author(s): Nathan R. Rhodes, Mark A. Tschopp
In order for LAMMPS to output data useful for making an animation, one must set up a dump file with the desired data in the LAMMPS input script. Near the end of the LAMMPS script, use the 'dump' command in order to output desired data to a cfg file for use in AtomEye. The following lines create a dumpfile for every atom in the simulation every 250 timesteps, and each file is named according to its associated timestep. Then, the file is specified to show, for each atom, the atom ID, atom type, scaled atom coordinates, previously computed centrosymmetry and potential energy variables, and forces upon each atom. The 'dump_modify' command specifies the element as Aluminum, in this case.
# Use cfg for AtomEye dump 1 all cfg 250 dump.comp_*.cfg id type xs ys zs c_csym c_peratom fx fy fz dump_modify 1 element Al
An example dumpfile is displayed below. This is the initial dumpfile from the Uniaxial Compression example with 4,000 atoms at 300 K.
Number of particles = 4000 A = 1.0 Angstrom (basic length-scale) H0(1,1) = 40.6491 A H0(1,2) = 0 A H0(1,3) = 0 A H0(2,1) = 0 A H0(2,2) = 40.6491 A H0(2,3) = 0 A H0(3,1) = 0 A H0(3,2) = 0 A H0(3,3) = 40.6491 A .NO_VELOCITY. entry_count = 8 auxiliary = csym auxiliary = peratom auxiliary = fx auxiliary = fy auxiliary = fz 26.982 Al 0.0493442 0.0581882 0.00323696 1.58804 -3.34266 0.196691 -0.804728 -0.0280286 0.0987502 0.00417997 0.00238952 0.827133 -3.34273 -0.475844 -0.270217 -0.120716 0.0989802 0.0523976 0.0521907 0.363772 -3.30304 -0.309005 -0.274515 -0.299433 ...
|* Visualize the dumpfile in AtomEye by typing the following command, "/A dump.tensile_0.cfg" (UNIX).
- Open ImageJ
- Drag the folder created by AtomEye (Jpg) into ImageJ.
- Select "Convert to RGB" to keep the color from the AtomEye images.
- Choose "yes" to load a stack.
- Adjust the size as needed (Image/Adjust/Size)
- Adjust frame rate as desired (Image/Stacks/Animation Options)
- Save as Animated Gif file