<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">Alfredo,</div>
<div class=""><br class="">
</div>
<div class="">TSTrajectory currently supports binary format only. See </div>
<div class=""><br class="">
</div>
<a href="https://www.mcs.anl.gov/petsc/petsc-current/src/ts/trajectory/impls/basic/trajbasic.c.html#TSTrajectorySet_Basic" class="">https://www.mcs.anl.gov/petsc/petsc-current/src/ts/trajectory/impls/basic/trajbasic.c.html#TSTrajectorySet_Basic</a>
<div class=""><a href="https://www.mcs.anl.gov/petsc/petsc-current/src/ts/trajectory/impls/visualization/trajvisualization.c.html#TSTrajectorySet_Visualization" class="">https://www.mcs.anl.gov/petsc/petsc-current/src/ts/trajectory/impls/visualization/trajvisualization.c.html#TSTrajectorySet_Visualization</a></div>
<div class=""><br class="">
</div>
<div class="">It should not be difficult to extend TSTrajectory for HDF5 support. You are welcome to contribute an MR to add this feature. </div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Hong (Mr.)<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jun 30, 2021, at 9:17 PM, Alfredo J Duarte Gomez <<a href="mailto:aduarteg@utexas.edu" class="">aduarteg@utexas.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Good evening,
<div class=""><br class="">
</div>
<div class="">My group and I are in the process of developing an application using PETSc, and we are currently planning and figuring out the best objects to do this. I currently have some questions about visualization and I/O.</div>
<div class=""><br class="">
</div>
<div class="">Some of the most important features that we want in the process of developing this code is the ability for easy checkpoint/restarts and visualization. As we are working with a time dependent PDE, I have stumbled upon the "ts" and "tstrajectory"
objects that seem to have some very helpful features. However, I am having some trouble extracting information out of the the "tstrajectory" object in an HDF5 format. I initially thought something like this would work, where tj was obtained using TSGetTrajectory(ts,&tj)
after a successful solve of the ts object:</div>
<div class=""><br class="">
</div>
<div class="">PetscViewer viewer;<br class="">
PetscViewerHDF5Open(PETSC_COMM_WORLD,"output.h5",FILE_MODE_WRITE,&viewer);CHKERRQ(ierr);<br class="">
TSTrajectoryView(tj,viewer);CHKERRQ(ierr); <br class="">
PetscViewerDestroy(&viewer);CHKERRQ(ierr);<br class="">
</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">However, the output file comes out empty. Do I have to extract the solutions one by one? How would I do that? Does the HDF5 viewer only work with vector objects or can it be generalized to other objects? I am trying to maintain the highest degree
of abstraction possible (i.e. multiple 2d ode solutions in one hdf5 file).</div>
<div class=""><br class="">
</div>
<div class="">This seems favorable to me because it would be easy to use the HDF5 file for postprocessing/visualization and restarts, but let me know if you think this is a bad idea and it would be better to just use the HDF5 for output/postprocess and use
native PETSc binary files for restarts. </div>
<div class=""><br class="">
</div>
<div class="">Additionally, as I move towards large visualizations, I would like to use Paraview. I saw that the best way of doing this is to use the <span style="white-space: pre-wrap;" class="">petsc_gen_xdmf.py script on an HDF5 solution file. Is this still
the best way for PETSc visualization with Paraview?</span></div>
<div class=""><span style="white-space: pre-wrap;" class=""><br class="">
</span></div>
<div class=""><span style="white-space: pre-wrap;" class=""><br class="">
</span></div>
<div class="">Thank you,</div>
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class=""><font face="arial, sans-serif" class="">Alfredo Duarte</font>
<div class=""><font face="arial, sans-serif" class="">Graduate Research Assistant</font></div>
<div class=""><font face="arial, sans-serif" class="">The University of Texas at Austin</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>