[petsc-users] MatAssemblyBegin-End

Jed Brown jedbrown at mcs.anl.gov
Fri Jun 29 15:29:40 CDT 2012


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.

On Fri, Jun 29, 2012 at 12:20 PM, Bernardo Rocha <
bernardomartinsrocha at gmail.com> wrote:

> Hi everyone,
>
> 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?
>
> Thanks.
> Best regards,
> Bernardo M. R.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120629/f2823a18/attachment.html>


More information about the petsc-users mailing list