Chapter 8: Getting Started with Graphics
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
8.1 Overview
The ANSYS program (and the associated DISPLAY program) enable you to
portray almost any aspect of your model in pictures or graphs that you can view
on your terminal screen, store on a file, or plot out as hard copy. ANSYS has
numerous features to enable you to customize or enhance your graphics displays
to suit your individual needs.
8.2 Interactive Versus "External" Graphics
Any discussion of graphics might seem to imply that you are running the ANSYS
program interactively and viewing graphics images on your terminal screen. For
the most part, this chapter is written for such a scenario. However, you can run
the ANSYS program in either interactive or batch mode and store graphics images
on a file for later viewing and processing. This process is called creating external
graphics. Chapter 16 discusses the procedures for external graphics.
Chapter 9 through Chapter 15 pertain to obtaining graphics
displays interactively on your screen.
8.3 Identifying the Graphics Device Name (for
UNIX)
When using the ANSYS program, one of the first things you must do is specify the
graphics device name (sometimes referred to as the graphics driver). ANSYS
requires this information to properly direct graphics instructions to your display
device. The default graphics device name for most systems is X11. You can
change it from X11 to, say, 3D if you have a 3-D graphics device for running
ANSYS.
You must define the graphics device name before you activate the Graphical User
Interface (GUI). Once you have activated the GUI, you cannot change graphics
device names. Refer to the ANSYS Operations
Guide for more information about using the GUI.
The best way to identify the graphics device name is to do so directly at program
start-up. The ANSYS launcher includes an entry option for graphics device name
under Interactive Set Up. By defining the graphics device name at start-up, you
can activate the GUI immediately upon entering the ANSYS program.
Alternatively, you can specify the graphics device name using /SHOW command once you have entered the
program (but before you have activated the GUI).
8.3.1 Graphics Device Names Available
X11 (or X11C) and 3D are common graphics device names supported by the
ANSYS program. Each of these are described briefly below.
Graphics Device Name = X11: The X11 graphics driver incorporates X-a
distributed windowing system developed at Massachusetts Institute of Technology
that a variety of platforms support. It provides 2-D graphics capability. The
ANSYS program currently supports Version 11 (thus, "X11") Release 6 of the
X-Window system.
X separates the functionality of traditional graphics systems into two parts: the X
server and the X client. The server is the part of the system that controls the
physical display device. A client is a piece of application software, such as the
ANSYS or DISPLAY programs. A single server may respond to multiple clients.
The server and client may reside on different machines connected to a network.
X transparently handles all communication between server and client.
Graphics Device Name = X11C: On 2-D display devices that have more than 16
colors (more than four graphics bit planes; usually eight), the ANSYS program
displays the model using light-source shading. Light-source shading means that
when the model is viewed obliquely, the display appears to be three-dimensional.
You can activate the extra colors using the NCPL field on the /SHOW command (Utility
Menu>PlotCtrls>Device Options).
These devices also offer a 128-contour color option ("C-option"). This option
allows contour displays to use the extra colors by adding more colors with a single
intensity each. By default, the extra colors are used to display nine contour colors
with varying intensities that simulate light-source shading. You activate the
128-contour color option by using X11C for the graphics device name on the /SHOW command.
Individual items can also be selected and displayed with varying degrees of
translucency on 2-D devices. Translucent items will show black on the initial
replot, since the 2-D driver generates only the visible face. The /SHRINK command (Utility
Menu>PlotCtrls>Style>Translucency) will force the hardware to plot all of the
faces and provide the desired translucent effect.
Graphics Device Name = 3D: If you have a 3-D graphics device, you should
specify 3D as the graphics device name. A 2-D device contains a "flat" 2-D
projection of your model (image manipulation is performed in software), but a 3-D
device contains a 3-D model in its local memory (image manipulation is
performed by the display hardware). As a result, 3-D devices perform certain
graphics functions in ANSYS more efficiently, and 2-D devices do not support
certain functions. The 3-D functions in ANSYS include "real-time" dynamic
transformation (rotation, translation, etc.) of your actual model, translucency, and
control of various lighting options, including reflectance, intensity, light direction,
and shading. If you are using a 3-D device, you can set certain display option
modes using the /DV3D command (Utility
Menu>PlotCtrls>Device Options).
8.3.2 Graphics Drivers and Capabilities Supported on UNIX
Systems
The table below lists the 3-D graphics drivers and capabilities that ANSYS
supports in various UNIX environments. The supported capabilities are noted with
a Y in the driver column:
Table 8-1 ANSYS-Supported 3-D drivers and capabilities for UNIX
|
|
DEC
OpenGL
|
HP
Starbase
|
HP
OpenGL
|
IBM
OpenGL
|
SGI
OpenGL
|
Solaris
XGL
|
| Window Device
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| Hot Keyboard/Mouse
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| 3-Button Mouse
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| Remote Network Access
|
Y1
|
-
|
Y
|
Y
|
Y
|
-
|
| Hidden Line Removal
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| Translucency
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| Light Source Shading
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| 3-D Local Transformations
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| Double Buffering
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
| Degenerate Mode
|
Y
|
Y
|
Y
|
Y
|
Y
|
Y
|
1. Remote Network Access is restricted to systems that support OpenGL.
8.3.3 Graphics Device Types Supported on UNIX Systems
The table below summarizes the graphics device types that ANSYS supports in
various UNIX environments:
Table 8-2 ANSYS-Supported graphics device types (for UNIX)
| Platform
|
Device
|
Description
|
| Digital Alpha (Digital UNIX), HP,
IBM, SGI, Sun SPARC (Solaris)
|
X11 or x11
X11C or x11c
|
X11 Color
X11 Color contour
|
| Digital Alpha (Digital UNIX)
|
3D or 3d
|
3-D OpenGL Graphics
|
| HP
|
3D or 3d
og 1.l
|
3-D Starbase Graphics
3-D OpenGL Graphics
|
| IBM
|
3D or 3d
|
3-D OpenGL Graphics
|
| SGI
|
3D or 3d
|
3-D OpenGL Graphics
|
Sun SPARC (Solaris)
Sun UltraSPARC
|
3D or 3d
3D or 3d
|
3-D XGL Graphics
3-D OpenGL Graphics
|
1. Separate executable for OpenGL support
8.3.3.1 Unsupported Graphics Devices
The ANSYS program does not fully support the following graphics display devices:
- Tektronix 4xxx
- Digital VT 240/340.
Although these devices are still valid for the ANSYS /SHOW command, you cannot use them to
access the ANSYS menu system, to pick items on graphics displays, or to access
ANSYS online help.
8.3.4 Graphics Environment Variables
The following table lists the environment variables you can set before executing
the ANSYS program or the DISPLAY program. Setting these variables alters the
behavior of the X11 device driver and (where explicitly stated) also modifies 3-D
graphics behavior.
Table 8-3 Graphics environment variables
| Environment
Variable
|
Affected
Driver
|
Description/Example
|
| ANSFONT
|
X11, 3-D
|
Selects a particular font.
|
| ANSCWID
|
X11, 3-D
|
Normal ANSYS text size (percentage of standard size)
setenv ANSCWID 120
|
| ANSCWID2
|
X11, 3-D
|
Small ANSYS text size such as node numbers (percentage of
standard size), for instance:
setenv ANSCWID2 120
|
| ANSCURS
|
X11
|
Select cursor style; for example:
setenv ANSCURS 22
|
| ANSCREV
|
X11
|
Reverse cursor color. Used only when
ANSCURS is set.
|
| ANSVIS
|
X11
|
ANSYS visual key; instructs ANSYS to use a specific visual.
|
| ANS_SNGLBUF
|
3-D
|
Disables double buffering. Applies to HP and SGI 12-bit plane
systems only.
|
8.4 Specifying the Graphics Display Device
Type (for Windows)
For Windows users, ANSYS supports these drivers and capabilities:
A window device
Hot keyboard/mouse
Two- or three-button mouse
Hidden line removal
Light source shading.
Note-On a two-button mouse, the shift-right button functions like the middle
button of a three-button mouse.
If you are running the program on Windows platforms, you have three alternatives
for specifying the graphics device type:
- Double-click on the Interactive icon in the ANSYS Program Folder. Click
on the down arrow next to "Graphics device name" and choose the
appropriate device.
- Within the ANSYS program, issue the ANSYS /SHOW command (Utility
Menu>PlotCtrls>Device Options).
- Include the device type on the ANSYS execution command line. The
command option -d or -D must precede the device type, as shown below:
ansys55 -d device_type
The device type is one of the following:
We recommend using a color setting higher than 256 colors.
Specifying an invalid device type causes ANSYS to divert the graphics to a
disk file and inhibits the opening of the ANSYS menu system, even if you
included the -g option on the ANSYS execution command.
8.5 System-Dependent Graphics Information
This section describes factors affecting how ANSYS graphics display on different
hardware systems. You should read this information before you activate the
ANSYS graphical user interface.
8.5.1 Adjusting Input Focus
To enable the display, meshing, and listing interrupts to work correctly, you must
set the input focus in the text window from which the ANSYS program is
executing. You can set the focus in either of two ways:
- Position the mouse pointer within the text window. (Use this method only if
the window manager sets the focus automatically.)
- Place the mouse pointer on the text window and click the mouse button.
8.5.2 Deactivating Backing Store
When you are using the X11 graphics driver on Sun SPARC systems, backing
store is turned on by default. For faster graphics response turn backing store off
by issuing the command shown below:
setenv ANSBACK 0
8.5.3 Setting Up IBM RS/6000 Sabine Graphics Adapters
For 3-D OpenGL, initialize the window manager using the command below:
xinit -- -x abx -x mbx -x glx
3-D OpenGL does not apply to Sabine, GT4E, and GT0 graphics adapters.
8.5.4 Displaying X11 Graphics over Networks
You can display X11 graphics within the ANSYS program over the network if the
following conditions exist:
- All computer systems have X11 software installed.
- The ANSYS program is linked with the X11 driver.
- A /SHOW device type of x11 or x11c
is used. (You can use either uppercase or lowercase characters to specify
device types.)
- The /etc/hosts file on the host machine contains the hostname and the IP
address of the remote machine.
- The environment variable DISPLAY is set to Hostname:0.0, where
Hostname is either the host name or the IP address of the machine that will
display the graphics.
For example, suppose that you want to run the ANSYS program remotely from
another UNIX system for local display of X11 graphics on your workstation
monitor. You would perform these steps:
1. Open a window on your workstation and issue the following command to
authorize remote hosts to access the display:
/usr/bin/X11/xhost +
2. Log onto a remote host (via Telnet, login, etc.). Type the following
command or commands to tell the remote host to display X11 graphics on
your workstation.
setenv DISPLAY Your_Workstation:0.0
DISPLAY=Your_Workstation:0.0
export DISPLAY
Your_Workstation is either the host name of the IP address of your
workstation.
3. Execute the ANSYS program and X11 graphics will be displayed on your
workstation monitor:
ansys55 -d x11 -g
8.5.5 HP Graphics Drivers
The X11 and 3-D Starbase graphics drivers are supported on the HP
workstations. You must install the Starbase libraries on the system.
CRX and HCRX graphics devices can use only the X11 graphics driver, unless
you have installed the PowerShade software on the machine.
If you are running HP CDE, set the colorUse option to BLACK AND WHITE. You
can do so using the HP Style Manager - Color Option. The 32-bit HP (hppa7x00
and hppA8000) versions of the ANSYS executable are appended with the ogl
suffix to support OpenGL graphics. These versions can only be run on HP
systems that support OpenGL.
8.5.6 Producing Graphic Displays on an HP PaintJet Printer
You can produce hard-copy outputs from within the ANSYS program on a
PaintJet printer when running on an HP workstation. To do so, issue this
command:
/pcopy,key
To produce a hard copy from within the DISPLAY program, use this command:
term,copy,key
Possible values for key are:
| 0
|
Turn hard-copy option off.
|
| 1
|
Copy each successive display, placing them in a bitmap file named file.pjet.xx.
|
| now
|
Copy the current display, placing it in a bitmap file named file.pjet.xx.
|
The xx is a two-digit integer between 00 and 99.
You can send the bitmap file resulting from either of the commands shown above
to a PaintJet printer. To print the file.pjet.xx file, use the HP-UX command
pcltrans. The format for this command is as follows:
pcltrans -C -p file.pjet.xx > /dev/paintjet
The value /dev/paintjet is the device name for the printer. If the printer is
connected to a spooler, use the following command:
pcltrans -C -p file.pjet.xx | lp -oraw
The last example assumes that the PaintJet is the default output device.
Notes
- The -P option expands the plot to fit on the default paper size of the plotter.
- You may need to use the -k option of pcltrans to remove the black
background on plots created using the X11 graphics driver.
- If the environment variable SB_X_SHARED_CMAP is set to true, the /PCOPY command may not produce
correct plots. To avoid this problem, un-set this variable before running
either the ANSYS program or the DISPLAY program when /PCOPY will be used.
- When using an HCRX 24 or CRX 24 graphics board, you must set the
ANSYS environment variable ANS_SNGLBUF to 1 to produce graphics
displays on the HP Paintjet printer.
8.5.7 PostScript Hard-Copy Option
When you are using the PostScript Hard-Copy option on a CRX 24 or HCRX 24
graphics board, set the environment variable ANS_SNGLBUF=1 to get a higher
quality image. This variable disables double buffering. Therefore, set it only
before you use the Hard-Copy option.
8.5.8 IBM RS/6000 Graphics Drivers
Both X11 and 3-D graphics drivers are supported on the IBM RS/6000
workstations in the AIX windowing environment. The 3-D driver incorporates the
Silicon Graphics licensed software, OpenGL.
8.5.9 Silicon Graphics Drivers
Both X11 and SGI OpenGL graphics drivers are supported on the Silicon Graphics
(SGI) workstations.
8.5.10 Sun SPARC (Solaris) Graphics Drivers
If ANSYS is not invoked from the launcher or the ansys55 script, each ANSYS
user's .cshrc file must contain the following environment variable definitions in
order to use the Solaris graphics drivers:
- For the X11 graphics driver, the required environment variable definitions
are:
setenv OPENWINHOME path/openwin
setenv LD_LIBRARY_PATH
/ansys55/syslib/solaris:/ansys55/lib/solaris:/usr/lib
- For the X11 and 3-D XGL graphics drivers, the required environment
variable definitions are:
setenv XGLHOME path/SUNWits/graphics-sw/xgl-3.0
setenv OPENWINHOME path/openwin
setenv LD_LIBRARY_PATH
/ansys55/syslib/solaris:/ansys55/lib/solaris:/usr/lib
Note-You must enter the setenv LD_LIBRARY_PATH definition on a continuous
line without a carriage return.
8.5.11 Sun UltraSPARC Graphics Drivers
If ANSYS is not invoked from the launcher or the ansys55 script, each ANSYS
user's .cshrc file must contain the following environment variable definitions in
order to use the Solaris graphics drivers:
- For the X11 and 3-D OpenGL graphics drivers, the required environment
variable definitions are:
setenv OPENWINHOME path/openwin
setenv LD_LIBRARY_PATH
/ansys55/syslib/solaris:/ansys55/lib/solaris:/usr/lib
Note-You must enter the setenv LD_LIBRARY_PATH definition on a continuous
line without a carriage return.
8.6 Creating Graphics Displays
You can create many types of graphics displays: geometry displays (nodes,
elements, keypoints, etc.), results displays (temperature or stress contours, etc.),
and graphs (stress-strain curves, time-history displays, etc.). Creating any
display is a two-step process:
1. You use graphics specification functions to establish specifications (such as
the viewing direction, number and color controls, etc.) for your display.
2. You use graphics action functions to actually produce the display.
You can perform both types of graphics functions either by using menu functions
in the GUI or by typing in commands directly.
8.6.1 GUI-Driven Graphics Functions
When running the ANSYS program interactively, most users will prefer to use the
GUI. As you use the GUI functions, you execute commands without actually
seeing or editing them. (The program will record all underlying executed
commands in your Jobname.LOG file.) You can access graphics specification
functions via Utility Menu>PlotCtrls. Graphics action functions reside under
Utility Menu>Plot.
8.6.2 Command-Driven Graphics Functions
As an alternative to using the GUI functions, you can type ANSYS commands
directly in the Input Window. In general, you enter the graphics specifications
using the graphics "slash" commands (for example, /WINDOW, /PNUM, etc.). Graphics action commands are
usually either prefixed with PL (PLNSOL,
PLVAR, etc.) or are suffixed with PLOT (EPLOT, KPLOT, etc.).
8.6.3 Immediate Mode Graphics
By default in the GUI, your model will immediately be displayed in the Graphics
Window as you create new entities (such as areas, keypoints, nodes, elements,
local coordinate systems, boundary conditions, etc.). This is called immediate
mode graphics. Anything drawn immediately in this way, however, will be
destroyed if you bring up a menu or dialog box on top of it. Or, if you iconify the
Graphics Window, the immediate mode graphics image will not be shown when
you restore the Graphics Window icon.
An immediate image will also be automatically scaled to fit nicely within the
Graphics Window-a feature called automatic scaling. Periodically, though, you
may need to issue an explicit plot function because you have created new entities
which lie "outside" the boundaries of the scaled image already in the Graphics
Window and are thus not captured with immediate mode graphics. The plot
function will rescale and redraw the image.
To obtain a more "permanent" image, you need to execute one of the plot
functions (such as Utility Menu>Plot>Volumes) or a graphics action command
(such as VPLOT). An image generated in
this way will not be destroyed by menu pop-ups or by iconifying the Graphics
Window. Also note that symbols (such as keypoint or node numbers, local
coordinate systems, boundary conditions, etc.) are also shown immediately but
will not be present on a "permanent" display unless you first "turn on" the
appropriate symbol using the functions under Utility Menu>PlotCtrls or the
appropriate graphics specification command.
If you prefer not to see things immediately as you define them, you can use the
IMMED command (Utility
Menu>PlotCtrls>Erase Options>Immediate Display) to turn off immediate
mode. When you you run the ANSYS program interactively without using the
GUI, immediate mode is off by default.
8.6.4 Replotting the Current Display
The /REPLOT command (Utility
Menu>Plot>Replot) re-executes the last display action command that was
executed. However, the program can execute that command only if it is valid in
the current ANSYS routine. For instance, if you issue a PLNSOL command in POST1, then exit that
routine and replot while at the Begin level, no contour display will be formed. To
save time, you may want to define an abbreviation for the /REPLOT command so that it is available on
the Toolbar as a "quick pick."
8.6.5 Erasing the Current Display
You can clear the current graphics display by issuing the ERASE command (Utility
Menu>PlotCtrls>Erase Options>Erase Screen). (GUI menus will not be
erased, however.)
8.6.6 Aborting a Display in Progress
If you have initiated a display and decide to terminate it before it is completed,
invoke your system "break." (Typically, this means moving the mouse pointer to
the Output Window and typing Ctrl+C. However, the specific procedure varies
from system to system.) You must execute this break while the display is visibly in
progress, or else your entire ANSYS session will terminate.
8.7 Multi-Plotting Techniques
The multi-plotting capabilities within ANSYS enable you to display both multiple
entities within a window and multiple windows with varying entity types. Defining
each window's composition is a four-step process:
1. Define the window layout.
2. Choose the entities you want each window to display.
3. If you are displaying elements or graphs, choose the type of element or
graph display used for plots.
4. Display the entities you selected.
8.7.1 Defining the Window Layout
You need to define how many windows you want the ANSYS program to use for
plotting and how those windows appear on your screen. You have the following
layout options:
- One window
- Two windows (left and right of the screen, or top and bottom)
- Three windows (two at the top of the screen and one at the bottom, or one
window at the top and two windows at the bottom)
- Four windows (two at the top of the screen and two at the bottom)
To define the window layout, issue the /WINDOW command (Utility
Menu>PlotCtrls>MultiWindow Layout). If you choose the GUI path, the
program displays a dialog box, in which you click on the layout you prefer. That
dialog box also contains a "Display upon OK/Apply" field, where you also can
specify what the ANSYS program displays next. Choices for this field are
"Multi-Plots," "Replot," and "No re-display." When you finish specifying your
layout design, click on Apply or OK.
8.7.2 Choosing What Entities Each Window Displays
Once you have designed your window layout, you choose what entities each
window will display. To do so, use either of the following:
Command(s):
GUI:
Utility Menu>PlotCtrls>Multi-Plot Controls
If you use the GUI path, a dialog box appears. In its "Window to edit" field, click
on either "All windows" or a specific window number (default is window 1). In the
"Display type" field, choose either "Entity plots" or "Graph plots." Then, click on
OK. If you choose "Entity plots," another dialog box appears, listing the types of
entities available for display. (You also can choose the type of plots via the /GCMD command, as described below.) All
entity types except GRPH are on by default; to turn an entity type off, click on it.
If you use the /GTYPE command, for the
wn argument, either specify ALL to have all windows display the selected entities
or choose a specific window number (default is window 1). For label, specify any
of these entity types:
NODE (nodes)
ELEM (elements)
KEYP (keypoints)
LINE (lines)
AREA (areas)
VOLU (volumes)
GRPH (graph displays)
When the GRPH entity type is activated, you can display only x-y graphs, and you
cannot use the /GCMD command to issue
other commands (such as /TYPE) that affect
displays. (For more information about /GCMD, see the ANSYS Commands Reference and Section 8.7.3 of
this manual) If the GRPH type is off, you can display any combination of the other
solid model or finite element entity types, and you can use /GCMD to issue other display control
commands.
To turn an entity type on via the /GTYPE
command, use a key value of 1. To turn an entity type off, specify a key of 0.
8.7.3 Choosing the Display Used for Plots
When you are displaying either the ELEM or GRPH entity type, you can control
the type of element or graph display used for plots. To do so, use either of the
following:
Command(s):
GUI:
Utility Menu>PlotCtrls>Multi-Plot Controls
You can specify ALL to have all windows use the selected display type, or you can
apply that display type only to a specific window (default is window 1). The lab1
through lab12 values shown above are labels for commands such as /TYPE and PLNS,S,X. (For the lab arguments, you can
specify only commands that have wn (window) arguments.)
Issuing the /GCMD command is the same
as choosing the GUI path shown above, then choosing either "Entity plots" or
"Graph plots" for the Display Type field.
Following are two command-based examples of selecting a type of element or
graph display.
- To display a PLNS,S,X command in
window 1 when the ELEM entity type is activated, issue the command /GCMD,1,PLNS,S,X.
- To change from an element display to a Von Mises display, issue the
command /GCMD,1,PLNS,S,EQV.
8.7.4 Displaying Selected Entities
To display the entities you selected, issue the GPLOT command (Utility
Menu>PlotCtrls>Multi-Plots or Utility Menu>Plot>Replot).
Go to the beginning of this chapter