[petsc-users] Multiple KSP Solver

Anthony Vergottis a.vergottis at gmail.com
Thu Jun 6 15:02:31 CDT 2013


Dear All,

This message is related to the multiple use of a single KSP solver context.

*My question is*: If I set up a KSP solver is it possible to use it as many
times as I require?

*What I mean*: If I create a KSP solver called *solver* and associate with
it the required Matrix i.e. the A matrix of the system and the right had
side vector b. I then solve the system calling  KSPSolve(*solver*,b,Solution);
for example.

Say now I want to re-use the same context *solver* but I supply a different
right had side vector b and again call the same command
KSPSolve(*solver*,b,Solution);, is this sufficient to perform the new solve
correctly and get a new solution vector x? Will it reuse the before
specified matrix A in the system (and the same solver eg. GMRES and
preconditioner)? or do I need to recreate a new solver each time? is there
any specific behaviour of Petsc I need to be aware off?

Solution algorithm is an iterative one and I require to solve 5 different
equations at different time-step, the only thing that changes from each
time step is the right had side vector of the system. So the matrix A for
all the equations are the same at each time step.

I hope I explained this good enough. Sorry if this is a trivial questions.

Thanks in advance.

Regards,
Anthony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130606/125299ad/attachment.html>


More information about the petsc-users mailing list