[petsc-users] Any examples to output a dmplex mesh as a hdf5 file?

Matthew Knepley knepley at gmail.com
Wed Jun 25 10:46:36 CDT 2014


On Tue, Jun 24, 2014 at 7:50 AM, Fande Kong <fd.kong at siat.ac.cn> wrote:

> Hi all,
>
> There are some functions called DMPlex_load_hdf5 and DMPlex_view_hdf5 in
> petsc-dev.  They are really good functions for outputting the solution as a
> hdf5 file in parallel. Are there any examples to show how  to use these
> functions? Or are there some printed hdf5 and xdmf files that can be
> visualized by paraview?
>

This is very new code. I plan to write a manual section as soon as the
functionality solidifies. However, here is how I am currently using it.
Anywhere that you think about viewing something add

    ierr = PetscObjectViewFromOptions((PetscObject) obj, prefix,
"-my_obj_view");CHKERRQ(ierr);

Then you can use the standard option style

  -my_obj_view hdf5:my.h5

This extends nicely to many objects. Here is what I use for my magma
dynamics output

  -dm_view hdf5:sol_solver_debug.h5 -magma_view_solution
hdf5:sol_solver_debug.h5::append -compaction_vec_view
hdf5:sol_solver_debug.h5:HDF5_VIZ:append

There is still a problem in that you cannot choose multiple formats using
this method. I am going to extend
the view options format

  type:file:format:mode

to allow

  type:file:format,format,format:mode

to handle this.

  Thanks,

      Matt


> Thanks,
>
> Fande,
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140625/a10b592e/attachment.html>


More information about the petsc-users mailing list