XDMF access for HDF5 compound Datatype Elements


#1

Hi,
I have a compound datatype with 2 elements, created as follows :

hsize_t cmpd_size=sizeof(some_struct);
hid_t cmpd_dtype_id=H5Tcreate(H5T_COMPOUND,cmpd_size);
hsize_t array_size[1]={N};
status=H5Tinsert(cmpd_dtype_id, "Var_1", HOFFSET(some_struct,Var1),H5T_NATIVE_DOUBLE);
hid_t array_dtype_id=H5Tarray_create(H5T_NATIVE_DOUBLE, 1, array_size);
status=H5Tinsert(cmpd_dtype_id,"Var2",HOFFSET(some_struct,Var2[0]),array_dtype_id);
hid_t dataset_id=H5Dcreate(file_id,"All_VAR",cmpd_dtype_id,dataspace_id,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);

The some_struct structure is defined as follows :

some_struct{
    double Var1;
    double Var2[N];
}

Now I am trying to write a xdmf file to access these data. I under stand that simple datatypes can be accessed by:

        <Attribute Name="Var" AttributeType="Scalar" Center="Cell">
               <DataItem Dimensions="20 30" NumberType="Float" Precision="4" Format="HDF">
               <xdmf2d.h5:/Var>
               </DataItem>
         <\Attribute>

Could you please help me with writing the same to access elements of the compound datatype…

Thanks in advance