LC FAQ: How to create animation

Introduction

Cut Microstrip Model

Cut microstrip with matching SPICE circuit

There are several ways to create animated sequences to visualize the electromagnetic fields from a simulation. The basic visualization tool is a clip plane. The field values in a plane are displayed colors, with red as the largest value and blue as the smallest. Lines, however, are displayed as an X-Y plot, with the field values changing the shape of the curve in an animated fashion.

The animation can also be saved and displayed in a number of different ways. The animation can be displayed as the simulation progresses, which provides an excellent view of how the model is interacting with the excitation, or the probe output values can be saved to a set of files to be viewed later. By saving the probe values, a simulation can be run in batch, then the analysis of the results done later. It also provides a way to convert the animation into formats other than the ones directly supported by LC.

Line Plots

A line probe collects data along a line through the simulation grid. Sampling is done every Time Factor number of time steps and at every Space Factor number of grid points. The defaults for Time Factor and Space Factor are 1, meaning that the probe value is sampled at every time step and at every grid point.

If Plot is selected for the line probe, then an animated X-Y plot of the probe values is displayed as the simulation progresses. If Save is selected, then the values are written to the output file in LCPLot format. This saved plot data can be displayed by selecting the line probe from the Plot Probes dialog, and can be played back as an animation by pressing the Play button from the Select Plots dialog brought up from the View menu. Unfortunately, this animated playback cannot be saved into a movie file.

Ok, so if LC can't save a line probe as a movie file, then how was the animation shown here created? With difficulty! What I did was run the cut microstrip with matching SPICE circuit model in LC, saving the microstrip voltages with a line probe. Then I plotted the resulting LCPlot file, displaying each saved time step, saving each image to a file manually. I used Eddie Kohler's Gifsicle to combine the saved images into an animated GIF. John Cristy's ImageMagick is indispensible for converting image formats and optimizing images.

Plane Plots

A plane probe is a simple and natural way to view the field values inside a model. Like a line probe, the sampling rate and density are controlled by the Time Factor and Space Factor parameters. Plane probes can be saved as raw field values using the Movie.BYU file format, or as a scaled color-shaded image if one of the other file formats (such as GIF or RGB) is selected.

The advantage of the Movie.BYU format is that LC can read this format back in via the Plot Probes dialog. If a plane probe animation is played back with Plot Probes, the probe visualization parameters Range Min, Range Max, Range Noise, Visual Form, and Colors can be varied to highlight electromagnetic effects otherwise difficult to see with the default image color scaling.

In addition, the Image Scale parameter is a scale factor for plane probes saved into an image file format (any of the file formats except Movie.BYU). The default Image Scale of 1 saves each field value as a 1x1 pixel cell. A larger Image Scale will increase the cell size by that factor. For example, an Image Scale of 3 will make each cell 3x3 pixels, resulting in an output file nine times larger.

Post-Processing With Ensight

The Movie.BYU output format used by LC is compatible with Ensight, a scientific data visualization program from CEI. The geometry and result files required by Ensight is automatically created by LC when a probe is saved in Movie.BYU format. The geometry filename is the probe name with a ".byu" extension, and the result filename is the probe name with a ".result" extension. Be sure to specify Movie format for the geometry file format in Ensight.

Making an Animated GIF File

LC can create animated GIF files directly. Just specify the probe output format as GIF, then set the Output File to a name which does not contain asterisk (*) characters. If asterisks are present, LC takes this name as a pattern, and substitutes sequence numbers for the asterisk characters. If asterisks are not present, then LC saves to the filename given, placing each saved image into the same file, formatted as animated GIF.

Making a Quicktime or SGI Movie

To make a Quicktime-format movie, start with RGB images saved from a plane probe, then use the makemovie command:

    makemovie -f qt -c jpeg -o output_file.mov *.rgb

Making an MPEG Movie

To make an MPEG-format movie, start with RGB-format images saved from a plane probe, then use the dmconvert command:

    dmconvert -f mpeg1v -p video probe###.rgb output_file.mpeg

The probe###.rgb command line parameter is a filename pattern. The dmconvert command searches for files which match the pattern given, replacing the sharp (#) characters with a sequence number. This filename pattern is similar to the one specified in LC as a pattern for the RGB output files, except LC uses the asterisk (*) character to denote the sequence number field, instead of the sharp.

Playing Movie Files

On IRIX, the mediaplayer command (also known as movieplayer) is available as a stand-alone movie-playing program for MPEG, Quicktime, SGI Movie, and AVI files. imgview works with animated GIF files: use the Select Frame dialog from the Edit menu, then choose Auto in the Sub-image control area. Web browsers like Netscape or Internet Explorer can handle many movie file formats, either natively or through a plug-in extension.

Example Files

Additional Documentation


LC Home
Copyright © Cray Inc.
Maintained by Kevin Thomas (kjt@cray.com).
Last modified Wed Oct 13 09:16:25 CDT 1999