Just MatSetValues and MatAssembly* again.  If you use ADD_VALUES, then
you might MatZeroEntries before adding values.

Evan Um via petsc-users <[email protected]> writes:

> Hi PETSC users,
>
> I want to solve a number of matrix-vector equations. In each equation, the
> matrix has different values, but the sparsity pattern is unchanged. I can
> destroy a current matrix and create a new matrix. However, is there a more
> efficient way to do this task? Is there any code example for this kind of
> problem? In advance, thank you very much for your comments.
>
> Regards,
> Evan

Reply via email to