[Gmsh] PLOT3D format

Matt Gundry mjgundry at faa-engineers.com
Fri Feb 18 21:57:34 CET 2005


OK, I have made a few simple additions to make the exporting of surfaces
to Plot3D format work. I have checked the output in Plot3D (the
visualization app) and FAST, and it appears correct. More specifically, 
the format is formatted ASCII multigrid Plot3d.

I currently have elementary surfaces and volumes working, but eventually 
I'd like merged physical surfaces and volumes too.

Some questions:

For surfaces, I've assumed that if pS->Nu and pS->Nv are defined, then I 
have a structured surface. I also check that the number of quads 
corresponds to Nu and Nv (throws out incompletely recombined surfaces). 
I do a similar check for volumes by extracting the Nu and Nv for surface 
1 and Nv for surface 2 to define the dimensions of the volume grid. I 
then compare against the number of hexahedra. Is that a reasonable approach?

The orientation of quads, surfaces, hexes and volumes don't seem to
agree with the documentation (or I've assumed too much). As a first 
example, say I define a square trasfinite surface, starting from the 
lower left corner, and selecting vertices counter clockwise.

4-------3
|       |
|       |
|       |
1-------2

With this definition, the documentation indicates that the "u" direction 
is from left to right, and the "v" direction is up. However, when this 
surface is meshed, the quads are numbered as follows:

4-------3
| 2 | 4 |
|-------|
| 1 | 3 |
1-------2

It's a simple enough matter to change my surface definitions (or reorder 
the quads) to get what I want, but I was wondering - Do I just have it 
backwards in my head, or if I found a bug?

Another related point - If you try to define the surfaces for a cube 
following the numbering in the documentation, the side, top, and bottom 
surfaces will give an error because the definition is out of order. The 
order of nodes given for those surfaces (or quads on a hexahedron) would 
result in a twisted face, or butterfly. Obviously, Gmsh creates the 
quads with nodes ordered correctly - generally with the last two nodes 
switched as compared to the docs.

I'll submit a patch for my Plot3D file generator if you'd like. The 
physical stuff is going to take a fair amount of work reorienting 
surfaces and volumes, merging them, and checking the merged surfaces. As 
I am an engineer, not a programmer, that will take some time for me to 
figure out. However, what I have now may be of some use to others.

Thanks,
Matt

Christophe Geuzaine wrote:
> 
> Hi Matt - With the transfinite, elliptic or extrusion algorithms, the 
> elements are indeed generated in the "expected" order. But keep in mind 
> that the elements are stored in a tree structure according to their 
> quality, not their number.
> 
> So if you want a structured output, we will have to reorder the tree 
> according to the element numbers, or use some other (geometry-related) 
> sorting criterion.
> 
> Best,
> 
> Christophe
> 

-- 
Matt Gundry, PE

At Work		mjgundry at faa-engineers.com
Web		http://www.faa-engineers.com/~mjgundry/