2

2.11 THE OPENGL PLOT PROGRAM Z88O

With the new OpenGL plot program Z88O the Z88 system enters new dimensions. You may illuminate a structure with three different light sources or plot with hidden lines, both the undeflected and the deflected structure. You may plot stresses and X, Y and Z deflections with a color range - like the expensive professional FEA programs. You may plot a limited range of nodal or element numbers - a nice feature especially for large structures. A printer or plotter feature is not included into Z88O - and why - just do a screen shot.

Z88O uses OpenGL so your computer must be able to deal with OpenGL graphics. This is true for all newer Windows machines and a quite cheap graphics card will do well. Anyway, it's always a good idea to control the system settings - sometimes you may turn on OpenGL hardware acceleration. Compilation (only necessary if you want to add improvements) under Windows is easy because OpenGL is part of Windows since Windows95 and the well-known compilers (MS Visual C++, LCC, Borland C++ Builder, OpenWatcom) come with the necessary OpenGL libraries and header files.

Professional UNIX workstations have always OpenGL features included. If you want to compile the Z88 system by yourself on a UNIX machine be sure to have the libraries libGLw and libGL and the header files gl.h, glx.h und GlwMDrawA.h on your machine in the proper library and include paths. This is also true for LINUX systems, but LINUX sometimes presents problems with OpenGL and your graphics card. If so, don't blame Z88O because Z88O was developed on a SGI. And SGI makes the OpenGL reference machines. But with the newer RedHat and SuSE distributions it should work after some effort. If Z88O won't work at all: The approved plot program Z88P which works with the WinAPI or the X11 libraries stays in Z88, ref. Chapter 2.6.

Of course, you may define your choice of colors, the light features, material properties, the polygon offset and the fonts (for UNIX) in the parameter files Z88O.OGL (for Windows) and Z88.FCD (for UNIX). The file Z88.FCD for the UNIX operation system allows for much more possibilities in changing colors and fonts as well as the sizes and locations of the pushbuttons, radioboxes etc. You can completely modify the whole appearance of Z88O for UNIX as you wish. Be careful with changes in Z88O.OGL (Windows) or Z88.FCD (UNIX/LINUX): You should have some proper knowledge about OpenGL if you want to change light effects etc. Otherwise you may pull a long face because nothing will work as you wish. Some hints are included into Z88O.OGL and Z88.FCD, however, i can not give here an introduction into OpenGL. Consult the two basic books "OpenGL Programming Guide" and "OpenGL Reference Manual" from Addison-Wesley.

Start of Rendering: When Z88O was launched the OpenGL subsystem is started and prepared to go. You'll start rendering under Windows with the very left icon Go and under UNIX with the pushbutton upper row right <Run>.

Needed Files | Super structures | Undeflected FE struc. | Deflected FE struct.
Z88NI.TXT | Yes | No | No
Z88I1.TXT | No | Yes | Yes
Z88O2.TXT | No | No | Yes
Z88O8.TXT | No | Yes, for Mises stresses | Yes, for Mises stresses

Rendering with Z88O: For fastest operation Z88O connects the nodal points - and only the corner points- with straight lines, although for Serendipity elements the edges of the elements are square or cubic curves. However, especially illuminated scenes need a huge amount of computational power. Please keep in mind: If a part renders pretty fast in your CAD system, Pro/ENGNEER for example, and the same part renders quite slowly in Z88O - this is normal business because CAD systems are "drawing" only some outline curves. In contrast, FEA system have to render every finite element i.e. compute the normal vectors for any element surface, compute light effects for every tetrahedron etc. Hidden line scenes put very heavy load on the CPU, too.

What can i plot with Z88O? Nearly everything if a solver (Z88F or Z88I1 with Z88I2) was run which stored the deflection file Z88O2.TXT along with a run of the stress processor Z88D which stored the three stress files Z88O3.TXT (for you to check the stresses), Z88O5.TXT (for Z88P) and Z88O8.TXT (for Z88O). Even for trusses you may plot the "von Mises" stresses (i.e. tensile stresses) with different colors. Only beams No.2 and No.13 and cams No.5 allow only the plotting of deflections and nothing more. Why? Because you must compute for beams and cams also the notch sensitivity which is impossible for a FEA system which deals with a whole structure of beams.

Plot of stresses: The kind of plotting the stresses within FEA programs is truly of philosophical character. As a matter of fact, numerous experiments and computer studies at the Institute of Engineering Design and CAD of the University of Bayreuth, Germany, showed, that some very expensive and well-known professional FEA programs produced incorrect stress plots in some situations! The best way is the computation of stresses directly in the Gauss points as realized in Z88P. However, this is odd for OpenGL so i decided for the following way after a lot of experiments:

- von Mises stresses in corner nodes. In fact, the stresses are computed not really in the corner nodes which would lead to very wrong results especially for very tapered elements but in Gauss points laying in the near of the current corner nodes. Stresses are computed for just the same number of Gauss points like the number of corner points. Because often a node is linked to more than one element the stresses are computed to a mean value from the "corner node" stresses of all linked elements. This results in pretty balanced stress shadings which are mostly somewhat lower than the maximum stresses of Z88P, however. The value of the order of integration INTORD in the header file Z88I3.TXT has no meaning but INTORD should be greater than 0.
- von Mises stresses as a mean value for each element. The stresses are computed in the Gauss points of the current element, added and then divided by the current number of Gauss points. This results in a mean value for the von Mises stress per element. The value of the order of integration INTORD in the header file Z88I3.TXT is important and INTORD must be greater than 0.

Plot of deflections: You may plot the undeflected or the deflected structure. The enlargement factor is adjustable, with 100 as the default value for X, Y and Z. In addition, you may plot the deflections for X, for Y or for Z with color shading. This is a pretty nice feature for large spatial structures. In contrast to Z88P, you may plot the shaded colors for stresses or for the deflections with the deflected structure, too.

Hints for the user for Zooming, Panning and Rotating:

1. You may work without limitation with the special keys for Windows (see below) or the pushbuttons for UNIX. You should use the special keys or the pushbuttons for precise zooming, panning and rotating. This is the default mode. Mouse navigation is turned off.
2. With Z88O - in contrast to Z88P- you may use mouse navigation: Under Windows, press the mouse icon. Under UNIX, press the pushbutton Pushbu (which changes to Mouse): Now you can
   - zoom with the left mouse button pressed
   - pan with the middle mouse button pressed
   - rotate with the right mouse button pressed

This option fits well for limited zooming- and panning ranges and for fast but quite unprecise rotating. You may in addition use the special keys or pushbuttons but this mixed mode is not a real feature and may lead to unpredictable results because Z88O uses different calculations for both modes.

Special key strokes for Windows:

Prior: increase zoom

Next: decrease zoom

Cursor left: panning X direction

Cursor right: panning X direction

Cursor up: panning Y direction

Cursor down: panning Y direction

Home: panning Z direction

End: panning Z direction

F2: rotate around X axis

F3: rotate around X axis

F4: rotate around Y axis

F5: rotate around Y axis

F6: rotate around Z axis

F7: rotate around Z axis

F8: reset all rotations to 0

Under UNIX use the usual X and Motif key assignments: Tab key and arrow keys for choice and space bar for activation.

The "coordinate system": OpenGL works with a Clipping Volume, i.e. with a kind of cube, defined by Xmin and Xmax in horizontal direction, by Ymin and Ymax in vertical direction and Zmin (points towards the user) and Zmax (points away from the user). If you use a too-large zoom factor or if you are panning the structure too near to you then the range of Zmin is exceeded and parts of the structure are laying outside the viewing volume. This offers a nice chance to look into a structure. Otherwise, change the value of Zmin (default entry is -100) to lower values, e.g. -1000: under Windows use Factors > Z limit towards you, under UNIX change the textfield "Zlimit" right side below. The following screenshots are showing the situation:

Windows: piston of a BMW engine (motorcycle F650GS) Zlimit: default value -100.

Windows: piston of a BMW engine (motorcycle F650GS) Zlimit is -10, piston has slash cut.

Explanation of some menu items:

Name of Structure File:

Windows: File > Structure File

UNIX: Stru. text field directly on window

Choose the structure file here. Enter name, if necessary with path, press return. The new stucture is loaded. You'll start rendering under Windows with the very left icon Go and under UNIX with the pushbutton upper row right <Run>.

Deformation Modes of the Structure:

Windows: Structure > Undeflected, Deflected

UNIX: Radio box Undefle., Deflected

Plots the undeflected structure or the deflected structure. You may do all other rendering operations with the undeflected structure or the deflected structure.

Caution Deflected: The user must have executed a calculation of displacements before using this function. Do a FEA run with Z88F or Z88I1/Z88I2 before using Z88O. Otherwise, some old files Z88O2.TXT (displacements) from earlier Z88 runs are opened causing totally wrong results !!

Choice of the 3D effects:

Windows: 3D-Effekte > 1. Light on,

2. Hidden Line on,

3. Mises stresses (corners),

4. Mises stresses (elements),

5. X Displacements on,

6. Y Displacements on,

## 7. Z Displacements on

or the appropriate icons

UNIX : Radiobox
1. Light

2. Hide/Mesh,

3. Stress E,

4. Stress M,

5. X displac,

6. Y displac,

7. Z displac

1. The structure is illuminated with three light sources. You may modify the features of the light sources by editing the header files Z88O.OGL (Windows) and Z88.FCD (UNIX).
2. For spatial structures the finite elements mesh is rendered with hidden lines. For 2D struktures the pure finite elements mesh is drawn (there is nothing to hide). Only in this mode you can see all desired nodal and elements labels. The polygon offset can be edited in the header files Z88O.OGL (Windows) and Z88.FCD (UNIX).
3. The von Mises stresses of the corner nodes are plotted. In fact, the stresses are computed not really in the corner nodes which would lead to very wrong results especially for very tapered elements but in Gauss points laying in the near of the current corner nodes. Stresses are computed for just the same number of Gauss points like the number of corner points. Because often a node is linked to more than one element the stresses are computed to a mean value from the "corner node" stresses of all linked elements. This results in pretty balanced stress shadings which are mostly somewhat lower than the maximum stresses of Z88P, however. The value of the order of integration INTORD in the header file Z88I3.TXT has no meaning but INTORD should be greater than 0.
4. The von Mises stresses as a mean value for each element are plotted. The stresses are computed in the Gauss points of the current element, added and then divided by the current number of Gauss points. This results in a mean value for the von Mises stress per element. The value of the order of integration INTORD in the header file Z88I3.TXT is important and INTORD must be greater than 0.
5. Plot of the displacements for X with color shading
6. Plot of the displacements for Y with color shading
7. Plot of the displacements for Z with color shading

For pos. 3. to 7. the color range may be edited in the header files Z88O.OGL (Windows) and Z88.FCD (UNIX).

UNIX: Hidden line plot of the BMW piston, mouse navigation turned on.

Drawing Node and Element Numbers:

Windows: Labels > No Labels, Nodes, Elements,

UNIX: Radio box No Labels, Nodes, Elements

Plot the element numbers or the node numbers or skip numbering. In contrary to Z88P you can define ranges from-to, e.g. plot the nodal numbers from 11 to 19 or plot the element 3, i.e. from 3 to 3. Z88O recalls your entries even if you change to No Labels. Keep in mind for UNIX and LINUX: press immediatelly the Return button after you've filled in a textfield to enter the value really. This is not a Z88O stupidy but the normal use of Motif textfields.

Please remember that you'll only get rendered all desired labels on the surfaces if you are in Hidden line mode. The other modes may cover some labels. And labels inside a structure are usually covered by the tetrahedron and hexahedron surfaces. Therefore, Z88O turnes the hidden line mode temporary off - you'll see the mesh without hidden lines just as in Z88P. As soon as you switch to No Labels gehen, the hidden line mode is re-activated.

Zooming:

Windows: PRIOR and NEXT

UNIX : Pushbuttons Zoom+ and Zoom-

mouse navigation on: left mouse button pressed

Panning:

Windows: X: CURSOR LEFT and CURSOR RIGHT

Y: CURSOR UP and CURSOR DOWN

Z: HOME and END

UNIX : Pushbuttons X+, X-, Y+, Y-, Z+, Z-

mouse navigation on: middle mouse button pressed

Rotating:

Windows: Faktors > Rotations 3D

The rotations around X, Y and Z axises are defined with Factors > Rotations 3-D:ROTX, ROTY and ROTZ. Default values are 0.

With the F2 . . F7 keys the structure can be revolved in steps of 10 degrees.

UNIX : Pushbuttons RX+, RX-, RY+, RY-, RZ+, RZ-

Turn in steps of 10 degrees. Pushbutton Rot 0 resets all rotations to 0.

mouse navigation on: right mouse button pressed

Enlarging Deflections:

Windows: Factors > Deflections

UNIX: Text fields FUX, FUY and FUZ

Enlarge the computed deflections with the factors FUX, FUY and FUZ. Default values are 100. Attention UNIX: As usual for UNIX, the changes only apply at a respective Return. However, you can type in all three fields without Return and then press the Pushbutton <Run> .

Some remarks on stresses:

Windows:
3D-Effects > Mises Stresses (corners) or icon No. 9 from left
3D-Effects > Mises Stresses (elemente) or icon No. 10 from left

UNIX :
Radiobutton Stress C (= corner nodes)
Radiobutton Stress M (= mean value per element)

If you did before a stress calculation with Z88D (this is possible and useful for all element types except for beams No.2, No.13 and cams No.5), then you may plot the von Mises stresses either in the corner nodes or as mean values per each element. And before running the stress processor Z88D you really had to calculate the displacements by running Z88F or the iteration solver. Thus, the sequence is:

1. Cholesky solver Z88F or iteration solver Z88I1 and Z88I2
2. stress processor Z88D
3. Z88O, if you want to plot stresses

von Mises stresses in corner nodes. In fact, the stresses are computed not really in the corner nodes which would lead to very wrong results especially for very tapered elements but in Gauss points laying in the near of the current corner nodes. Stresses are computed for just the same number of Gauss points like the number of corner points. Because often a node is linked to more than one element the stresses are computed to a mean value from the "corner node" stresses of all linked elements. This results in pretty balanced stress shadings which are mostly somewhat lower than the maximum stresses of Z88P, however. The value of the order of integration INTORD in the header file Z88I3.TXT has no meaning but INTORD should be greater than 0.

von Mises stresses as a mean value for each element. The stresses are computed in the Gauss points of the current element, added and then divided by the current number of Gauss points. This results in a mean value for the von Mises stress per element. The value of the order of integration INTORD in the header file Z88I3.TXT is important and INTORD must be greater than 0. Example: If you enter for INTORD the value 3 when calculating hexahedrons No.10 then the von Mises stresses are calculated in 3 x 3 x 3 = 27 Gauss point, added and then divided by 27.

The stress plot is done by color shading. You may modify the colors by editing the header files Z88O.OGL (Windows) or Z88.FCD (UNIX) for your own taste. Of course, for UNIX also the fonts - this requires some experiments depending on your operating system until you are (i hope so) satisfied. You need to make this modifications only once or leave it as it was.

Before that, run a stress calculation with Z88D. You did set in the header file Z88I3.TXT the stress flag ISFLAG 1 and the integration order INTORD > 0. For exact stresses consult the output file Z88O3.TXT.

Caution: The operator is responsible for first running a stress calculation by Z88D before using this function. Run Z88F or the Iteration solver Z88I1 and Z88I2 and then Z88D before starting Z88O. Otherwise some old stress files Z88O8.TXT from earlier calculations are read in causing totally wrong results !!

Automatic Scaling:

Windows: Autoscale > No Autoscale, Yes Autoscale

UNIX: Pushbutton AutoS

The Autoscale function takes care that structures will completely fit on the screen.

Autoscale activates automatically if a new structure is loaded by File > Structure File. Autoscale again is deactivated immediately and the hook points to No Autoscale. You can then scale properly with Autoscale > Yes Autoscale. However, Autoscale switches again immediately to No Autoscale. Autoscale > Yes Autoscale is a kind of pushbutton. The explanation above corresponds to UNIX as well.

Height Ratio:

Windows: File Z88O.OGL

UNIX: file Z88.FCD

The height ratio can be adjusted to the monitor customization. Therefore, the entry FYCOR exists in Z88O.OGL (Windows) or Z88.FCD (UNIX). Load a perfectly circular or perfectly square structure and modify FYCOR untill this structure is plotted perfectly circular or square on your monitor. Please keep in mind that FYCOR is loaded with the start of Z88O, so you must re-launch Z88O after a modification in the files. You need to make this modification only once.

Windows: plot of the von Mises stresses in the corner nodes of the BMW piston.