Field Precision title

Making movies with the AMaze programs

You can create movies in AVI format with time domain programs in the 3D AMaze series. We are adding expanded capabilities to the initial-value solution programs and postprocessors to generate sequences of BMP plot files, either autonomously or under direct user control. Several types of animations are possible with the finite-element solutions:

  1. Showing the time evolution of calculated quantities in HeatWave (dynamic mode) and Aether (pulse mode).
  2. Generating a large set of solutions under script control to show the effect of parametric variations, either in geometry or material properties.
  3. Illustrating the three dimensional nature of a solution by a set of slice plots (walking through the solution space along an axis).
  4. Moving around a three-dimensional space to show complex objects.
  5. Following a slice in a 3D view of a solution space to show the variation of calculated quantities.

There are many other possibilities, giving free reign to the user's imagination.


Figure 1. New dialog to initiate plot files.

This post describes some recent, related developments. To begin, we have improved commands to generate graphics files of currently-displayed plots in the interactive environments of the AMaze postprocessors. The PLOTFILE command (which may be invoked from the PLANEPLOT, SLICEPLOT and SURFACEPLOT menus) brings up the dialog shown in Figure 1. The user supplies a unique file prefix and chooses the output format. The default BMP format is preferred because there is no loss of information and files may be incorporated directly into animations. The dialog gives common choices of image size. The user may also set a custom size by specifying the pixel dimensions. Depending on the resolution, the resulting image files may have considerably better quality than the screen display. Here is an example at 640 × 480 resolution:


Figure 2. Illustration created with the PLOTFILE command.

A second development enables automatic generation of images under script control. We have added a new command to analysis scripts for AMaze postprocessors:

INPUT TARGET.HOU
PLOT PlotTest TargetPlot 1024 768
INPUT WALKTHRU.HOU
PLOT PlotTest WalkThruPlot 1024 768
ENDFILE

The first command loads the solution file TARGET.HOU. The second command creates a plot file TARGETPLOT.BMP with pixel dimensions 1024 × 768. The plot parameters are defined by the saved view PLOTTEST.FPV.

With the PLOT command, it is relatively easy to generate movies automatically. To illustrate, I wrote a Perl template to create the fifth type of animation listed above, a moving slice display of a electrostatic potential in a 3D solution space. Here is a link to the script: make_movie.pl.txt. The txt suffix was added to avoid download problems.

I built a sample movie from a HiPhi electrostatic solution with the following steps:

  1. Load the solution file in PhiView and experiment to define a good three-dimensional surface plot.
  2. Save the view as TEMPLATE.FPV. With an editor, change the numerical value of SurfacePlanePos to the marker "@".
  3. Run movie_maker.pl to create 100 sequential BMP files. The Perl script walks along the z axis of the solution space, modifies the value of SurfacePlanePos in a temporary view file TEMP.FPV, writes a script that includes the PLOT command with the current BMP file name, and executes PhiView.
  4. Use CECIL_B to assemble the BMP files into an animation at 25 frames/second.

The whole process took a couple minutes. Here's the finished product (I added the title and transition with Camtasia):


LINKS