[MOAB-dev] mixed mesh question
Carlos Breviglieri
carbrevi at gmail.com
Wed Oct 9 11:02:43 CDT 2013
Hello again and thanks for the quick reply!
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!
The h5mvalidade tool still complains but I can see past that.
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).
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.
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...
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.
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.
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?
Thank you,
regards,
Carlos
On Wed, Oct 9, 2013 at 12:36 PM, Tim Tautges <tautges at mcs.anl.gov> wrote:
> 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<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<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<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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20131009/ceb7ed6c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2d_naca0012_mixed.h5m
Type: application/octet-stream
Size: 316412 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20131009/ceb7ed6c/attachment-0001.obj>
More information about the moab-dev
mailing list