[petsc-users] force KSP to perform at least a single iteration

Matthew Knepley knepley at gmail.com
Sun Jul 27 11:01:45 CDT 2014


On Sun, Jul 27, 2014 at 10:45 AM, Rolf Kuiper <kuiper at mpia.de> wrote:

> Dear PETSc users and developers,
>
> is there an easy way to set a *minimum* iteration number to a KSP context
> (such as a maximum iteration number in KSPSetTolerances())?
>
> I don't know, if the following explanation is useful, but I will try to
> give an example usage here:
> I need this to e.g. solve a linear system of equations several times (as
> the physical system proceeds in time); during a single call / timestep, the
> system, might not change stronger than the RTOL in use, but in the long-run
> (several hundreds to thousands of calls), the system will actually change
> by several RTOL; nonetheless, the default KSP solver stops without doing
> any iteration (= 0), i.e. the system does not change at all.
>

1) This explanation makes no sense to me. Either you have a difference
greater than the tolerance or not.


> I have the feeling that it might be possible by using my own convergence
> test with KSPSetConvergenceTest(), but I am not 100% sure and would prefer
> to go with the standard PETSc convergence test, just adding the *minimum* iteration
> number.
>

2) The easiest thing to do is make a custom convergence test that
immediately returns no if its the first iterate, and otherwise calls the
default test.

  Thanks,

      Matt


> Thanks a lot,
> Rolf
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140727/00d8ab19/attachment.html>


More information about the petsc-users mailing list