[petsc-users] petsc_gen_xdmf.py error

Matteo Semplice matteo.semplice at unito.it
Wed Mar 14 15:23:29 CDT 2018


Hi everybody,

     I am trying to follow the advice for output given in the recent 
thread on this list

https://lists.mcs.anl.gov/pipermail/petsc-users/2018-February/034546.html

At the end of each timestep in my code I do

   {
   PetscViewer outputToFile;
   char filename[50];
   sprintf(filename,"press%d.h5",ctx.its);
PetscViewerHDF5Open(PETSC_COMM_WORLD,filename,FILE_MODE_WRITE,&outputToFile); 

   DMView(ctx.dap,outputToFile);
   VecView(ctx.p,outputToFile);
   PetscViewerDestroy(&outputToFile);
   }

so that I have press%d.h5 files on disk at the end of the execution with 
the data from the vector ctx.p (which is associated to the DMDA ctx.dap).

By using h5tovtk of the Debian h5-tools package I had a look at the 
files and they seem all right, except that they appear rotated by 90 
degrees when loaded in Paraview, so the output part probably went ok.

However the call

$ /usr/lib/petsc/bin/petsc_gen_xdmf.py press1.h5

gives the error

Traceback (most recent call last):
   File "/usr/lib/petsc/bin/petsc_gen_xdmf.py", line 241, in <module>
     generateXdmf(f)
   File "/usr/lib/petsc/bin/petsc_gen_xdmf.py", line 211, in generateXdmf
     geom      = h5['geometry']
   File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper 
(/build/h5py-b1xqNM/h5py-2.7.0/h5py/_objects.c:2842)
   File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper 
(/build/h5py-b1xqNM/h5py-2.7.0/h5py/_objects.c:2800)
   File "/usr/lib/python2.7/dist-packages/h5py/_hl/group.py", line 169, 
in __getitem__
     oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
   File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper 
(/build/h5py-b1xqNM/h5py-2.7.0/h5py/_objects.c:2842)
   File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper 
(/build/h5py-b1xqNM/h5py-2.7.0/h5py/_objects.c:2800)
   File "h5py/h5o.pyx", line 190, in h5py.h5o.open 
(/build/h5py-b1xqNM/h5py-2.7.0/h5py/h5o.c:3736)
KeyError: "Unable to open object (Object 'geometry' doesn't exist)"

Could you give me any insight on this?

(Later I will need to output and visualize in Paraview more than one Vec 
and they are associated different DA's. Is creating an h5 file for each 
DA and output to that DM all the Vec associated to that DA the preferred 
way to go?)

Best,
     Matteo Semplice

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180314/3269ea0e/attachment.html>


More information about the petsc-users mailing list