Field Precision title

Plotting large meshes

Some users have reported intermittent plotting problems when working with large meshes (i.e., millions of elements) in the 2D and 3D programs. The reason I didn't notice anything is that I always try to avoid large meshes. It's almost always possible to analyze applications to employ symmetry and to eliminate unnecessary details. Furthermore, solutions with a large number of very small elements may actually have reduced accuracy because of roundoff errors. Nonetheless, the 64-bit programs can address unlimited memory, and there may be occasions where huge meshes are unavoidable.

Element-based plot types include all plots in the 2D TriComp codes and Slice and Surface plots in the 3D AMaze codes. With millions of elements, regeneration of an accurate plot takes time?? possibly as long as 10-20 seconds. In our programs created for Windows XP, plotting operations were performed on the display screen. In this case, the user would see large plots slowly form as the code processed all the elements. Timing issues arose with Windows Vista and XP. The operating system got bored with screen tasks that lasted more than a few seconds and simply gave up. The end result was that users often observed half-completed plots of large meshes.

We revised all programs to employ a two-step procedure: 1) draw the plot information to a memory bitmap and then 2) flash it to the screen display. The process worked because Windows Vista and 7 do not place time constraints on communication with bitmaps. There is the added benefit that the user views the old plot while the new one is being prepared. If you have a large mesh and make a plot change (e.g., zoom, pan, change limits,...), you will see the cursor change to timing spinner. After a delay, the new plot appears almost instantaneously.

Problems arise if you change the window focus during plot regeneration. If the program does not have the focus when the plot is complete, it's uncertain what to do with the bitmap and strange things occur. Sometimes the plot setup is corrupted and further operations are blocked. In this case, you may need to exit and renter the plotting part of the program or even restart the program. Generally people are unaware of how much flitting around they do with the mouse ? the longer regeneration takes, the more temptation there is to wander.

If you have to work with huge meshes, the basic plotting rule is: don't do anything else. During plot regeneration, leave the cursor in the window. Preferably, take your hand off the mouse.

Two final points:

  • The regeneration time is much shorter if you plot only a portion of the solution volume or slice plane (i.e., a zoomed view).
  • There are no time-limit or focus problems using the Save plot file command, which constructs the bitmap and then ports it directly to a file.

LINKS