KSP/PC choice

Stephan Kramer stephan.kramer at imperial.ac.uk
Fri Jul 27 05:58:14 CDT 2007


Hi Tim,

As Guy said MUMPS is a direct solver, i.e. it constructs the inverse of
the matrix (in some sense) and applies that to the rhs. This means first
of all you need quite a lot of memory, as  you need to store a dense
matrix, but also that there is no iterative process. You do not/should
not supply an initial guess. ksp_type should really be preonly, anything
else doesn't make sense. As there are no iterations, it also doesn't
return a number of iterations and there is also no convergence to
monitor,

Hope this helps

Cheers
Stephan

On Fri, 2007-07-27 at 09:21 +0200, Tim Kröger wrote:
> Dear Matt
> 
> On Wed, 25 Jul 2007, Matthew Knepley wrote:
> 
> >> -ksp_type preonly
> >> -pc_type lu
> >> -mat_type aijmumps
> >> -ksp_monitor
> >> 
> > It appears that you never call MatSetFromOptions() on the matrix you
> > create, which would prevent the option from changing the type.
> 
> Thank you very much for your help.  Now, the MUMPS solver is working 
> for me, and it really seems to solve the problem that I was working on 
> for nearly a year now!
> 
> However, I have one more question: I usually call 
> KSPGetIterationNumber() after the solve, and if it tells me that 0 KSP 
> iterations have been used, I assume that the initial guess was already 
> accurate enough.  In this case, I don't have to solve the system in 
> the next time steps anymore until some change of the setting takes 
> place (which happens from time to time in my application).  This saves 
> a lot of computational time.  However, with the MUMPS solver, 
> KSPGetIterationNumber() never supplies 0.  Is there any possibility to 
> find out whether the initial guess was accurate enough?
> 
> (It might be noteworthy that I use "-ksptype richardson" instead of 
> "-ksptype preonly" since in the latter case I get an error message due 
> to my non-zero initial guess.)
> 
> Also, I would like to know whether there is any possibility to monitor 
> the convergence of the MUMPS solver (analogously to -kspmonitor).
> 
> Best Regards,
> 
> Tim
> 




More information about the petsc-users mailing list