<div dir="ltr"><div><div><div><div>Hello,<br><br></div>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.<br>
<br>I used the <b>ReadTemplate.cpp</b> source in <b>src/io </b>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:<br>
<br><b>mbImpl->write_file(filename.c_str(), "H5M", "PARALLEL=NONE");</b><br><br></div>It all goes well, the file is written and seems ok (checking the file through <b>hdfview</b> 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 <b>h5mvalidade</b> tool reports no problems.<br>
</div><br>However, with mixed meshes, regardless of element types or dimesion, <b>h5mvalidade</b> always reports at least 1 set with invalid content IDs. My code also breaks down when trying to read such files (<b>Leaked HDF5 object handle in function at ReadHDF5.cpp</b>).<br>
<br></div><div>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:<br>
<br></div><div><b>tstt/sets/list</b><br>1 -1 -1 10<br>3 -1 -1 10<br>5 -1 -1 10<br><br><b>tstt/sets/contents</b><br>3722<br>6944<br>3556<br>50<br>3606<br>116<br><br></div><div>I have no problem with this mesh. I can use <b>mbconvert</b> and see the mesh in paraview.<br>
<br></div><div>The mixed mesh (tri+quad), for the same geometry (NACA0012 airfoil) looks like this:<br><br><b>tstt/sets/list</b><br>1 -1 -1 10<br>3 -1 -1 10<br>5 -1 -1 10<br>7 -1 -1 10<br><br><b>tstt/sets/contents</b><br>
3722<br>6910<br>10632<br>17<br>3556<br>50<br>3606<br>116<br><br></div><div>Mesh has 3555 nodes, 6910 tris and 17 quads.<br></div><div><br></div><div><b>h5mvalidade</b> output:<br></div><div><br><b>Set 0 (ID 10649) has invalid content IDs.<br>
Set 1 (ID 10650) has invalid content IDs.<br>2 sets had invalid IDs in their content lists.</b><br><br></div><div>I tried reordering the way elements and sets are written to no success. In <b>src/io/mhdf/example/validade.c</b> (for the <b>h5mvalidade</b> tool), it seemed to me that the sequence of the ranges determine whether the sets are ok or not (<b>ranges_contained</b> function).<br>
<br>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):<br><br><b>tstt/sets/list</b><br>1 -1 -1 10<br>
3 -1 -1 10<br>5 -1 -1 10<br>7 -1 -1 10<br>9 -1 -1 10<br>11 -1 -1 10<br><br><b>tstt/sets/contents</b><br>513<br>69<br>582<br>349<br>428<br>22<br>450<br>23<br>473<br>20<br>493<br>20<br><br></div><div><b>h5mvalidate</b> has no problem with this mesh (<b>ranges_contained</b> 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!<br>
<br></div><div>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.<br><br></div><div>I read the mesh  in my code using:<br>
<b>mbImpl->load_file(meshFile.c_str(), &rootset, read_options.c_str());</b><br><br></div><div>Moreover, I am using <b>MOAB version 4.6.2</b>.<br></div><div><br></div><div>If anyone have already figured this out or can tell what I am doing wrong I will appreciate.<br>
<br></div><div>Thanks!<br>Carlos Breviglieri<br></div></div>