[petsc-users] KSPSolve with both vectors being the same and MatShell

Jed Brown jedbrown at mcs.anl.gov
Thu Oct 25 07:29:57 CDT 2012

On Thu, Oct 25, 2012 at 6:49 AM, Thomas Witkowski <
thomas.witkowski at tu-dresden.de> wrote:

> Following the documentation it is allowed to set the rhs and solution
> vectors in KSPSolve to be the same. When my KSPSolve is based on a
> MatShell, must the MatShell operator function be implemented to handle also
> the case that both vectors are the same? Or can I assume, within MatShell,
> that both vectors, which are provided by KSPSolve, are really two different
> objects?

This is taken care of by KSPSolve, so the vectors are always different in
the implementations. Note that MatMult is typically used with different
vectors internal to the KSP. The MatMult documentation requires the vectors
to be different.

> Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121025/1ca9ac56/attachment.html>

More information about the petsc-users mailing list