<div dir="ltr"><div dir="ltr">On Thu, Sep 8, 2022 at 7:44 AM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu">quentin.chevalier@polytechnique.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello PETSc users !<br><br>I'm trying to use PETSc routine to read and write complex vectors to binary files in parallel.<br><br><div>I'm using dolfinx and petsc4py inside a docker container. My end goal is to write a dolfinx Function object to file, then read it again.</div><div><br></div><div>My current code goes something like :</div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><div></div><div><span style="color:rgb(156,220,254)">viewer</span><span style="color:rgb(212,212,212)"> = </span><span style="color:rgb(78,201,176)">pet</span><span style="color:rgb(212,212,212)">.Viewer().createHDF5(</span><span style="color:rgb(206,145,120)">"file.h5"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">'w'</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(156,220,254)">comm</span><span style="color:rgb(212,212,212)">)</span></div><div>function<span style="color:rgb(212,212,212)">.</span><span style="color:rgb(156,220,254)">vector</span><span style="color:rgb(212,212,212)">.view(</span><span style="color:rgb(156,220,254)">viewer</span><span style="color:rgb(212,212,212)">)</span></div></div><div><br></div><div>And fails with traceback :<br></div><div>petsc4py.PETSc.Error: error code 86<br>[9] PetscViewerSetType() at /usr/local/petsc/src/sys/classes/viewer/interface/viewreg.c:435<br>[9] Unknown type. Check for miss-spelling or missing package: <a href="https://petsc.org/release/install/install/#external-packages" target="_blank">https://petsc.org/release/install/install/#external-packages</a><br>[9] Unknown PetscViewer type given: hdf5</div><div><br></div><div>The relevant functions show on pydoc, what am I doing wrong ?</div></div></blockquote><div><br></div><div>You have not built PETSc with HDF5 support. In order to do this, you need to configure it using --with-hdf5-dir=/path/to/hdf5 or maybe --download-hdf5.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Cheers,<br></div><div><br></div>Quentin</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>