<div>Dear users,<br></div><div><br></div><div>I would like to know what function call would allow me to achieve the same result as using the two flags <br></div><div>-mg_levels_ksp_type richardson<br></div><div>-mg_levels_pc_type jacobi<br></div><div>and then PCSetFromOptions().<br></div><div>I would prefer not to rely on command-line options and rather do the setup "by hand".<br></div><div><br></div><div>To achieve that, what should I add after these lines:<br></div><div>KSPCreate(PETSC_COMM_WORLD, solver);<br></div><div>KSPSetType(solver, KSPCG);<br></div><div>KSPGetPC(solver, &pc);<br></div><div>PCSetType(pc, PCGAMGAGG);<br></div><div><here I don't know what to set><br></div><div><br></div><div>Thanks for your help,<br></div><div>Regards,<br></div><div><br></div><div>Milan Pelletier<br></div><div><br></div>