<div dir="ltr"><div>Hello again and thanks for the quick reply!<br><br></div><div>I have been able to find a bug with my code (the one that loaded data to h5m) and seems to be fine for mixed meshes. I have used the mbsize -ll trick and understood the fault, thanks Iulian!<br>
The h5mvalidade tool still complains but I can see past that.<br><br></div><div>The attached file is the one that seems to work for me now (naca0012 airfoil with 6910 tris + 17 quads, no parallel partitions, 2d_naca0012_mixed.h5m).<br>
<br>I also use METIS to partition my mesh and then push the PARALLEL_PARTITION tag/set data to h5m. It works ok for homogeneous mesh but I have problems with mixed meshes. I am looking into it right now. If I can figure out what I am doing wrong with mixed elements (actually multiple ranges) I'll let you know. I used the mbZoltan.cpp code to base my implementation on the parallel data creation.<br>
<br>If all goes well, I will test it against mbzoltan. By the way, is there a way to use mbzoltan in parallel with graph partitioners (parmetis, ptscotch)? mbzoltan tests if mpiComm.nprocs > 1 and then quits if otherwise...<br>
</div><div><br></div><div>I would be glad to share the CGNS reader code back to you. I need to fix the current issues and improve the code (add global_id data, etc). I read each CGNS section into a different tag/set in h5m, so I can easily retrieve those in application code. Not sure if this is the right way to do so (should follow the convention to place data into MATERIAL_SET / DIRICHILET NEUMANN ?) but seemed straightforward to me.<br>
<br>I have a CGNS writer class also in the works that I'll push back to the repo once it is working along with some sample meshes for unit tests.<br></div><div><br>I have patched the 4.6.2 sources to also include configuration flags (going the autotools way here) to point to cgns libraries and include paths. Is the CMake toolchain the official one?<br>
</div><div><br></div><div>Thank you,<br><br>regards,<br><br>Carlos<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 9, 2013 at 12:36 PM, Tim Tautges <span dir="ltr"><<a href="mailto:tautges@mcs.anl.gov" target="_blank">tautges@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In addition to Iulian's response:<br>
<br>
- we have an ftp site if the file is too big, let us know<br>
- I'd love to get a CGNS reader into MOAB, so if you'd be willing to donate that code, we'd gladly put it into MOAB (best approach would be to submit a pull request on Bitbucket)<br>
- we've used MOAB to do mixed topology meshes of same dimension before, easiest is to read two files into MOAB in succession (mbsize with multiple files specified will do that); but, reading the mesh from a single file should work fine too, so it's either a coding error in your read implementation or a MOAB bug<br>
<br>
- tim<div class="im"><br>
<br>
On 10/09/2013 09:04 AM, Iulian Grindeanu wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hello Carlos,<br>
<br>
I assume you have already seen this:<br>
<a href="http://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m" target="_blank">http://trac.mcs.anl.gov/<u></u>projects/ITAPS/wiki/MOAB/h5m</a><br>
Also, if you can compile visit (and have about 3 hours to spare :)), you would be able to see the h5m file directly.<br>
You can follow these instructions:<br>
<a href="http://trac.mcs.anl.gov/projects/ITAPS/wiki/VisIt" target="_blank">http://trac.mcs.anl.gov/<u></u>projects/ITAPS/wiki/VisIt</a><br>
Please see below,<br>
<br></div>
------------------------------<u></u>------------------------------<u></u>------------------------------<u></u>------------------------------<div class="im"><br>
<br>
Hello,<br>
<br>
I've recently began tweaking with MOAB for my PhD research and hit a snag regarding heterogeneous mesh. I mean, a<br>
tri + quad mesh in 2D, for instance, or an tetra+prism mesh in 3D.<br>
<br></div>
I used the *ReadTemplate.cpp* source in *src/io *as a base to feed my mesh data (CGNS format) to MOAB. After<div class="im"><br>
registering the nodes, connectivities and creating the sets (based on the ranges for each element type) I write them<br>
to an h5m file, using:<br>
<br></div>
*mbImpl->write_file(filename.<u></u>c_str(), "H5M", "PARALLEL=NONE");*<br>
<br>
If you read/write in serial, you do not need to use *"PARALLEL=NONE"*<br>
<br>
It all goes well, the file is written and seems ok (checking the file through *hdfview* seems allright). When I have<div class="im"><br>
homogeneous meshes (all tri, quad, tetra, hex) it is all fine, my code reads the h5m file and process it normally.<br></div>
The *h5mvalidade* tool reports no problems.<div class="im"><br>
<br>
I do not use h5mvalidate.<br>
<br>
<br></div>
However, with mixed meshes, regardless of element types or dimesion, *h5mvalidade* always reports at least 1 set<div class="im"><br>
with invalid content IDs.<br>
<br>
It could be a problem in h5mvalidate<br>
<br></div>
My code also breaks down when trying to read such files (*Leaked HDF5 object handle in function at ReadHDF5.cpp*).<div class="im"><br>
<br>
This is a real problem. I cannot say much more unless I see the file (or the whole content of h5dump )<br>
<br>
The problem seems to be related to the way I write the sets. Here is a sample for an all tri mesh (with edge<br>
elements for boundary conditions), with 6944 tris, 50 edges (farfield BC) and 116 edges (wall BC), the mesh has 3555<br>
nodes:<br>
<br></div>
*tstt/sets/list*<div class="im"><br>
1 -1 -1 10<br>
3 -1 -1 10<br>
5 -1 -1 10<br>
<br></div>
*tstt/sets/contents*<div class="im"><br>
3722<br>
6944<br>
3556<br>
50<br>
3606<br>
116<br>
<br>
According to this:<br>
<a href="http://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m" target="_blank">http://trac.mcs.anl.gov/<u></u>projects/ITAPS/wiki/MOAB/h5m</a><br>
your first set contains 6944 objects, that start at file id (object) 3722. The second set starts at 3556, and has 50<br>
objects. The third set starts at 3606, and has 116 objects. So far, it seems to agree with what you said are the contents.<br>
<br></div>
I have no problem with this mesh. I can use *mbconvert* and see the mesh in paraview.<div class="im"><br>
<br>
The mixed mesh (tri+quad), for the same geometry (NACA0012 airfoil) looks like this:<br>
<br></div>
*tstt/sets/list*<div class="im"><br>
1 -1 -1 10<br>
3 -1 -1 10<br>
5 -1 -1 10<br>
7 -1 -1 10<br>
<br></div>
*tstt/sets/contents*<div class="im"><br>
3722<br>
6910<br>
10632<br>
17<br>
3556<br>
50<br>
3606<br>
116<br>
<br>
Mesh has 3555 nodes, 6910 tris and 17 quads.<br>
<br>
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<br>
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<br>
1Mb;<br>
3722+6910 = 10632 so objects with the file id [3722-10631] are in set 0 (triangles, according to you)<br>
10632+17= 10649, so [10632-10648] are in set 1 (quads?)<br>
[3556: 3556+50-1] are in set 2 (edges?)<br>
[3606 - 3606+116-1] are in set 3 (edges?)<br>
<br></div>
*h5mvalidade* output:<br>
<br>
*Set 0 (ID 10649) has invalid content IDs.<div class="im"><br>
Set 1 (ID 10650) has invalid content IDs.<br></div>
2 sets had invalid IDs in their content lists.*<br>
<br>
I tried reordering the way elements and sets are written to no success. In *src/io/mhdf/example/validade.<u></u>c* (for the<br>
*h5mvalidade* tool), it seemed to me that the sequence of the ranges determine whether the sets are ok or not<br>
(*ranges_contained* function).<div class="im"><br>
<br>
Interestingly enough, another mesh with mixed (tri+quad) works, with a larger quantity of quads than tris, 69 tris,<br>
349 quads (22, 24, 20 and 20 are edge elements for BCs):<br>
<br>
<br>
<br></div>
*tstt/sets/list*<div class="im"><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></div>
*tstt/sets/contents*<div class="im"><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>
*h5mvalidate* has no problem with this mesh (*ranges_contained* loop break condition is met for this specific ratio<div class="im"><br>
of quad and tris , count -= avail). But it does not seem to me that is right after all. However, my code reads the<br>
mesh with no problems and I can even convert and visualize it, and it is all right!<br>
<br>
I have not found an h5m example with mixed elements (with the same topology dimension). There are hex+quads,<br>
tetra+tris, but no tetra+prism or tri+quad for example.<br>
<br>
I read the mesh in my code using:<br></div>
*mbImpl->load_file(meshFile.c_<u></u>str(), &rootset, read_options.c_str());*<br>
<br>
Moreover, I am using *MOAB version 4.6.2*.<div class="im"><br>
<br>
If anyone have already figured this out or can tell what I am doing wrong I will appreciate.<br>
<br>
Thanks!<br>
Carlos Breviglieri<br>
<br>
<br>
If you can read the file, you can also use mbsize -ll <file> to dump the contents. it will be more "friendly" in terms<br>
of set contents.<br>
<br>
Hope this helps,<br>
Iulian<br>
</div></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
==============================<u></u>==============================<u></u>====<br>
"You will keep in perfect peace him whose mind is<br>
steadfast, because he trusts in you." Isaiah 26:3<br>
<br>
Tim Tautges Argonne National Laboratory<br>
(<a href="mailto:tautges@mcs.anl.gov" target="_blank">tautges@mcs.anl.gov</a>) (telecommuting from UW-Madison)<br>
phone (gvoice): <a href="tel:%28608%29%20354-1459" value="+16083541459" target="_blank">(608) 354-1459</a> 1500 Engineering Dr.<br>
fax: <a href="tel:%28608%29%20263-4499" value="+16082634499" target="_blank">(608) 263-4499</a> Madison, WI 53706<br>
<br>
</font></span></blockquote></div><br></div>