<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On Feb 9, 2023, at 3:38 AM, Zongze Yang <yangzongze@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Hi, Barry<div><br></div><div>Thanks for the tip.</div><div><br></div><div>One more question: how can I save the log (draw_lg) figure by using `draw:image:joe.ppm`?</div></div></div></blockquote><div><br></div> I am not sure what you mean. </div><div><br></div><div><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><span style="font-family: Menlo; font-size: 14px;">-ksp_monitor_solution draw:image:joe.ppm</span></blockquote></div></blockquote><div><br></div> Will create a directory called joe with a set of files in it. Each file contains one solution during the iterative process.</div><div><br></div><div> Barry</div><div><br></div><div><br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Thanks.</div><div>Zongze</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> 于2023年2月9日周四 05:35写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div> It cannot be done using the default X windows monitor and -draw_save because there is no way to distinguish the files for each sub window images.<div><br></div><div> However, there is an alternative. </div><div><br></div><div> <span style="font-family:Menlo;font-size:14px">-ksp_view_eigenvalues draw:image:jeff.ppm -viewer_view -ksp_monitor_solution draw:image:joe.ppm</span></div><div><font face="Menlo"><span style="font-size:14px"><br></span></font></div><div><font face="Menlo"><span style="font-size:14px"> </span></font>This alternative only supports .ppm files (so you may need to call a converter on the result) and does put each image in a separate file in its own named directory, for example, joe/joe_0.ppm but at least it allows you to have different named files. Of course you can also just run your code twice with two different options.</div><div><br></div><div> Unfortunately there is a bug in the KSP eigenmonitor viewing that I had to fix to get this to work so you'll need to checkout the <b style="color:rgb(200,20,201);font-family:Menlo;font-size:14px">barry/2023-02-08/fix-ksp-monitor-eigenvalues-draw </b>branch of PETSc to use the option I suggest.</div><div><br></div><div> Barry</div><div><br></div><div><br></div><div> </div><div><div><br><blockquote type="cite"><div>On Feb 8, 2023, at 5:09 AM, Zongze Yang <<a href="mailto:yangzongze@gmail.com" target="_blank">yangzongze@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>Hi, PETSc group,</div><div><br></div><div>I was trying to save figures of the residual and eigenvalues with different names but not default names.</div><div><br></div><div>The default name is used when I use `-draw_save .png`. All images are saved.</div><div>```</div><div>python test.py -N 16 -test1_ksp_type gmres -test1_pc_type jacobi -test1_ksp_view_eigenvalues draw -test1_ksp_monitor draw::draw_lg -draw_save .png<br></div><div>```</div><div>But when I use `-draw_save abc.png`, only the figure of eigenvalues is saved.</div><div><div>```</div><div>python test.py -N 16 -test1_ksp_type gmres -test1_pc_type jacobi -test1_ksp_view_eigenvalues draw -test1_ksp_monitor draw::draw_lg -draw_save .png<br></div><div>```</div></div><div><br></div><div> How can I add the command line options, to specify different names for those images?<br></div><div></div><div><br></div><div>Thanks,</div><div>Zongze</div></div>
</div></blockquote></div><br></div></div></blockquote></div>
</div></blockquote></div><br></body></html>