[Paraview] storing tensors in hdf5?
Pratik Mallya
pratik.mallya at gmail.com
Mon Apr 11 13:39:47 EDT 2011
Pratik Mallya wrote:
> Pratik Mallya wrote:
>> Well, that is why i chose the subject title to be so :).
>> In particular, I since I am using numpy (and h5py) to calculate the
>> tensor, I am storing the result (a 256X256X9 ndarray named Q) into h5
>> file by using a command of the form:
>> g.create_dataset("Q", data=Q)
>> Does the problem lie here? Am i supposed to use a different
>> format/function of h5py, or something? Because I can see the .h5
>> file using hdfview, and it seems perfectly all right.
>>
>>
> I figured out a workaround: although my h5 file has nine component(3
> are redundant since it is a symmetric tensor) i am reading it as a 6
> component tensor, and paraview is now able to read it!
> I wonder why this is the case? I have already detailed the code in
> previous mail; can someone please tell me why it is working like this?
>
> Thanks in anticipation.
>
Well...no one seemed to have cared to reply.
Anyways, it turns out that in the xdmf file, if you supply the dimension
as one less than what is present in the .h5 file, then the xdmf reader
can properly read the thing. e.g since the tensors i was storing were in
the shape (1,9) (each tensor), i gave the topology as "1 8", and then it
read the data, no complaints and perfect plot :).
--
*Pratik Mallya*
http://en.wikipedia.org/wiki/User:Pratik.mallya
More information about the ParaView
mailing list