[petsc-users] Modify RHS values at each iteration

Jed Brown jedbrown at mcs.anl.gov
Thu Nov 21 00:09:46 CST 2013


TAY wee-beng <zonexo at gmail.com> writes:

> Hi,
>
> Due to a special case, I need modify RHS values of the system of eqns at 
> each iteration.
>
> Hence, what I can do is to solve the eqn using KSPSolve, limit the 
> maxits in KSPSetTolerances to 1, modify the RHS, and then run KSPSolve 
> again.
>
> It will loop until it reaches the convergences I specify.
>
> My question is if that's the only way, 

There is almost certainly a better way to formulate your problem.

> and will it suffer a large drop in speed?

That algorithm (without RHS modification) reduces to Richardson
preconditioned by one step of your chosen preconditioned iterative
method.  This likely converges much worse than a Krylov method.

Note that in the form you describe, the preconditioner will be applied
twice and the operator once.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131120/2529bc57/attachment.pgp>


More information about the petsc-users mailing list