Usenet.com

www.Usenet.com

Group Index

Sci Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

HDF5 Composite Datatypes and Variable Length



Hi,

I'm relatively new to the HDF5 format, and I'm currently trying to
evaluate it's use for FEA (Finite Element Analysis).  I've gone
through the tutorials for HDF5 and I'm now reading through the User's
Guide.  I need to know if it's possible to write a Compound Datatype
which contains a variable data member.

For example, I've got a node data structure here.

struct node_t {
        float x;
        float y;
        float z;
};

Now, each node can be part of one or more elements.  Each element can
have any number of nodes.  The data structure that I'm thinking of
using is something like this.

struct element_t {
        int num_nodes;
        node_t* node;
}

i.e., an element can potential have 3 nodes, 5 nodes, 100 nodes, or
just one node.  I'd rather not limit myself to writing a fixed size
array for the nodes, since this both wastes space and access time, as
well as making it inflexible.

All the documentation that I've read so far seems to suggest that the
H5 datatypes should be static in size.  Is there anyway around this? 
I've seen a very short blurb about Variable Length Composite Types in
the User's Guide, but have yet to read that far.  I guess another
alternative is to treat each element as a group and write the node
numbers as datasets into each group, but one would think there must be
a better way.

Is what I'm doing possible?  If so, what might be the best way to
define my datatypes, dataspace, dataset?

thanks,
Yicheng



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.