[petsc-users] User defined solver for PCMG
Barry Smith
bsmith at mcs.anl.gov
Tue May 17 13:08:18 CDT 2016
> 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