[petsc-users] HDF5 vec output with DMPlex

Matthew Knepley knepley at gmail.com
Tue Oct 27 07:01:09 CDT 2015


On Mon, Oct 26, 2015 at 10:03 PM, Adrian Croucher <a.croucher at auckland.ac.nz
> wrote:

> hi
>
> When I read the HDF5 file back in again using PetscViewerHDF5Open() and
> VecLoad(), is there any easy way to navigate to the last time step in the
> results?
>
> Or, equivalently, to find how many timesteps there are in there, so I
> could then use PetscViewerHDF5SetTimestep() before doing VecLoad() ?
>

I am using

      ierr = PetscViewerHDF5PushGroup(user.checkpoint,
"/fields");CHKERRQ(ierr);
      ierr = DMSetOutputSequenceNumber(dm, user.restart, 0.0);CHKERRQ(ierr);
      ierr = VecLoad(u, user.checkpoint);CHKERRQ(ierr);
      ierr = DMOutputSequenceLoad(dm, user.checkpoint, "time",
user.restart, &time);CHKERRQ(ierr);
      ierr = TSSetTime(ts, (PetscReal) time);CHKERRQ(ierr);
      ierr = DMSetOutputSequenceNumber(dm, 0, 0.0);CHKERRQ(ierr);
      ierr = PetscViewerHDF5PopGroup(user.checkpoint);CHKERRQ(ierr);
      ierr = PetscViewerDestroy(&user.checkpoint);CHKERRQ(ierr);

but right now I do not have a query for the last timestep. We will have to
add an HDF5 query for this. I
am putting it on the list.

  Thanks,

    Matt


> Cheers, Adrian
>
> On 17/10/15 03:01, Matthew Knepley wrote:
>
>
> Now I remember. I did not want the output to depend on the viewer.
>
> Does your example work if you replace PetscViewerHDF5SetTimestep() with
> DMSetOutputSequenceNumber()?
>
>   Thanks,
>
>     Matt
>
>
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 84611
>
>


-- 
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/20151027/a3141450/attachment.html>


More information about the petsc-users mailing list