<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 21, 2016 at 9:53 PM, Mark Adams <span dir="ltr"><<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You have to add code to get dm_view to work apparently.<div><br></div><div>I have done this before. This is some hocus pocus that Toby gave me. Is this really the way?</div><div><br></div><div><div>    PetscViewer       viewer = NULL;</div><div>    PetscBool         flg;</div><div>    PetscViewerFormat fmt;</div><div>    ierr = DMViewFromOptions(dm,NULL,"-<wbr>dm_view");CHKERRQ(ierr);</div><div>    ierr = PetscOptionsGetViewer(ctx-><wbr>wComm,NULL,"-x2_vec_view",&<wbr>viewer,&fmt,&flg);CHKERRQ(<wbr>ierr);</div><div>    if (flg) {</div><div>      ierr = PetscViewerPushFormat(viewer,<wbr>fmt);CHKERRQ(ierr);</div><div>      ierr = VecView(dmpi->phi,viewer);<wbr>CHKERRQ(ierr);</div><div>      ierr = VecView(dmpi->rho,viewer);<wbr>CHKERRQ(ierr);</div><div>      ierr = PetscViewerPopFormat(viewer);<wbr>CHKERRQ(ierr);</div></div><div><div>   } </div><div>   ierr = PetscViewerDestroy(&viewer);<wbr>CHKERRQ(ierr);</div></div></div></blockquote><div><br></div><div>I can't see why you need this. Did the other options not work?</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 21, 2016 at 2:16 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  How about adding a least some documentation to bin/petsc_gen_xdmf.py<br>
<div class="m_8952556539110224029HOEnZb"><div class="m_8952556539110224029h5"><br>
<br>
> On Dec 21, 2016, at 1:14 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
><br>
> On Wed, Dec 21, 2016 at 12:56 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:<br>
> I ran with:<br>
><br>
> -snes_monitor_residual hdf5:res.h5<br>
> -snes_monitor_solution hdf5:sol.h5<br>
><br>
> and got h5 files that look OK:<br>
><br>
> That will stash vectors in the HDF5 file, but you still need to put in the DM as well<br>
><br>
>   -dm_view hdf5:ex1.h5<br>
>  -snes_monitor_residual hdf5:ex1.h5::append<br>
>  -snes_monitor_solution hdf5:ex1.h5::append<br>
><br>
>     Matt<br>
><br>
> -rw-r--r--  1 markadams  staff   19760 Dec 21 13:46 res.h5<br>
> -rw-r--r--  1 markadams  staff   19760 Dec 21 13:46 sol.h5<br>
><br>
> but then got this. Am I doing this wrong?<br>
><br>
> 13:46 multi-species *+> ~/Codes/landaufem/Plex$ ~/Codes/petsc/bin/petsc_gen_xd<wbr>mf.py res.h5<br>
> Traceback (most recent call last):<br>
>   File "/Users/markadams/Codes/petsc/<wbr>bin/petsc_gen_xdmf.py", line 241, in <module><br>
>     generateXdmf(f)<br>
>   File "/Users/markadams/Codes/petsc/<wbr>bin/petsc_gen_xdmf.py", line 211, in generateXdmf<br>
>     geom      = h5['geometry']<br>
>   File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrappe<wbr>r (/Users/travis/build/MacPython<wbr>/h5py-wheels/h5py/h5py/_<wbr>objects.c:2405)<br>
>   File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrappe<wbr>r (/Users/travis/build/MacPython<wbr>/h5py-wheels/h5py/h5py/_<wbr>objects.c:2362)<br>
>   File "/Users/markadams/homebrew/lib<wbr>/python2.7/site-packages/h5py/<wbr>_hl/group.py", line 160, in __getitem__<br>
>     oid = h5o.open(<a href="http://self.id" rel="noreferrer" target="_blank">self.id</a>, self._e(name), lapl=self._lapl)<br>
>   File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrappe<wbr>r (/Users/travis/build/MacPython<wbr>/h5py-wheels/h5py/h5py/_<wbr>objects.c:2405)<br>
>   File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrappe<wbr>r (/Users/travis/build/MacPython<wbr>/h5py-wheels/h5py/h5py/_<wbr>objects.c:2362)<br>
>   File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/Users/travis/build/MacPython<wbr>/h5py-wheels/h5py/h5py/h5o.c:<wbr>3456)<br>
> KeyError: "Unable to open object (Object 'geometry' doesn't exist)"<br>
><br>
><br>
><br>
> --<br>
> 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<br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">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></div>