[petsc-users] Retrieve a partial solution vector from AX=B

Hong Zhang hzhang at mcs.anl.gov
Sat Sep 29 16:31:32 CDT 2012


Tibo,
Unless your matrix has special structure that allows special algorithm
for computing only 1st few solution components, you have to compute
entire solution entires.

Hong


On Sat, Sep 29, 2012 at 2:55 PM, <tibo at berkeley.edu> wrote:

> Hi everyone,
>
> I am using petsc to solve a system AX=B. I use the classical user approach
> with a KSP context. In particular I use a LU factorization once (using the
> external package MUMPS here, but it could be something else) and then use
> KSP solve to solve for multiple different right hand sides.
>
> However in my problem, I am only interested in a few elements (Let's say
> as an example only the first 10 elements out of 100000) of the solution
> vector.
>
> Is there a way in petsc to ask to only retrieve the first few elements of
> the solution vector, or do I have to perform the full vector calculation
> and then "manually" retrieve the elements I want ?
>
> Thank you for your help,
>
> Tibo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120929/bcebbef4/attachment.html>


More information about the petsc-users mailing list