[MOAB-dev] mixed mesh question

Iulian Grindeanu iulian at mcs.anl.gov
Wed Oct 9 09:04:35 CDT 2013


Hello Carlos, 

I assume you have already seen this: 
http://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m 
Also, if you can compile visit (and have about 3 hours to spare :)), you would be able to see the h5m file directly. You can follow these instructions: 
http://trac.mcs.anl.gov/projects/ITAPS/wiki/VisIt 
Please see below, 

----- Original Message -----

| Hello,

| I've recently began tweaking with MOAB for my PhD research and hit a
| snag regarding heterogeneous mesh. I mean, a tri + quad mesh in 2D,
| for instance, or an tetra+prism mesh in 3D.

| I used the ReadTemplate.cpp source in src/io as a base to feed my
| mesh data (CGNS format) to MOAB. After registering the nodes,
| connectivities and creating the sets (based on the ranges for each
| element type) I write them to an h5m file, using:

| mbImpl->write_file(filename.c_str(), "H5M", "PARALLEL=NONE");

If you read/write in serial, you do not need to use "PARALLEL=NONE" 
| It all goes well, the file is written and seems ok (checking the file
| through hdfview seems allright). When I have homogeneous meshes (all
| tri, quad, tetra, hex) it is all fine, my code reads the h5m file
| and process it normally. The h5mvalidade tool reports no problems.

I do not use h5mvalidate. 

| However, with mixed meshes, regardless of element types or dimesion,
| h5mvalidade always reports at least 1 set with invalid content IDs.
It could be a problem in h5mvalidate 

| My code also breaks down when trying to read such files ( Leaked HDF5
| object handle in function at ReadHDF5.cpp ).

This is a real problem. I cannot say much more unless I see the file (or the whole content of h5dump ) 

| The problem seems to be related to the way I write the sets. Here is
| a sample for an all tri mesh (with edge elements for boundary
| conditions), with 6944 tris, 50 edges (farfield BC) and 116 edges
| (wall BC), the mesh has 3555 nodes:

| tstt/sets/list
| 1 -1 -1 10
| 3 -1 -1 10
| 5 -1 -1 10

| tstt/sets/contents
| 3722
| 6944
| 3556
| 50
| 3606
| 116

According to this: 
http://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m 
your first set contains 6944 objects, that start at file id (object) 3722. The second set starts at 3556, and has 50 objects. The third set starts at 3606, and has 116 objects. So far, it seems to agree with what you said are the contents. 

| I have no problem with this mesh. I can use mbconvert and see the
| mesh in paraview.

| The mixed mesh (tri+quad), for the same geometry (NACA0012 airfoil)
| looks like this:

| tstt/sets/list
| 1 -1 -1 10
| 3 -1 -1 10
| 5 -1 -1 10
| 7 -1 -1 10

| tstt/sets/contents
| 3722
| 6910
| 10632
| 17
| 3556
| 50
| 3606
| 116

| Mesh has 3555 nodes, 6910 tris and 17 quads.

maybe it is a problem with h5mvalidate. I can't tell more unless I have the h5m file :(. Is it too big to attach? Or can you put it somewhere I can get to it? It should not be too big. Unless you have some data in it, it should be less than 1Mb; 
3722+6910 = 10632 so objects with the file id [3722-10631] are in set 0 (triangles, according to you) 
10632+17= 10649, so [10632-10648] are in set 1 (quads?) 
[3556: 3556+50-1] are in set 2 (edges?) 
[3606 - 3606+116-1] are in set 3 (edges?) 

| h5mvalidade output:

| Set 0 (ID 10649) has invalid content IDs.
| Set 1 (ID 10650) has invalid content IDs.
| 2 sets had invalid IDs in their content lists.

| I tried reordering the way elements and sets are written to no
| success. In src/io/mhdf/example/validade.c (for the h5mvalidade
| tool), it seemed to me that the sequence of the ranges determine
| whether the sets are ok or not ( ranges_contained function).

| Interestingly enough, another mesh with mixed (tri+quad) works, with
| a larger quantity of quads than tris, 69 tris, 349 quads (22, 24, 20
| and 20 are edge elements for BCs):

| tstt/sets/list
| 1 -1 -1 10
| 3 -1 -1 10
| 5 -1 -1 10
| 7 -1 -1 10
| 9 -1 -1 10
| 11 -1 -1 10

| tstt/sets/contents
| 513
| 69
| 582
| 349
| 428
| 22
| 450
| 23
| 473
| 20
| 493
| 20

| h5mvalidate has no problem with this mesh ( ranges_contained loop
| break condition is met for this specific ratio of quad and tris ,
| count -= avail). But it does not seem to me that is right after all.
| However, my code reads the mesh with no problems and I can even
| convert and visualize it, and it is all right!

| I have not found an h5m example with mixed elements (with the same
| topology dimension). There are hex+quads, tetra+tris, but no
| tetra+prism or tri+quad for example.

| I read the mesh in my code using:
| mbImpl->load_file(meshFile.c_str(), &rootset, read_options.c_str());

| Moreover, I am using MOAB version 4.6.2 .

| If anyone have already figured this out or can tell what I am doing
| wrong I will appreciate.

| Thanks!
| Carlos Breviglieri

If you can read the file, you can also use mbsize -ll <file> to dump the contents. it will be more "friendly" in terms of set contents. 

Hope this helps, 
Iulian 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20131009/147929ab/attachment.html>


More information about the moab-dev mailing list