[petsc-users] Doubt about TSMonitorSolutionVTK

Matthew Knepley knepley at gmail.com
Mon Jul 1 07:09:44 CDT 2024


On Mon, Jul 1, 2024 at 1:43 AM MIGUEL MOLINOS PEREZ <mmolinos at us.es> wrote:

> Dear Matthey,
>
> Sorry for the late response.
>
> Yes, I get output when I run the example mentioned by Barry.
>
> The output directory should not be an issue since with the exact same
> configuration works for hdf5 but not for vtk/vts/vtu.
>
> I’ve been doing some tests and now I think this issue might be related to
> the fact that the output vector was generated using a SWARM discretization.
> Is this possible?
>

Yes, there is no VTK viewer for Swarm. We have been moving away from VTK
format, which is bulky and not very expressive, into our own HDF5 and CGNS.
When we use HDF5, we have a script to generate an XDMF file, telling
Paraview how to view it. I agree that this is annoying. Currently, we are
moving toward PyVista, which can read our HDF5 files directly (and also
work directly with running PETSc), although this is not done yet.

  Thanks,

     Matt


> Best,
> Miguel
>
> On Jun 27, 2024, at 4:59 AM, Matthew Knepley <knepley at gmail.com> wrote:
>
> Do you get output when you run an example with that option? Is it possible
> that your current working directory is not what you expect? Maybe try
> putting in an absolute path.
>
>   Thanks,
>
>     Matt
>
> On Wed, Jun 26, 2024 at 5:30 PM MIGUEL MOLINOS PEREZ <mmolinos at us.es>
> wrote:
>
>> Sorry, I did not put in cc petsc-users@ mcs. anl. gov my replay. Miguel
>> On Jun 24, 2024, at 6: 39 PM, MIGUEL MOLINOS PEREZ <mmolinos@ us. es>
>> wrote: Thank you Barry, This is exactly how I did it the first time. Miguel
>> On Jun 24, 2024, at 6: 37
>> ZjQcmQRYFpfptBannerStart
>> This Message Is From an External Sender
>> This message came from outside your organization.
>>
>> ZjQcmQRYFpfptBannerEnd
>> Sorry, I did not put in cc petsc-users at mcs.anl.gov my replay.
>>
>> Miguel
>>
>> On Jun 24, 2024, at 6:39 PM, MIGUEL MOLINOS PEREZ <mmolinos at us.es> wrote:
>>
>> Thank you Barry,
>>
>> This is exactly how I did it the first time.
>>
>> Miguel
>>
>> On Jun 24, 2024, at 6:37 PM, Barry Smith <bsmith at petsc.dev> wrote:
>>
>>
>>    See, for example, the bottom of src/ts/tutorials/ex26.c  that uses
>> -ts_monitor_*solution_vtk* 'foo-%03d.vts'
>>
>>
>> On Jun 24, 2024, at 8:47 PM, MIGUEL MOLINOS PEREZ <mmolinos at us.es> wrote:
>>
>> This Message Is From an External Sender
>> This message came from outside your organization.
>> Dear all,
>>
>> I want to monitor the results at each iteration of TS using vtk format.
>> To do so, I add the following lines to my Monitor function:
>>
>> char vts_File_Name[MAXC];
>> PetscCall(PetscSNPrintf(vts_File_Name, sizeof(vts_File_Name),
>> "./xi-MgHx-hcp-cube-x5-x5-x5-TS-BE-%i.vtu", step));
>> PetscCall(TSMonitorSolutionVTK(ts, step, time, X, (void*)vts_File_Name));
>>
>> My script compiles and executes without any sort of warning/error
>> messages. However, no output files are produced at the end of the
>> simulation. I’ve also tried the option “-ts_monitor_solution_vtk
>> <filename-%03D.vts>”, but I got no results as well.
>>
>> I can’t find any similar example on the petsc website and I don’t see
>> what I am doing wrong. Could somebody point me to the right direction?
>>
>> Thanks,
>> Miguel
>>
>>
>>
>>
>>
>
> --
> 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
>
> https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!Z7mz0y2UTXd_x6juHCeo7JisCZjgURW-1JAShrF2hePo3YnESyhFi9psugjCeGNce_91dMHtb2KJEe1KXx1t$ 
> <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!Z7mz0y2UTXd_x6juHCeo7JisCZjgURW-1JAShrF2hePo3YnESyhFi9psugjCeGNce_91dMHtb2KJEVRHZKJf$ >
>
>
>

-- 
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

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!Z7mz0y2UTXd_x6juHCeo7JisCZjgURW-1JAShrF2hePo3YnESyhFi9psugjCeGNce_91dMHtb2KJEe1KXx1t$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!Z7mz0y2UTXd_x6juHCeo7JisCZjgURW-1JAShrF2hePo3YnESyhFi9psugjCeGNce_91dMHtb2KJEVRHZKJf$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240701/12e01fa5/attachment-0001.html>


More information about the petsc-users mailing list