← Back to team overview

dolfin team mailing list archive

Re: [HG] Cleanup KrylovSolver:

 

On Tue, Mar 14, 2006 at 06:32:27PM +0100, Garth N. Wells wrote:

> > Cleanup KrylovSolver:
> > 
> >  - Remove setFoo() functions in public interface
> >  - Cleanup and restructure implementation
> > 
> > Please check that everything looks ok. I think it the code is easier
> > to follow now, but I may be wrong.
> > 
> 
> Looks a lot nicer, and now solver parameters can be set through objects
> which use use KrylovSolver (like PDE and NewtonSolver). To allow full
> functionality, I think that LU should become a special case of a
> KrylovSolver so that an LU solver can be chosen when using  PDE,
> NewtonSolver or any other class which uses a solver. 

I think that's already possible:

    pde.set("solver", "direct");

That will choose the LU solver, at least in LinearPDE.

The LU solver is a special case of Krylov in PETSc. We could make it a
special case of the KrylovSolver, but there's enough code in LU.cpp
that I'm not so keen on throwing into KrylovSolver.cpp.

> I see that the private member functions setSolver() and
> setPreconditioner() are still there. They could be removed and the
> necessary code placed in KrylovSolver::init(..). Alternatively, they
> could be kept and called from within KrylovSolver::init(..) rather than
> KrylovSolver::solve(..).
> 
> Garth

I thought about doing this (calling them from the init() function) but
I didn't want to mess with the logic of the init() function (return
when not needing to initialize). We could move the stuff in init() to
say initKSP() and then call all three from init()?

/Anders



Follow ups

References