views:

39

answers:

1

Do anyone know a good and basic tutorial to how to implement my own Krylov method that is not provided with PETSc in PETSc.

It should teach how to execute them as well...

+1  A: 

I suggest starting by copying a simple Krylov method. The conjugate gradients implementation might look intimidating because it can do lots of extra things like computing eigen and singular values, a better starting place would be Conjugate Residuals (src/ksp/ksp/impls/cr/cr.c). If your method is similar to an existing method (e.g. IDR is similar to BiCGStab(l)) then you might want to start there.

Fundamentally, you just implement KSPCreate_XXX, KSPSetUp_XXX, KSPSolve_XXX, and KSPDestroy_XXX. If your method has any runtime parameters, you should also implement KSPSetFromOptions_XXX and KSPView_XXX.

If you have any questions, ask on the mailing list or at [email protected] (if you don't want to subscribe or want to keep the correspondence private) and we will help. When you have something, please consider contributing it.

Jed