<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">Hi PETSc-developers, </p>
<p style="margin:0px 0px 1.2em!important">The example <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">src/mat/examples/tutorials/ex10.c</code> shows how one would read a matrix from a hdf5 file. Since <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">MatView</code> isn’t implemented for hdf5_mat format, how is the hdf5 file (to be used to run <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">ex10</code>) generated ? </p>
<p style="margin:0px 0px 1.2em!important">I tried reading from an hdf5 file but I saw an error stating <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">object 'jc' doesn't exist</code> and thus would like to know how I should store a sparse matrix in an hdf5 file so that <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">MatLoad</code> works. </p>
<p style="margin:0px 0px 1.2em!important">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 <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">petsc4py</code>, I’d switch to that instead of directly creating hdf5 files.</p>
<p style="margin:0px 0px 1.2em!important">Thank You,<br>Sajid Ali | PhD Candidate<br>Applied Physics<br>Northwestern University<br><a href="http://s-sajid-ali.github.io">s-sajid-ali.github.io</a></p>
<div title="MDH:PGRpdj48ZGl2PkhpIFBFVFNjLWRldmVsb3BlcnMsIDxicj48YnI+PC9kaXY+VGhlIGV4YW1wbGUg
YHNyYy9tYXQvZXhhbXBsZXMvdHV0b3JpYWxzL2V4MTAuY2Agc2hvd3MgaG93IG9uZSB3b3VsZCBy
ZWFkIGEgbWF0cml4IGZyb20gYSBoZGY1IGZpbGUuIFNpbmNlIGBNYXRWaWV3YCBpc24ndCBpbXBs
ZW1lbnRlZCBmb3IgaGRmNV9tYXQgZm9ybWF0LCBob3cgaXMgdGhlIGhkZjUgKHRvIGJlIHVzZWQg
dG8gcnVuIGBleDEwYCkgZ2VuZXJhdGVkID8gPGJyPjxicj5JIHRyaWVkIHJlYWRpbmcgZnJvbSBh
biBoZGY1IGZpbGUgYnV0IEkgc2F3IGFuIGVycm9yIHN0YXRpbmcgYG9iamVjdCAnamMnIGRvZXNu
J3QgZXhpc3RgIGFuZCB0aHVzIHdvdWxkIGxpa2UgdG8ga25vdyBob3cgSSBzaG91bGQgc3RvcmUg
YSBzcGFyc2UgbWF0cml4IGluIGFuIGhkZjUgZmlsZSBzbyB0aGF0IGBNYXRMb2FkYCB3b3Jrcy4g
PGJyPjxicj48L2Rpdj48ZGl2PlBTOiBJJ20gZ3Vlc3NpbmcgdGhhdCBNQVRMQUIgc3RvcmVzIHRo
ZSBtYXRyaXggaW4gdGhlIGZvcm1hdCB0aGF0IFBFVFNjIGV4cGVjdHMgKGdyb3VwL2RzZXQvYXR0
cnMpIGJ1dCBJJ20gY3JlYXRpbmcgdGhpcyBmcm9tIFB5dGhvbi4gSWYgdGhlIHJlY29tbWVuZGVk
IGFwcHJvYWNoIGlzIHRv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