<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 26, 2015 at 10:03 PM, Adrian Croucher <span dir="ltr"><<a href="mailto:a.croucher@auckland.ac.nz" target="_blank">a.croucher@auckland.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
hi<br>
<br>
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?<br>
<br>
Or, equivalently, to find how many timesteps there are in there, so
I could then use PetscViewerHDF5SetTimestep() before doing VecLoad()
?<br></div></blockquote><div><br></div><div>I am using</div><div><br></div><div><div> ierr = PetscViewerHDF5PushGroup(user.checkpoint, "/fields");CHKERRQ(ierr);</div><div> ierr = DMSetOutputSequenceNumber(dm, user.restart, 0.0);CHKERRQ(ierr);</div><div> ierr = VecLoad(u, user.checkpoint);CHKERRQ(ierr);</div><div> ierr = DMOutputSequenceLoad(dm, user.checkpoint, "time", user.restart, &time);CHKERRQ(ierr);</div><div> ierr = TSSetTime(ts, (PetscReal) time);CHKERRQ(ierr);</div><div> ierr = DMSetOutputSequenceNumber(dm, 0, 0.0);CHKERRQ(ierr);</div><div> ierr = PetscViewerHDF5PopGroup(user.checkpoint);CHKERRQ(ierr);</div><div> ierr = PetscViewerDestroy(&user.checkpoint);CHKERRQ(ierr);</div></div><div><br></div><div>but right now I do not have a query for the last timestep. We will have to add an HDF5 query for this. I</div><div>am putting it on the list.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
Cheers, Adrian<span class=""><br>
<br>
<div>On 17/10/15 03:01, Matthew Knepley
wrote:<br>
</div>
</span><span class=""><blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><br>
<div>Now I remember. I did not want the output to depend on
the viewer.</div>
<div><br>
</div>
<div>Does your example work if you replace
PetscViewerHDF5SetTimestep() with
DMSetOutputSequenceNumber()?</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
</div>
</div>
</div>
</blockquote>
</span><pre cols="72"><span class=""><font color="#888888">--
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: <a href="mailto:a.croucher@auckland.ac.nz" target="_blank">a.croucher@auckland.ac.nz</a></font></span><span class="">
tel: +64 (0)9 923 84611
</span></pre>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="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>