[petsc-users] Equivalent function call for -mg_levels_ksp_type & -mg_levels_pc_type

Milan Pelletier milan.pelletier at protonmail.com
Thu May 6 10:08:33 CDT 2021


Dear users,

I would like to know what function call would allow me to achieve the same result as using the two flags
-mg_levels_ksp_type richardson
-mg_levels_pc_type jacobi
and then PCSetFromOptions().
I would prefer not to rely on command-line options and rather do the setup "by hand".

To achieve that, what should I add after these lines:
KSPCreate(PETSC_COMM_WORLD, solver);
KSPSetType(solver, KSPCG);
KSPGetPC(solver, &pc);
PCSetType(pc, PCGAMGAGG);
<here I don't know what to set>

Thanks for your help,
Regards,

Milan Pelletier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210506/5db25414/attachment.html>


More information about the petsc-users mailing list