[MOAB-dev] DMMoabGetMaterialBlock

Vijay S. Mahadevan vijay.m at gmail.com
Tue Dec 9 10:15:56 CST 2014


DMMoabGetMaterialBlock is a simple call internally to directly access
the tag data for MATERIAL_SET defined on the entity requested. By
default, all entities could contain a value (-1) and so it is possible
that your mesh does not have a material value assigned for the
element. If you have a small enough mesh file (h5m/exo) where you can
replicate this, I can see what is going on.

> "Thus, a materrial set in MOAB is unlikely to contain mesh entities directly; rather, that set
> contains other sets which contain mesh entities. In these cases, mesh entities can be retrieved by
> passing a "recursive" flag to the appropriate function (MOAB), or by calling the getEntitiesRec
> extension function (iMesh) provided by MOAB."

This is partly true but not always the case. A set can contain other
sets or entities directly. This depends on how you created the mesh
(package/format) or if you created it yourself in memory and assigned
some data. Either way, it should find the data defined on the queried
entity. The recursive flag is required when you are trying to access
all entities in a set i.e., if you query a set containing other sets,
you will need recursive flag set or else you will not get all the
entities as expected.

Iulian, do we need to update the documentation ?

Vijay

On Tue, Dec 9, 2014 at 7:42 AM, Gerd Heber <gheber at hdfgroup.org> wrote:
> I'm trying to use DMMoabGetMaterialBlock to read an element's material ID,
> however I'm getting -1 for all elements. I have a nice MATERIAL_SET tag in
> my MOAB file. Is this related to the following comment in the MOAB documentation?
>
> "Thus, a materrial set in MOAB is unlikely to contain mesh entities directly; rather, that set
> contains other sets which contain mesh entities. In these cases, mesh entities can be retrieved by
> passing a "recursive" flag to the appropriate function (MOAB), or by calling the getEntitiesRec
> extension function (iMesh) provided by MOAB."
>
> (http://ftp.mcs.anl.gov/pub/fathom/moab-docs/md-contents.html)
>
> If so, how do I enable the "recursive" flag from PETSc? Maybe I'm barking up the wrong tree...
>
> Thanks for your help.
> G.


More information about the moab-dev mailing list