Basic Questions

Basic Questions

I would like to use AV very frequently in my IVF programs. I worked with it and have the following initial comments:
1. Do you have documentation like the IVF "LIB_for.PDF" and "LANG_FOR.PDF"? I need to read references on the F90 statements and can't seem to find them. My stress plot subroutines would be something like the SIMPLE.F90 example.
2. For example, how would I do stress plot contours for a finite element model like Quadmesh3.h5 with a moving "camera" (or rotate model)? I would also like to add a "scale" showing what the colors represent. I also need a finer grain than your examples.

40 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The main AV documentation is AvView.chm (Viewer help) and AvVis.chm (development topics). You should be able to access them from Start->Intel Software Development Tools->Intel Array Visualizer->documentation. Do you prefer having pdfs rather than the winhelp format?

Your finite element application sounds very interesting! I think you should be able to use AV to create some compelling plots of your data. Could you post a .h5 file that contains a typical example of the arrays you use? Just call avStartWatch for each array and then avSave (or launch the Array Viewer and save from the Viewer).

Ill take a look at the file and see if I can come up with a macro that will create the plots you are looking for. It is possible to have QuadMesh plotwith the surface colored to reflect an additional scalar value (stress in your case).

Not sure what you mean by a finer grain. More data points?

Yes I prefer the PDF format, for easier printing/reference. I actually keep the IVF files on my desktop. It's no big deal now that I know where to find the AV info, it's just a convenience thing. One file showing step-by-step how to make an H5 example file would help.

I've attached a simple stress plot for you to see what I'm trying to do. I'm not advanced enough yet to do an H5 file. My data files are generally very large. Basically the data would be some type of force or stress values at each corner.

By finer grain I mean more colors, say 10 instead of five. That would show stress concentrations more clearly. It would be great if you could provide an F90 example program for stress plots. Some of the options could be scaled-deformed or undeformed, moving camera to rotate model, labels, etc.

Take a look at: AV/Samples/Fortran/FileSave/FileSave.f90. For basic arrays you just need to add one line of code: call avStartWatch(...). For arrays of derived type the procedure is a bit more complicated, but the above sample covers that as well. Add the line: call avSave("myfile.h5", status) to save to the file myfile.h5, and you're done!

I've attached the file FileSave.f90 for anyone who would like to see how this works but doesn't have AV installed.

A non-programmatic way to create a data file is to use the "View Array" option in the debugger. Set a breakpoint once your data has been initialized. Once you hit the breakpoint, right click on each array of interest and select "View Array". You should see the list of arrays in the Array Visualizer tool window. From the tool window select "Array Viewer". Array Viewer should come up with the arrays loaded. Select File Save and save to an .h5 file.

Thanks John. The filesave.f90 H5 file was created fine. I had to use the release compiler, the debug compiler gave a run error, something about no access to the database. Give me a few days to build the arrays, and see if I can use AV.

We have seen some customers having database access errors with the debug version of their projects in Microsoft* Visual Studio after the 9.0 Intel Fortran release. We are still root causing the source of these problems but a repair of the Microsoft Visual Studio has fixed the problems, here are the suggested steps to fix the issue:

1. Uninstall Intel Fortran 9.0

2. Go to Add/remove programs, select Visual Studio .NET 2003 and choose Change/REmove and when it comes up choose the repair option

3. Reinstall Intel Fortran 9.0
Please followup at by submitting an issue if these steps do not resolve your debugging errors.

Glad to hear you were able to create a .h5 successfully. If you could post your filesave.h5 file, I'll investigate creating a graph along the lines of the screen shot you posted.

I posted a lengthy reply last night that didn't stay?! I'll try to keep this shorter. I'm attaching an XLS file since the H5 file loses the header row. Cols A - I are the connectivity nodes. Cols J-M are the nodal coordinates, cols N-W are the stresses (choose any to plot), with col-P as the element face, such as top or bottom, sort if needed. Cols X-AA are the displacements. The plot routine should be able to plot a deformed or undeformed shape, and the camera should be able to rotate around the model. Thanks for your help.

Yes, I had the problem of my posts disappearing as well. I've gotten into the habit of typing posts in Outlook or some other program, and then doing a copy and paste into the forum window. That way if the post goes up in smoke, I've got a spare copy.

More forum difficulties: when I downloaded your file, it shows up on my system as having zero bytes. Could you email me the file? My address is john DOT readey AT intel DOT com.

Just testing

I sent the email with the attachment, hope it arrived. If you can provide an example plot subroutine, I'm hoping I can program the data around any limitations of the example. I typically open a child window like H5 example quadmesh3 for plots. So any Fortran code (like example "simple") that would serve as a starting point for a plot subroutine would be appreciated.

I attached a revised XLS file with the face-4 & face-6 stresses broken out. One face is the top and the other is the bottom of the elements. This column arrangement should be simpler to work with.

I suspect that the anti-virus software is blocking anyattachment that might have a virus.I converted the XLS file into a TXT file.

XLS attachments should be OK, there was a problem in the forum software last week which was probablythe cause of your attachment not getting through.

Anyway, reading the XLS (or txt) file into AV is not very straightforward in your case, since not every line contains every field. i.e. the vertex lines in the lower part of the file don't have values for "node-1", thru "node-8". I expect in your Fortran code you actually have separate arrays elements vs. vertex. Could you use avStartWatch/avFileSave as I described earlier to create an h5 file?

Alternatively if you have Fortran (or C) code that reads your data file format, I could use that.

I tried modifying an example, and it won't compile. However, you might be able to see how the data is read in. I split the previous data file into two files. The one for nodes has 882 rows, first line is 882, read in the XYZ coordinates and the dX,dY,dZ displacements. The one for elements has 400 rows, the first line is 400, read in 8-nodes, and two stresses. The "brick" element is 3-dimensional and has a width. I'm not sure a quadmeshplot can do a 3D element. I'm attaching the F90 code. Maybe it will help.

What sort of compile errors were you seeing? Plot01.f90 compiled cleanly for me.

Could you postthe brick1.txt & brick2.txt files that Plot01.f90 opens? I'll see what I can do as far as making a custom graph to display the data. QuadMesh doesn't support brick elements, only quadrilateral elements. I investigate creating a new plot type for this type of data (a sort of 3D version of quadmesh).

Compile was the wrong word. It wouldn't link. It couldn't find the AVstartwatch, creategraphs, or AVsave. I got it to run by swapping the F90 code with example SIMPLE. I'll attach the data files as requested.

Here is the second data file as requested.

I modified your plot01.f90 codeto output an .h5 of the data. Please see the attached file.

I've first thing I changedwas touse allocatable arrays rather than fixed length. This makes it easier to setup the display in AV and is more efficient in general.

Next I added avStartWatch calls for each of the arrays. The input parameters for the start watch call are the address of the array, the shape, the rank, the type, and aname. For example:
call avStartWatch(LOC(VM), 2, SHAPE(VM), AV_REAL4, "Von Mises", status)

The status value will return 0 if successful and -1 if there was a failure.

Finally there is a call to avSave to save the "watched" arrays to a file.

Regarding the link errors: Did you add AvFRTd.lib to the Linker/Inputs in the project settings?

I'll look into creating a graph for your data now.

Message Edited by jlreadey on 08-22-2005 02:39 PM

I've attached a new version of the code that creates a "PolyList" plot. The PolyList plot is plot type that can display various graph elements such as points, triangles, polygons, or as in this case quadrilaterals.

Unfortunately I ran into a bug in the AvFRT library where the calling parameters for the avSetVertexListSource call were passed in incorrectly. I've commented out that line (line 131), so you'll need to set that value in the Viewer. When the Viewer comes up right click on the graph, plot icon in the tree pane, select "Properties", and then set "VertexListSource" to the value: /nodes@bottom. I'll have the bug fixed for the next update.

I haven't done anything with the VM or dX arrays yet. I assume you want to use the VM values to colorize the plot. Since the VM array is 2xN, I'm not sure how intend to use these values. Would you like alternate views using the first column vs second column values?

I added the "Lib" and the "Include" directories,and still no luck. I'm okay running these from the AV sample directories. They run okay. IVF doesn't seem to mind that they are located there. Thanks for working on these example plot programs.

Correct, the VM array stresses colorize the model. It is basically a 20x20 element model of a flat plate supported on two adjacent sides. I'll email you a BMP file of a 9x9 stress plot for you to see what it should look like. A positive stress should have a different color than a negative stress, say ten colors over the stress range. Instead of alternate views, can we have the top face colorized with VM1 and the bottom with VM2? Each stress represents the centroidal stress for that element. The dX array values are the deflections at each node due to the load. We will need to factor the dX values and add them to the X values to get the "deformed plot" (they are typically small) something like 'factor*dX+X'. The plots typically have the X values plotted in one "wireframe" color, and the deformed values in another. This way we can see the deformations. We should also be able to rotate the model (or camera), typically there are arrows to rotate the model about the X, Y, or Z axes.

I've added the code to setup the graph. Take a look at the attached screen shot. Is that what you are expecting?

I haven't had time to do the node deflections yet. The nodes positions could be updated by the program of course: just update the X array values and call avViewerUpdate to have the graph updated.

Another approach would be creating an AvPage object that contained a slider to allow the user to adjust the deformation factor. Something like the page "Temperature Range" in the sample file: AV/data/HDF5/adriatic.h5. I'll look into doing this for your model.

Repost of the screen shot...

Maybe a jpeg will work...

I sent you another stress plot example via email. This JPEG plot is fine, but I think the color pallet needs to be like the "adriatic" example for "Temperature Range". The temperature range looks to have a much better color gradient. I'm not sure if the adriatic example has monocolored elements, they just look a lot smoother (finer grain). Your sliding scale idea for factoring displacements is a good one! If you can add four more for the camera, to rotate the model/camera X, Y, or Z, and zoom-in or zoom-out would be good too.

The graphs in the adriatic data file are mono-colored as well (try zooming in and you will see this). I think it looks smoother just because there are more elements in the dataset.

Camera rotate/zoom-in/zoom-out is built into the Viewer for 3D graphs. You don't need to do anything special to enable this.

I looked thru the examples, and didn't see the option to move the camera (3Dviewer?). For example, quadmesh3 combo2, how do you rotate the camera to see the model rotate about 3-axes? If adding more colors doesn't improve the texture of the colorizing, I may need to calc the stresses at the nodes, but if the elements are monocolored, that may not provide more color detail. Can you please try adding 16 colors to the pallet like the example I emailed you? The texture I'm looking for is like the "adriatic" temperature example, that looks fine, likemyou say that also has a finer mesh. One of the program options I'm considering is a "refine mesh" option whereby the elements are subdivided in four. Please let me know if the example progam is as far as you can take it.

You can move the camera by just holding down the left mouse button and dragging. Scroll wheel or Shift+Left Mouse can be used to Zoom in and out.

Take a look at the attached screen shot. I've adapted the color palette from the Adriatic example.

Also you can see I've created a page object with three sliders. When move they modify the coordinates of the plot by adding a scaled value from the Displacements dataset toeach coordinate of the surface. Each slider controls a separate dimension. I've added a reference grid that stays fixed as well.

Moving the camera with the mouse is really neat. One problem solved beautifully. The new color pallet looks good too. You can clearly see the high & low stress areas. The only problem I see are the three "stress factor" scales. We really should factor all deflections by the same factor, otherwise the model's scale gets distorted. So my recommendation is to keep one sliding scale as a "deflection factor" for all deflections and another as a "time factor". Can you make the sliding scales side-by-side and smaller? If you want to keep building this example, the next steps are to add "beam elements" for the plot capability, and animation. I'll email you a famous building model to plot. Then after the plot capability is done, we can add "animation". This basically involves sets of deflections and stresses at specific times, like looking at a model by strobe light. AV can animate well after seeing the colored balls bouncing in "bounce.h5", except we'd be looking at the wall stresses.

It's no problem replacing the 3 sliders with one that uniformly updates the X, Y, and Z deflection factors.

For "Beam elements" what primitives are you expecting to see? Just a line segment? Or something like a capital "I"?

I do think it's worthwhile to create additional samples to illustrate animation techniques in AV. And a sample that uses "real" data is even better. I think there are a lot of datasets (such as yours) where a static view is not sufficient for the user to fully understandthe model. With AV you can have a data file which anyone can view with Array Viewer, but which can contain interactive behaviors.

Line segments are fine for beam elements. Give me some time to generate a few cool looking dynamics examples to send you.

Oh, I am very interested in this topic. Would you please tell me how can I draw and display triangles/tetrahedra just like the patch function of matlab? Here I attached an example of triangles. The 'node2.txt' includes all vertices' coordinates and the 'tnode2.txt' includes all triangles' vertices numbers.

Zhanghong Tang

Tetrahedra are a different type of 3-D quadrilateral element. They are generally 3-sided pyramids with a base, consisting of 4-nodes. I'm not a big fan of tetras since it's tough keeping track of the stress directions. I prefer bricks for 3D elements personally to keep stress plots. However, if we establish element "types" there can be "beams" (2-nodes), "triangles" (3-nodes), "quads" (4-nodes, with simple connectivity 1-2-3-4), "tetras" (4-node, but with more lines...1-2-3-1-4-2-4-3), and "bricks" (8-nodes). The tetras could be plotted like the beam elements, no stress plots, just lines with or without deflections.


The "AvPolyList" class supports indexed triangle datasets. What language are you using? I'll see if I can come up with a sample that uses your data.

There isn't currently support for Tetrahedrons or "bricks"; these types are planned for the next release. Do you have any sample tetrahedral data that you can post?

Thank you very much for your reply!

I use Fortran language ( 2003). I am very appreciated for you giving me a simple example. Latter I will attach a 3-D tetrahedra example.

Zhanghong Tang


Take a look at the graph I created from the data files you sent. Is that what you were expecting to see?

Please post your 3d tetrahedra data when you get a chance. I've been working on adding support for tetrahedrons in AV and it would be nice to have an interesting dataset to experiment with.

Sorry for late reply.

Zhanghong Tang

Hey Zhanghong,

This looks like another really cool dataset! Take a look at the attached screenshot from the Array Viewer and let me know if what I'm displaying is more or less correct. I rendered the tetras partially transparent so you can see through to the underlying layers.



I like the plot. Sorry I haven't been responding, we're very busy. Will you be posting a link to new example programs like this plot routine?


I don't want to post the programs just yet since they depend on new features of AV. I hoping to include most of these as sample programs or data files in the next release. Would it be OK to include your tetra dataset?


Leave a Comment

Please sign in to add a comment. Not a member? Join today