[MOAB-dev] mixed mesh question

Tim Tautges tautges at mcs.anl.gov
Wed Oct 9 10:36:59 CDT 2013


In addition to Iulian's response:

- we have an ftp site if the file is too big, let us know
- 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)
- 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

- tim

On 10/09/2013 09:04 AM, Iulian Grindeanu wrote:
> 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,
>
> ------------------------------------------------------------------------------------------------------------------------
>
>     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

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
  phone (gvoice): (608) 354-1459      1500 Engineering Dr.
             fax: (608) 263-4499      Madison, WI 53706



More information about the moab-dev mailing list