<div dir="ltr">Thanks everyone; I'll plow my way through the format, trying to integrate it better with the conversion tools I have at hand. Once I'm through that I think I'll be able to integrate it with my application too.<div><br></div><div>Something that would have helped me avoid this extra work is MOAB offering first-class support for an established standard format (Exodus, VTK, XDMF come to mind).</div><div><br></div><div>Anyhow, I'll probably ask one or two more questions about the format here, so your help is still appreciated! :)</div><div><br></div><div>--Nico</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 9, 2015 at 5:55 AM Vijay S. Mahadevan <<a href="mailto:vijay.m@gmail.com">vijay.m@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nico, as Patrick mentioned, Tags are the abstract ways to represent,<br>
serialize and manipulate data associated with entities in a MOAB mesh.<br>
Tags can be associated directly with entities such as vertex or<br>
element, or you could choose to create sets of entities and associate<br>
data to these sets. So based on this degree of representation, we have<br>
the terminology that a tag can be dense or sparse. This is just an<br>
internal way to store these tags to optimize memory layout and does<br>
slightly affect how data is serialized/read-back to/from h5m files.<br>
<br>
Now in terms of usage, just get the tag handle, and you can either<br>
read or write to the tag by using tag_get_data and tag_set_data<br>
respectively.<br>
<br>
The SetsNTags [1], VisTags [2] examples show how to read the data<br>
stored in h5m. You can use set_tag_data to write this a priori. If<br>
needed, we can also create a simplistic example to create/manipulate<br>
tag data on a mesh, but I think this may be overkill. Let me know if<br>
this would help though.<br>
<br>
Vijay<br>
<br>
[1] <a href="ftp://ftp.mcs.anl.gov/pub/fathom/moab-docs/SetsNTags_8cpp-example.html" rel="noreferrer" target="_blank">ftp://ftp.mcs.anl.gov/pub/fathom/moab-docs/SetsNTags_8cpp-example.html</a><br>
[2] <a href="ftp://ftp.mcs.anl.gov/pub/fathom/moab-docs/VisTags_8cpp-example.html" rel="noreferrer" target="_blank">ftp://ftp.mcs.anl.gov/pub/fathom/moab-docs/VisTags_8cpp-example.html</a><br>
<br>
On Sun, Nov 8, 2015 at 8:32 PM, Patrick Shriwise <<a href="mailto:shriwise@wisc.edu" target="_blank">shriwise@wisc.edu</a>> wrote:<br>
> Hey Nico,<br>
><br>
> Ok. There doesn't appear to be a great example for applying data. Applying<br>
> data works in a very similar way to the way you retrieve tagged data, using<br>
> tag_set_data with a Tag which can be created for a certain type of data with<br>
> a given name by calling tag_get_handle with the MBCREAT option at the end.<br>
> I'd like to be clear that you can apply/retrieve data from MOAB Entities or<br>
> MOAB EntitySets. So you can either apply data directly to entities like<br>
> vertices or you can group them together in a set and apply data to that set<br>
> instead. For the purpose you're indicating, it sounds like it'd be best to<br>
> apply the data directly to the vertices.<br>
><br>
> Sample code for creating a MOAB Tag:<br>
> Tag name_tag;<br>
> rval = mdbImpl->tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE,<br>
> MB_TYPE_OPAQUE,<br>
> name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);<br>
> Cheers,<br>
><br>
> Patrick C. Shriwise<br>
> Research Fellow<br>
> University of Wisconsin - Madison<br>
> Engineering Research Building - Rm. 428<br>
> 1500 Engineering Drive<br>
> Madison, WI 53706<br>
> (608) 446-8173<br>
><br>
> On 11/08/15 21:01, Nico Schlömer wrote:<br>
><br>
> In both ways, actually. I need to build h5m files from data and I need to<br>
> extract data from h5m meshes.<br>
> With [1], I'm digging my way through understanding the sets group now.<br>
><br>
> --Nico<br>
><br>
> [1] <a href="https://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m" rel="noreferrer" target="_blank">https://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m</a><br>
><br>
> On Mon, Nov 9, 2015 at 2:53 AM Patrick Shriwise <<a href="mailto:shriwise@wisc.edu" target="_blank">shriwise@wisc.edu</a>> wrote:<br>
>><br>
>> Hi Nico,<br>
>><br>
>> I see. I may have misunderstood your problem. It seems you're trying to<br>
>> apply data to the mesh. Is that right?<br>
>><br>
>><br>
>> Cheers,<br>
>><br>
>> Patrick C. Shriwise<br>
>> Research Fellow<br>
>> University of Wisconsin - Madison<br>
>> Engineering Research Building - Rm. 428<br>
>> 1500 Engineering Drive<br>
>> Madison, WI 53706<br>
>> (608) 446-8173<br>
>><br>
>> On 11/08/15 20:03, Nico Schlömer wrote:<br>
>><br>
>> Thanks Patrick for your reply.<br>
>><br>
>> I'm still having problems where data should be stores. In a h5m file, I<br>
>> see tags, I see sets with tags in them, and it seems they are somehow<br>
>> related, but I don't know where and how to put the actual data. I would help<br>
>> to see a file with some mesh and a custom data element in it, e.g., an array<br>
>> of values associated with the vertices.<br>
>><br>
>> Cheers,<br>
>> Nico<br>
>><br>
>> On Sun, Nov 8, 2015 at 9:20 PM Patrick Shriwise <<a href="mailto:shriwise@wisc.edu" target="_blank">shriwise@wisc.edu</a>> wrote:<br>
>>><br>
>>> Hi Nico,<br>
>>><br>
>>> The vertex data should be stored in MOAB tags. You can access these tags<br>
>>> via their name. There is a set of conventions for the tag names in an Exodus<br>
>>> file (here I think). However, if the tag has a custom name and isn't<br>
>>> recognized by the Exodus reader, then the data might not be read in from the<br>
>>> Exodus file and as a result won't be saved into the .h5m. Do you have an<br>
>>> idea of what the tag name might be for your data?<br>
>>><br>
>>> There's also a good example here of how to access the tag data on an<br>
>>> entity. The example I linked you to accesses EntitySets rather than<br>
>>> Entities, but they work the same way.<br>
>>><br>
>>> If you think the data might be in the .h5m, you can use<br>
>>> tag_get_tags_on_entity to get all of the tags on a vertex and then check for<br>
>>> the tag data you're looking for. An easier way of doing this in the cmd line<br>
>>> is by using mbsize -t <your_file>.h5m to print out the count by tag.<br>
>>><br>
>>> Hope this helps!<br>
>>><br>
>>> Cheers,<br>
>>><br>
>>> Patrick C. Shriwise<br>
>>> Research Fellow<br>
>>> University of Wisconsin - Madison<br>
>>> Engineering Research Building - Rm. 428<br>
>>> 1500 Engineering Drive<br>
>>> Madison, WI 53706<br>
>>> (608) 446-8173<br>
>>><br>
>>> On 11/08/15 13:43, Nico Schlömer wrote:<br>
>>><br>
>>> Hi everyone,<br>
>>><br>
>>> I have an Exodus file with vertex data in it (i.e., "a function" defined<br>
>>> on the vertices). When converting this file to h5m, where does the vertex<br>
>>> data go? And how to I retrieve the data after having it read with<br>
>>> `load_file()`?<br>
>>><br>
>>> Cheers,<br>
>>> Nico<br>
>>><br>
>>><br>
>><br>
><br>
</blockquote></div>