<div dir="ltr"><div dir="ltr">On Sun, Feb 23, 2020 at 6:45 PM Richard Beare <<a href="mailto:richard.beare@monash.edu">richard.beare@monash.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><table><tbody><tr><td id="gmail-m_723507817431856979gmail-LC356">That's what I did (see below), but I got ordering errors (unfortunately deleted those logs too soon). I'll rerun if no one recognises what I've done wrong.<br><br>PetscViewer viewer1;</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-LC357"> ierr = <span>PetscViewerBinaryOpen</span>(PETSC_COMM_WORLD,fileName.<span>c_str</span>(),FILE_MODE_WRITE,&viewer1);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-LC358"> <span><span>//</span>ierr = PetscViewerSetFormat(viewer1,PETSC_VIEWER_BINARY_MATLAB);CHKERRQ(ierr);</span></td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-LC359"> ierr = <span>PetscViewerPushFormat</span>(viewer1,PETSC_VIEWER_BINARY_MATLAB);<span>CHKERRQ</span>(ierr);</td></tr></tbody></table></div></blockquote><div><br></div><div>This should not cause problems. However, is it possible that somewhere you are pushing a format</div><div>again and again without popping? This could exceed the stack size.</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:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><table><tbody><tr><td id="gmail-m_723507817431856979gmail-LC361"> ierr = <span>PetscObjectSetName</span>((PetscObject)<span>mX</span>,<span><span>"</span>x<span>"</span></span>);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-LC362"> ierr = <span>PetscObjectSetName</span>((PetscObject)<span>mB</span>,<span><span>"</span>b<span>"</span></span>);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 24 Feb 2020 at 10:43, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<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 dir="ltr"><div dir="ltr">On Sun, Feb 23, 2020 at 6:25 PM Richard Beare via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br> </div><div>Hi,</div><div>The following code gives a deprecation warning. What is the correct way of updating the use of ViewerSetFormat to ViewerPushFormat (which I presume is the preferred replacement). My first attempt gave errors concerning ordering.</div></div></blockquote><div><br></div><div>You can't just change SetFormat to PushFormat here?</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks</div><div><br></div><div dir="ltr">PetscViewer viewer1;<table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC357"> ierr = <span>PetscViewerBinaryOpen</span>(PETSC_COMM_WORLD,fileName.<span>c_str</span>(),FILE_MODE_WRITE,&viewer1);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC358"> ierr = <span>PetscViewerSetFormat</span>(viewer1,PETSC_VIEWER_BINARY_MATLAB);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC359">
<br></td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC360"> ierr = <span>PetscObjectSetName</span>((PetscObject)<span>mX</span>,<span><span>"</span>x<span>"</span></span>);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC361"> ierr = <span>PetscObjectSetName</span>((PetscObject)<span>mB</span>,<span><span>"</span>b<span>"</span></span>);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC362">
<br></td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC363"> ierr = <span>VecView</span>(<span>mX</span>,viewer1);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC364"> ierr = <span>VecView</span>(<span>mB</span>,viewer1);<span>CHKERRQ</span>(ierr);</td>
</tr>
<tr>
</tr></tbody></table><table><tbody><tr><td id="gmail-m_723507817431856979gmail-m_-8725774226813599504gmail-m_1427995789408475818gmail-LC365">
<br></td>
</tr>
<tr>
</tr></tbody></table><br>-- <br><div dir="ltr"><div dir="ltr"><div>--<br>A/Prof Richard Beare<br>Imaging and Bioinformatics, Peninsula Clinical School</div><div><span><div><span><a href="http://orcid.org/0000-0002-7530-5664" target="_blank">orcid.org/0000-0002-7530-5664</a></span></div></span></div><div><a href="mailto:Richard.Beare@monash.edu" target="_blank">Richard.Beare@monash.edu</a><br>+61 3 9788 1724<br><span><br></span></div><div><br></div><div><span></span><br>Geospatial Research: <a href="https://www.monash.edu/medicine/scs/medicine/research/geospatial-analysis" target="_blank">https://www.monash.edu/medicine/scs/medicine/research/geospatial-analysis</a></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div>--<br>A/Prof Richard Beare<br>Imaging and Bioinformatics, Peninsula Clinical School</div><div><span><div><span><a href="http://orcid.org/0000-0002-7530-5664" target="_blank">orcid.org/0000-0002-7530-5664</a></span></div></span></div><div><a href="mailto:Richard.Beare@monash.edu" target="_blank">Richard.Beare@monash.edu</a><br>+61 3 9788 1724<br><span><br></span></div><div><br></div><div><span></span><br>Geospatial Research: <a href="https://www.monash.edu/medicine/scs/medicine/research/geospatial-analysis" target="_blank">https://www.monash.edu/medicine/scs/medicine/research/geospatial-analysis</a></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>