<div dir="ltr"><div dir="ltr">On Wed, Mar 11, 2020 at 7:26 PM Adolfo Rodriguez <<a href="mailto:adantra@gmail.com">adantra@gmail.com</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">I have a situation with a c++ code where I get an error when destroying the solver context after destroying the matrix. I have the following lines at the end of my function<div><br></div><div>                   KSPDestroy(&ksp);<br>                 MatDestroy(&A);<br>                   PetscObjectDestroy((PetscObject*)&x);<br>                     PetscObjectDestroy((PetscObject*)&b);<br></div><div><br></div><div>It is a very simple program, very similar to the /ksp/ksp/ex1.c example. </div><div><br></div><div>I can destroy the solver context (ksp) or the matrix (A) but not both. Does anybody have a clue?</div></div></blockquote><div><br></div><div>Please send the whole program.</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"><div>Adolfo</div><div><br></div><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>