It might be possible to read data directly into a std::vector<std::vector<T> >
using the variable length data type API of HDF5 by defining appropriate
memory allocation/release callback functions, but it would be very
inefficient.
The question is do you really have a 3D structure that can have a
variable number of elements in each dimensions, such as provided
by std::vector<std::vector<std::vector<> > > >, or can you simplify
the problem by knowing that each 2D slice in this 3D structure has
the same number of elements, and each 2D slice has the same number
of columns?
Usually for the CFD data that I had been working with data are of
equal size in each dimension, so they actually are 3D arrays rather
than nested vectors of different lengths.
Werner
On Wed, 30 Jun 2010 05:11:18 -0500, <[email protected]> wrote:
Hello programmers :-),
I'm still new to this HDF file format, and what I could do is run the C++
examples given in the tutorial to read a pressures data file given to me
by someone.
My first question is, is it possible to read the values of my H5 file to a
vector? all I've seen is array works, which is not convenient when working
generally with different sizes of data files (the files I'm using are 3D
matrices).
So what I would like to do, is having a program in this scheme:
1-Read the file and determine the data type and size
2-create a 3D vector for reading the data (like vector< vector< vector<
double > > > data;)
3-copy the data from the file to this vector.
is this possible with the current library?
My second question, is there a function in the library to read a single
element? I just found a function for reading a whole set into an array in
the tutorial:
status = H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
dset_data);
If there's a tutorial that is more detailed than this, or let's say a
manual, I'd be so happy to know about its existence.
Thank you, any efforts are highly appreciated.
Best regards,
Samer
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
--
___________________________________________________________________________
Dr. Werner Benger Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
211 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org