[petsc-users] Read and write HDF5 files

Quentin Chevalier quentin.chevalier at polytechnique.edu
Thu Sep 8 06:43:15 CDT 2022


Hello PETSc users !

I'm trying to use PETSc routine to read and write complex vectors to binary
files in parallel.

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.

My current code goes something like :
viewer = pet.Viewer().createHDF5("file.h5", 'w', comm)
function.vector.view(viewer)

And fails with traceback :
petsc4py.PETSc.Error: error code 86
[9] PetscViewerSetType() at
/usr/local/petsc/src/sys/classes/viewer/interface/viewreg.c:435
[9] Unknown type. Check for miss-spelling or missing package:
https://petsc.org/release/install/install/#external-packages
[9] Unknown PetscViewer type given: hdf5

The relevant functions show on pydoc, what am I doing wrong ?

Cheers,

Quentin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220908/60bbecb6/attachment.html>


More information about the petsc-users mailing list