[MOAB-dev] mixed mesh question

Carlos Breviglieri carbrevi at gmail.com
Wed Oct 9 08:04:11 CDT 2013


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");*

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.

However, with mixed meshes, regardless of element types or dimesion, *
h5mvalidade* always reports at least 1 set with invalid content IDs. My
code also breaks down when trying to read such files (*Leaked HDF5 object
handle in function at ReadHDF5.cpp*).

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

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.

*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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20131009/37882004/attachment.html>


More information about the moab-dev mailing list