Call these functions when you assemble a matrix (after MatSetValues). You should call KSPSetOperators() before solving a system with a different matrix. When the matrix is constant, just call KSPSolve() multiple times without anything in between.<br>
<br><div class="gmail_quote">On Fri, Jun 29, 2012 at 12:20 PM, Bernardo Rocha <span dir="ltr"><<a href="mailto:bernardomartinsrocha@gmail.com" target="_blank">bernardomartinsrocha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everyone,<br><br>I've a simple question: I'm solving successive linear systems, and the way I've implemented my problem it calls MatAssemblyBegin and MatAssemblyEnd every time before the call to KSPSolve. The sparsity pattern of my matrix does not change between the calls. Is it necessary to call the pair MatAssemblyBegin/End every time? If it is not necessary, do these routines check if I've already assembled the matrices or not? Does it hurt performance if I do so?<br>
<br>Thanks.<br>Best regards,<br>Bernardo M. R.<br><br><br>
</blockquote></div><br>