> Yes, this is what I did. > But I have a function that sets up the preconditioner by taking a KSP > as an argument. Depending on the problem being solved, it can be a > single KSP or a sub-KSP coming from a field split (which if there are > lagrange multipliers, can be further split again). So I was looking for > a call that would work on the KSP passed as an argument. The option > string won't work in the general field-split case.
You can provide multiple options with PetscOptionsSetValue() for example >> PetscOptionsSetValue(NULL,"-mg_levels_pc_type","sor"); >> PetscOptionsSetValue(NULL,"-fieldsplit_0_mg_levels_pc_type","sor"); etc and any "extra" ones not appropriate for your particular case will just be ignored. > On May 20, 2022, at 3:25 PM, Jeremy Theler <[email protected]> wrote: > > On Fri, 2022-05-20 at 14:48 -0400, Barry Smith wrote: >>> >>> The default smoothing PC changed from sor to jacobi in 3.17. >> >> Note that this is only for GAMG, it is not for geometric multigrid >> (using PCMG directly). > > Indeed, I was asking about GAMG specifically. > >> >>> The >>> Changelog says the old behavior can be recovered by using >>> -mg_levels_pc_type sor. >> >> The easiest is just doing >> >> PetscOptionsSetValue(NULL,"-mg_levels_pc_type","sor"); > > Yes, this is what I did. > But I have a function that sets up the preconditioner by taking a KSP > as an argument. Depending on the problem being solved, it can be a > single KSP or a sub-KSP coming from a field split (which if there are > lagrange multipliers, can be further split again). So I was looking for > a call that would work on the KSP passed as an argument. The option > string won't work in the general field-split case. > >> >> Unfortunately, there is no good way to set it with calls directly >> on the KSP or MG object. One >> needs to loop through the levels and set it for the PC on each level. > > Maybe this is doable. I'll take a stab with this approach. > Thanks Barry. > > -- > jeremy
