> On May 17, 2016, at 12:21 PM, Pratapa, Phanisri P <[email protected]> wrote:
> 
> Hi,
> 
> I am trying to find out if one can use a user defined linear solver function 
> in PCMG (instead of the default GMRES). According to the petsc manual, I can 
> change the solver/smoother through the KSP context and the available solvers, 
> but I am interested in using my own function (solver). 

   What do you mean here by "solver"? Do you want to provide a new Krylov 
method that is not currently in PETSc or a new preconditioner that is specific 
to your problem and cannot be written as a composition of preconditioners and 
Krylov methods already in PETSc?

   An example of your own custom preconditioner could be an SOR iteration that 
you hand code based on the stencil and doesn't use a stored matrix. In that 
case you would access the PC on the level and use PCSetType(subpc,PCSHELL) and 
PCShellSetApply(subpc, your custom function).

  Barry

> 
> Thank you,
> 
> Regards,
> 
> Pradeep

Reply via email to