[petsc-users] User defined solver for PCMG

Pratapa, Phanisri P ppratapa at gatech.edu
Tue May 17 13:14:11 CDT 2016


Barry,

What I mean is that: I want to implement multigrid preconditioning on a new Krylov method that is not currently in PETSc. For this, I was hoping that I could replace the KSPFGMRES smoother (default) with the "new solver" I have. But I do not have the new solver as a PETSc KSP yet.

Thank you,

Regards,

Pradeep
________________________________________
From: Barry Smith <bsmith at mcs.anl.gov>
Sent: Tuesday, May 17, 2016 2:08:18 PM
To: Pratapa, Phanisri P
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] User defined solver for PCMG

> On May 17, 2016, at 12:21 PM, Pratapa, Phanisri P <ppratapa at gatech.edu> 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



More information about the petsc-users mailing list