[petsc-users] Required structure and attrs for MatLoad from hdf5

Sajid Ali sajidsyed2021 at u.northwestern.edu
Tue Feb 4 18:30:46 CST 2020


Hi PETSc-developers,

The example src/mat/examples/tutorials/ex10.c shows how one would read a
matrix from a hdf5 file. Since MatView isn’t implemented for hdf5_mat
format, how is the hdf5 file (to be used to run ex10) generated ?

I tried reading from an hdf5 file but I saw an error stating object 'jc'
doesn't exist and thus would like to know how I should store a sparse
matrix in an hdf5 file so that MatLoad works.

PS: I’m guessing that MATLAB stores the matrix in the format that PETSc
expects (group/dset/attrs) but I’m creating this from Python. If the
recommended approach is to transfer numpy arrays to PETSc matrices via
petsc4py, I’d switch to that instead of directly creating hdf5 files.

Thank You,
Sajid Ali | PhD Candidate
Applied Physics
Northwestern University
s-sajid-ali.github.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200204/d65f521d/attachment.html>


More information about the petsc-users mailing list