[MOAB-dev] h5m: class attribute in tags
Nico Schlömer
nico.schloemer at gmail.com
Thu Nov 12 04:10:08 CST 2015
> How do you install h5py? serial or parallel? I was trying to play with
your meshio, but I need more stuff installed
The `requirements.txt` should list ist all;
```
pip install -r requirements.txt
```
might also help. h5py is needed in serial.
Thanks for the explanation about the tags. I'm now at another error
message, namely
```
[0]MOAB ERROR: Incorrect DataSpace for DataSet.!
[0]MOAB ERROR: is_error() line 105 in ReadHDF5.hpp
```
No idea what that wants to say. I'm getting it for the data at [1]. Any
idea what might be going wrong?
The respective code is at [2] btw.
Cheers,
Nico
[1] http://chunk.io/f/2f94e4ab6bbe458fbdc1d3a3f7edb624
[2] https://github.com/nschloe/meshio/blob/master/meshio/writer.py#L106
On Wed, Nov 11, 2015 at 10:25 PM Grindeanu, Iulian R. <iulian at mcs.anl.gov>
wrote:
> How do you install h5py? serial or parallel? I was trying to play with
> your meshio, but I need more stuff installed
>
> I was wrong before,
> class attribute is an integer attribute, with a value corresponding to the
> storage type
>
> /** \brief Was dense tag data in mesh database */
> #define mhdf_DENSE_TYPE 2
> /** \brief Was sparse tag data in mesh database */
> #define mhdf_SPARSE_TYPE 1
> /** \brief Was bit-field tag data in mesh database */
> #define mhdf_BIT_TYPE 0
> /** \brief Unused */
> #define mhdf_MESH_TYPE 3
>
> the storage type is set here:
> ./src/io/mhdf/src/tags.c
> hid_t create_tag_common( mhdf_FileHandle file_handle,
> const char* tag_name,
> enum mhdf_TagDataType tag_type,
> int size,
> int storage,
> const void* default_value,
> int default_value_size_in,
> const void* global_value,
> int global_value_size_in,
> hid_t hdf_type,
> hid_t hdf_base_type,
> mhdf_Status* status )
>
> about line 340:
> rval = mhdf_create_scalar_attrib( tag_id,
> TAG_TYPE_ATTRIB, // this is "class"
> H5T_NATIVE_INT,
> &storage,
> status );
>
> tag_id is the group id associated with the tag
>
>
>
> the storage type is retrieved in the hdf5 writer with a code like this
>
> // Get tag properties
> rval = iFace->tag_get_type(tag_data.tag_id,
> mb_storage);CHK_MB_ERR_0(rval);
> switch (mb_storage) {
> case MB_TAG_DENSE:
> storage = mhdf_DENSE_TYPE;
> break;
> case MB_TAG_SPARSE:
> storage = mhdf_SPARSE_TYPE;
> break;
> case MB_TAG_BIT:
> storage = mhdf_BIT_TYPE;
> break;
> case MB_TAG_MESH:
> storage = mhdf_MESH_TYPE;
> break;
> default:
> return error(MB_FAILURE);
> }
>
>
> ------------------------------
> *From:* Nico Schlömer [nico.schloemer at gmail.com]
> *Sent:* Wednesday, November 11, 2015 1:01 PM
> *To:* Grindeanu, Iulian R.; moab-dev at mcs.anl.gov
> *Subject:* Re: [MOAB-dev] h5m: class attribute in tags
>
> > Or do you try to understand how are the data / tags stored?
>
> Indeed. I've converted a bunch of files to h5m using MeshIO [1], but found
> that they couldn't be read into MOAB because of a missing class attribute.
>
> > class would correspond to the type of the tag (integer, double, opaque,
> etc)
>
> Could you give more detail here?
>
> Cheers,
> Nico
>
>
> [1] https://pypi.python.org/pypi/meshio
>
> On Wed, Nov 11, 2015 at 7:55 PM Grindeanu, Iulian R. <iulian at mcs.anl.gov>
> wrote:
>
>> Hi Nico,
>>
>> Not sure what are you trying to do here.
>> Do you need to improve the h5m reader writer? Or do you try to understand
>> how are the data / tags stored?
>>
>> Do you have a specific problem/bug ?
>> Suggestions for improvement?
>>
>> All these attributes are part of specific moab conventions and hdf5
>> format. Not much documentation, except what you already found.
>>
>> class would correspond to the type of the tag (integer, double, opaque,
>> etc)
>> default would be the default value
>>
>> global is used if the tag is "global", in the sense it refers to the
>> whole mesh instance
>>
>> "The tag sub-group may have any or all of the following four attributes:
>> default, global, is_handle, and variable_length. The default attribute,
>> if present, must contain a single tag value that is to be considered the
>> 'default' value of the tag. The global attribute, if present, must
>> contain a single tag value that is the value of the tag as set on the mesh
>> instance (MOAB terminology) or root set (ITAPS terminology.) The presence
>> of the is_handle attribute (the value, if any, is meaningless) indicates
>> that the tag values are to be considered entity IDs."
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------
>> *From:* moab-dev-bounces at mcs.anl.gov [moab-dev-bounces at mcs.anl.gov] on
>> behalf of Nico Schlömer [nico.schloemer at gmail.com]
>> *Sent:* Wednesday, November 11, 2015 3:43 AM
>> *To:* moab-dev at mcs.anl.gov
>> *Subject:* [MOAB-dev] h5m: class attribute in tags
>>
>> Hi everyone,
>>
>> In h5m files [1], I see that tstt->tags typically have three attributes:
>>
>> * class
>> * default
>> * global
>>
>> Where can I find documentation on these attributes?
>>
>> Cheers,
>> Nico
>>
>> [1] https://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20151112/2dd652e3/attachment.html>
More information about the moab-dev
mailing list