Chapter 15: Animation

Go to the Next Chapter
Go to the Previous Chapter
Go to the Table of Contents for This Manual
Go to the Guides Master Index

Chapter 1 * Chapter 2 * Chapter 3 * Chapter 4 * Chapter 5 * Chapter 6 * Chapter 7 * Chapter 8 * Chapter 9 * Chapter 10 * Chapter 11 * Chapter 12 * Chapter 13 * Chapter 14 * Chapter 15 * Chapter 16 * Chapter 17 * Chapter 18 * Chapter 19


15.1 Animation Overview

Animation is a valuable tool for graphically interpreting many analytical results, including nonlinear or time-dependent behavior. The ANSYS program provides tools that enable you to animate any type of display.

Many workstations, PCs, and some terminals having local segment memory support animation. However, some hardware platforms do not support online animation well (or at all). An alternative to online animation is to capture a sequence of images off-line, frame by frame, on film or videotape. Be aware, though, that recording animation off-line is not a trivial matter, and generally involves specialized equipment, custom programming, and specially-trained personnel.

15.2 Creating Animated Displays Within ANSYS

The easiest way to perform animation in the ANSYS program is to use the functions available under Utility Menu>PlotCtrls>Animate. These GUI functions allow you to achieve "push-button animation" effects in ANSYS. The GUI functions internally execute ANSYS animation commands, which you can type in directly if you prefer. Procedures for using commands are discussed next. See Chapter 16 for information on viewing animated sequences in the stand-alone DISPLAY program.

15.3 Using the Basic Animation Commands

You can display several frames in rapid succession to achieve an animation effect, via these commands:

Command(s):

GUI:

Utility Menu>PlotCtrls>Redirect Plots>Delete Segments
Utility Menu>PlotCtrls>Redirect Plots>Segment Status
Utility Menu>PlotCtrls>Redirect Plots>To Segment Memory
(UNIX)
Utility Menu>PlotCtrls>Redirect Plots>To Animation File
(Windows)
Utility Menu>PlotCtrls>Animate>Replay Animation
Utility Menu>PlotCtrls>Animate>Replay

The /SEG command allows you to store graphics data in the terminal's local "segment" (graphics operation) or "pixmap" (screen dot) memory (which may or may not be available, depending on the type of graphics device you are using). The storage occurs at the same time that a graphics action command produces a display. You can then use the ANIM command to display the stored frames in a sequence. A typical command stream for animation would look like this:

/SEG,DELE	! Deletes all currently stored segments
/SEG,MULTI	! Stores subsequent displays in segment memory
	...	! Plot-creation commands to generate a sequence of images
	...	! (See below for options)
/SEG,OFF       	! Turns off the frame-capture function
ANIM,15	! Cycles through the stored sequence 15 times
To create the series of frames for your animation sequence, you can either issue a frame-by-frame series of graphics action commands, or you can invoke a predefined ANSYS macro to automatically generate the sequence. The predefined macros are ANCNTR, ANCUT, ANDATA, ANDSCL, ANFLOW, ANISOS, ANMODE, ANTIME, and ANDYNA.

The available amount of local segment or pixmap memory, and the memory requirements of each frame limit the number of frames you can include in an animated sequence. On most workstations and PCs, the amount of memory required depends on the number of pixels (for example, screen dots) in each frame. On X-window devices, reducing the size of your graphics window reduces the number of pixels, yielding a longer achievable animation run.

The following sample input illustrates how to animate particle flow tracing using a frame-by-frame series of graphics action commands. The PLTRAC command or Main Menu>General Postproc>Plot Results>Plot Flow Tra produces such particle flow displays for CFD analyses. The PLTRAC command or Main Menu> General Postproc>Plot Results>Particle Trace produces charge particle trace displays for electromagnetic field analyses. The animation macros often are more convenient for animating certain types of sequences. However, only ANFLOW supports particle flow and charged particle tracing.

15.4 Using "One-Step" Animation Macros

A better alternative to the basic animation commands discussed above is to use specialized "one-step" animation macros.

ANDYNA, while still supported by ANSYS, has been replaced by the ANDATA macro.

15.5 Capturing Animated Display Sequences Off-Line

In this procedure, you produce graphics images one at a time, photographing or video-recording them frame by frame. Among this technique's advantages is the fact that when you capture an animated sequence one frame at a time, there is generally no limit on its complexity, and performance does not degrade with increasing numbers of entities.

In general, producing high-quality graphics video recordings is a job for multi-media experts with specialized equipment. Capturing a sequence of individual frames on video requires three separate pieces of equipment:

In addition to specialized hardware requirements, some custom software is also needed for video recording. The /SYS command in ANSYS provides the programming interface between the ANSYS program and these special systems, allowing video system commands to be integrated into your ANSYS session.

Another hardware solution for animation is capturing single frames onto film, using a device known as a film recorder. As with video frame-capture equipment, images are saved onto film under software control. The best of these devices can be expensive, and custom programming may be involved in using them.

A relatively low-cost approach to film recording involves the use of a stationary camera shooting individual frames from a graphics display. These frames are then processed as the individual frames of a film. The resources of photographic technicians are often required to turn still images into acceptable-quality moving film.

15.6 Animation in the Windows Environment

The ANSYS and DISPLAY programs on Windows platforms use the Microsoft standard AVI file format to store animation frames (video only) of ANSYS graphics. The ANSYS program's support for AVI files is described next.

15.6.1 How ANSYS Supports AVI Files

In ANSYS, animation capabilities are split among the options in the Utility Menu> PlotCtrls GUI path and the animation macros described earlier in this chapter. If you are animating a deformed shape or different mode shapes of your analysis, the program stores the animation frames in a file called Jobname.AVI, where Jobname is the jobname for the current ANSYS session. After completing this step, ANSYS starts Media Player (located under Accessories). This application has a control panel that closely resembles the controls of a videocassette player.

If you wish to animate contours, ANSYS displays a dialog box from which you can choose animation options. After you supply this data, ANSYS generates the frames and Media Player displays them.

The Replay animation option starts Media Player. If you have stored an animation sequence during the current ANSYS session, the filename associated with it is supplied to Media Player automatically.

You can animate other quantities, or do animation in other parts of ANSYS, via the /SEG command. You can access this command directly through the ANSYS Input Window or Utility Menu>PlotCtrls>Redirect Plots.

15.6.2 How DISPLAY Supports AVI Files

If you have stored a series of graphics in an ANSYS graphics file, you can create an animation file of these in the DISPLAY program.

Start the DISPLAY program and choose Display>Animate>Create on the menu bar. The following dialog box appears.

Figure 15-1 The ANSYS DISPLAY program and the Create Animation Sequence dialog box

Specify the plots to be used during the animation in the File Name box and the delay time in seconds in the Time Between Frames box. For example, if your Jobname.GRPH file contains 20 plots and you wish to use every other plot in your animation, select 1 (for the beginning plot), 20 (for the end plot), and 2 (for the increment). The Create function stores your animated sequence in the default file ANIM.AVI.

To replay your animation, use the Playback option, which starts Media Player.

Note-If you are doing animation from an AVI type program on an ANSYS animation file, make sure that the graphics window size of the AVI setting is set to "Original Size." To check the setting for window size, click on the AVI icon and click on SETTINGS. You can change the window size here, if necessary.

15.6.3 Other Things You Can Do with AVI Files

While you are in Media Player, you can use Media Player's OLE (Object Linking and Embedding) to export your ANSYS animation to other applications. You do this through the "Copy" option under the Edit Menu. Then, you can embed the animation in another OLE-compliant application. For example, you can embed ANSYS animation objects in Microsoft Write (for NT), Microsoft Word, or Microsoft Excel.

Once an object is embedded on an application, you can just double-click on the object to start playing back your ANSYS animation sequence. To share your compound document with others, give them the Jobname.AVI file you created in ANSYS or DISPLAY plus a copy of the file containing the embedded animation sequence.


Go to the beginning of this chapter